use strict;
use lib 't';
use Imager qw(:all);
-use Test::More tests => 51;
+use Test::More tests => 54;
init_log("testout/t101jpeg.log",1);
$im = Imager->new(xsize=>2, ysize=>2);
ok(!$im->write(file=>"testout/nojpeg.jpg"), "should fail to write jpeg");
cmp_ok($im->errstr, '=~', qr/format not supported/, "check no jpeg message");
- skip("no jpeg support", 47);
+ skip("no jpeg support", 50);
}
} else {
open(FH,">testout/t101.jpg") || die "cannot open testout/t101.jpg for writing\n";
is($im->tags(name=>'exif_user_comment'), '',
"check exif_user_comment set correctly");
}
+
+ { # test parseiptc handling no IPTC data correctly
+ my $saw_warn;
+ local $SIG{__WARN__} =
+ sub {
+ ++$saw_warn;
+ print "# @_\n";
+ };
+ my $im = Imager->new;
+ ok($im->read(file => 'testout/t101.jpg', type=>'jpeg'),
+ "read jpeg with no IPTC data");
+ ok(!defined $im->{IPTCRAW}, "no iptc data");
+ my %iptc = $im->parseiptc;
+ ok(!$saw_warn, "should be no warnings");
+ }
}