6
6
# Change "1..N" below to so that N matches last test number
8
BEGIN {$Image::ExifTool::noConfig = 1; $| = 1; print "1..3\n";}
8
BEGIN {$Image::ExifTool::noConfig = 1; $| = 1; print "1..10\n";}
9
9
END {print "not ok 1\n" unless $loaded;}
11
11
# test 1: Load ExifTool
47
50
print "ok $testnum\n";
53
# tests 4-8: Write CanonVRD as a block to various images
55
my $exifTool = new Image::ExifTool;
56
$exifTool->SetNewValuesFromFile('t/images/CanonVRD.vrd', 'CanonVRD');
57
$exifTool->Options(PrintConv => 0);
59
foreach $file (qw(Writer.jpg ExifTool.jpg CanonRaw.cr2 CanonRaw.crw CanonVRD.vrd)) {
61
if ($file eq 'CanonVRD.vrd') {
62
$exifTool->SetNewValuesFromFile('t/images/ExifTool.jpg', 'CanonVRD');
64
($ext = $file) =~ s/^\w+//;
65
$testfile = "t/${testname}_${testnum}_failed$ext";
67
$exifTool->WriteInfo("t/images/$file", $testfile);
68
my $info = $exifTool->ImageInfo($testfile, @checkTags);
69
if (check($exifTool, $info, $testname, $testnum)) {
74
print "ok $testnum\n";
78
# test 9: Delete VRD as a block
81
my $exifTool = new Image::ExifTool;
82
$exifTool->SetNewValue(CanonVRD => undef, Protected => 1);
83
$testfile = "t/${testname}_${testnum}_failed.jpg";
85
$exifTool->WriteInfo('t/images/ExifTool.jpg', $testfile);
86
$exifTool->Options(PrintConv => 0);
87
my $info = $exifTool->ImageInfo($testfile, @checkTags);
88
if (check($exifTool, $info, $testname, $testnum)) {
93
print "ok $testnum\n";
96
# test 10: Create a VRD file from scratch
99
my $exifTool = new Image::ExifTool;
100
$exifTool->SetNewValuesFromFile('t/images/ExifTool.jpg', 'CanonVRD');
101
$exifTool->Options(PrintConv => 0);
102
$testfile = "t/${testname}_${testnum}_failed.vrd";
104
$exifTool->WriteInfo(undef, $testfile);
105
my $info = $exifTool->ImageInfo($testfile, @checkTags);
106
if (check($exifTool, $info, $testname, $testnum, 8)) {
111
print "ok $testnum\n";