1# Before "make install", this script should be runnable with "make test".
2# After "make install" it should work as "perl t/GeoTiff.t".
3
4BEGIN {
5    $| = 1; print "1..4\n"; $Image::ExifTool::configFile = '';
6    require './t/TestLib.pm'; t::TestLib->import();
7}
8END {print "not ok 1\n" unless $loaded;}
9
10# test 1: Load the module(s)
11use Image::ExifTool 'ImageInfo';
12use Image::ExifTool::GeoTiff;
13$loaded = 1;
14print "ok 1\n";
15
16my $testname = 'GeoTiff';
17my $testnum = 1;
18
19# test 2: Extract information from GeoTiff.tif
20{
21    ++$testnum;
22    my $exifTool = new Image::ExifTool;
23    my $info = $exifTool->ImageInfo('t/images/GeoTiff.tif');
24    print 'not ' unless check($exifTool, $info, $testname, $testnum);
25    print "ok $testnum\n";
26}
27
28# test 3: Write some new information
29{
30    ++$testnum;
31    my @writeInfo = (['ResolutionUnit','cm']);
32    print 'not ' unless writeCheck(\@writeInfo, $testname, $testnum, 't/images/GeoTiff.tif');
33    print "ok $testnum\n";
34}
35
36# test 4: Copy GeoTiff information
37{
38    ++$testnum;
39    my $exifTool = new Image::ExifTool;
40    my $testfile = "t/${testname}_${testnum}_failed.out";
41    unlink $testfile;
42    $exifTool->SetNewValuesFromFile('t/images/GeoTiff.tif', 'GeoTiff*');
43    my $ok = writeInfo($exifTool,'t/images/ExifTool.tif',$testfile);
44    my $info = $exifTool->ImageInfo($testfile, 'GeoTiff:*');
45    if (check($exifTool, $info, $testname, $testnum) and $ok) {
46        unlink $testfile;
47    } else {
48        print 'not ';
49    }
50    print "ok $testnum\n";
51}
52
53
54# end
55