Jpeg2000.t 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. # Before "make install", this script should be runnable with "make test".
  2. # After "make install" it should work as "perl t/Jpeg2000.t".
  3. BEGIN { $| = 1; print "1..4\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::Jpeg2000;
  8. $loaded = 1;
  9. print "ok 1\n";
  10. use t::TestLib;
  11. my $testname = 'Jpeg2000';
  12. my $testnum = 1;
  13. # test 2: Extract information from Jpeg2000.jp2
  14. {
  15. ++$testnum;
  16. my $exifTool = new Image::ExifTool;
  17. my $info = $exifTool->ImageInfo('t/images/Jpeg2000.jp2');
  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. ['IPTC:Keywords' => 'test keyword'],
  26. ['XMP:City' => 'a city'],
  27. ['EXIF:ImageDescription' => 'a description'],
  28. ['XML' => '<test>Yippee</test>', Protected => 1 ],
  29. );
  30. print 'not ' unless writeCheck(\@writeInfo, $testname, $testnum, 't/images/Jpeg2000.jp2');
  31. print "ok $testnum\n";
  32. }
  33. # test 4: Extract information from Jpeg2000.j2c
  34. {
  35. ++$testnum;
  36. my $exifTool = new Image::ExifTool;
  37. my $info = $exifTool->ImageInfo('t/images/Jpeg2000.j2c');
  38. print 'not ' unless check($exifTool, $info, $testname, $testnum);
  39. print "ok $testnum\n";
  40. }
  41. # end