+
+ { # handling of an alpha channel for various images
+ my $photo_rgb = 2;
+ my $photo_cmyk = 5;
+ my $photo_cielab = 8;
+ my @alpha_images =
+ (
+ [ 'srgb.tif', 3, $photo_rgb ],
+ [ 'srgba.tif', 4, $photo_rgb ],
+ [ 'srgbaa.tif', 4, $photo_rgb ],
+ [ 'scmyk.tif', 3, $photo_cmyk ],
+ [ 'scmyka.tif', 4, $photo_cmyk ],
+ [ 'scmykaa.tif', 4, $photo_cmyk ],
+ [ 'slab.tif', 3, $photo_cielab ],
+ );
+ for my $test (@alpha_images) {
+ my $im = Imager->new;
+ ok($im->read(file => "testimg/$test->[0]"),
+ "read alpha test $test->[0]");
+ is($im->getchannels, $test->[1], "channels for $test->[0] match");
+ is($im->tags(name=>'tiff_photometric'), $test->[2],
+ "photometric for $test->[0] match");
+ }
+ }