color_cmp
is_image
is_imaged
- is_image_similar
+ is_image_similar
+ isnt_image
image_bounds_checks
mask_tests
test_colorf_gpix
return $builder->ok(1, $comment);
}
+sub isnt_image {
+ my ($left, $right, $comment) = @_;
+
+ my $builder = Test::Builder->new;
+
+ my $diff = Imager::i_img_diff($left->{IMG}, $right->{IMG});
+
+ return $builder->ok($diff, "$comment");
+}
+
sub image_bounds_checks {
my $im = shift;
#!perl -w
use strict;
-use Test::More tests => 69;
+use Test::More tests => 77;
use Imager;
-use Imager::Test qw(is_color3 is_image is_imaged test_image_double);
+use Imager::Test qw(is_color3 is_image is_imaged test_image_double test_image isnt_image);
#$Imager::DEBUG=1;
is_imaged($imsrc, $imcp, "flip h,v,hv twice");
}
+{
+ my $impal = test_image()->to_paletted;
+ my $imcp = $impal->copy;
+ is($impal->type, "paletted", "check paletted test image is");
+ is($imcp->type, "paletted", "check copy test image is paletted");
+ ok($impal->flip(dir => "h"), "flip paletted h");
+ isnt_image($impal, $imcp, "check it changed");
+ ok($impal->flip(dir => "v"), "flip paletted v");
+ ok($impal->flip(dir => "hv"), "flip paletted hv");
+ is_image($impal, $imcp, "should be back to original image");
+ is($impal->type, "paletted", "and still paletted");
+}
+
rot_test($img, 90, 4);
rot_test($img, 180, 2);
rot_test($img, 270, 4);