GE.t 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. # Before "make install", this script should be runnable with "make test".
  2. # After "make install" it should work as "perl t/GE.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::GE;
  8. $loaded = 1;
  9. print "ok 1\n";
  10. use t::TestLib;
  11. my $testname = 'GE';
  12. my $testnum = 1;
  13. # test 2: Extract information from GE.jpg
  14. {
  15. ++$testnum;
  16. my $exifTool = new Image::ExifTool;
  17. $exifTool->Options(Unknown => 1);
  18. my $info = $exifTool->ImageInfo('t/images/GE.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 $exifTool = new Image::ExifTool;
  26. $exifTool->SetNewValue(GEModel => 'test model');
  27. my $testfile = "t/${testname}_${testnum}_failed.jpg";
  28. unlink $testfile;
  29. $exifTool->WriteInfo('t/images/GE.jpg', $testfile);
  30. my $info = $exifTool->ImageInfo($testfile,{Duplicates=>1,Unknown=>1});
  31. if (check($exifTool, $info, $testname, $testnum)) {
  32. unlink $testfile;
  33. } else {
  34. print 'not ';
  35. }
  36. print "ok $testnum\n";
  37. }
  38. # end