GPS.t 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. # Before "make install", this script should be runnable with "make test".
  2. # After "make install" it should work as "perl t/GPS.t".
  3. BEGIN { $| = 1; print "1..3\n"; $Image::ExifTool::noConfig = 1; }
  4. END {print "not ok 1\n" unless $loaded;}
  5. # test 1: Load the module(s)
  6. use Image::ExifTool 'ImageInfo';
  7. use Image::ExifTool::GPS;
  8. $loaded = 1;
  9. print "ok 1\n";
  10. use t::TestLib;
  11. my $testname = 'GPS';
  12. my $testnum = 1;
  13. # test 2: Extract information from GPS.jpg with specified coordinate format
  14. {
  15. ++$testnum;
  16. my $exifTool = new Image::ExifTool;
  17. $exifTool->Options(CoordFormat => '%d degrees %.2f minutes');
  18. my $info = $exifTool->ImageInfo('t/images/GPS.jpg');
  19. print 'not ' unless check($exifTool, $info, $testname, $testnum);
  20. print "ok $testnum\n";
  21. }
  22. # test 3: Write some new information
  23. {
  24. ++$testnum;
  25. my @writeInfo = (
  26. ['GPSLatitude' => "12 deg 21' 23.345"],
  27. ['GPSLatitudeRef' => 'south' ],
  28. ['GPSTimeStamp' => '2007:03:02 18:46:10.55-05:30' ],
  29. ['GPSDateStamp' => '2007:03:02 18:46:10.55-05:30' ],
  30. );
  31. print 'not ' unless writeCheck(\@writeInfo, $testname, $testnum);
  32. print "ok $testnum\n";
  33. }
  34. # end