Sigma.t 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. # Before "make install", this script should be runnable with "make test".
  2. # After "make install" it should work as "perl t/Sigma.t".
  3. BEGIN { $| = 1; print "1..5\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::Sigma;
  8. $loaded = 1;
  9. print "ok 1\n";
  10. use t::TestLib;
  11. my $testname = 'Sigma';
  12. my $testnum = 1;
  13. # test 2: Extract information from Sigma.jpg
  14. {
  15. ++$testnum;
  16. my $exifTool = new Image::ExifTool;
  17. my $info = $exifTool->ImageInfo('t/images/Sigma.jpg');
  18. print 'not ' unless check($exifTool, $info, $testname, $testnum);
  19. print "ok $testnum\n";
  20. }
  21. # test 3: Write some new information
  22. {
  23. ++$testnum;
  24. my @writeInfo = (
  25. ['IPTCPixelWidth' => 200],
  26. ['Sharpness' => 2, 'Group' => 'MakerNotes'],
  27. );
  28. print 'not ' unless writeCheck(\@writeInfo, $testname, $testnum);
  29. print "ok $testnum\n";
  30. }
  31. # test 4: Test reading X3F image
  32. {
  33. ++$testnum;
  34. my $exifTool = new Image::ExifTool;
  35. my $info = $exifTool->ImageInfo('t/images/Sigma.x3f');
  36. print 'not ' unless check($exifTool, $info, $testname, $testnum);
  37. print "ok $testnum\n";
  38. }
  39. # test 5: Test writing X3F image
  40. {
  41. ++$testnum;
  42. my @writeInfo = (
  43. ['Artist' => 'Phil Harvey'],
  44. ['XMP:Title' => 'A title'],
  45. ['Keywords' => ['one','two']],
  46. );
  47. print 'not ' unless writeCheck(\@writeInfo, $testname, $testnum, 't/images/SigmaDP2.x3f');
  48. print "ok $testnum\n";
  49. }
  50. # end