14 use Image
::Info
qw(image_info dim);
16 ## This TIFF file has 3 images, in 24-bit colour, 1-bit mono and 8-bit grey.
17 my @i = image_info
("../img/test.tif");
18 ok
( @i, 'image_info ran ok');
19 is
( @i, 3, 'Right number of images found' );
22 is
( scalar @
{$i[0]->{BitsPerSample
}}, 3 , 'Three lots of BitsPerSample for full-colour image' );
23 is
( $i[0]->{SamplesPerPixel
}, 3, 'SamplesPerPixel is 3 for full-colour image' );
24 is
( $i[0]->{width
}, 60, 'width is right for full-colour image');
25 is
( $i[0]->{height
}, 50, 'height is right for full-colour image');
28 is
( $i[1]->{BitsPerSample
}, 1, 'BitsPerSample right for 1-bit image' );
29 is
( $i[1]->{SamplesPerPixel
}, 1, 'BitsPerSample right for 1-bit image' );
30 is
( $i[1]->{Compression
}, 'CCITT T6', 'Compression right for 1-bit image' );
33 is
( $i[2]->{BitsPerSample
}, 8, 'Bit depth right for greyscale image' );
34 is
( $i[2]->{SamplesPerPixel
}, 1, 'Bit depth right for greyscale image' );
35 is
( dim
($i[2]), '60x50' , 'dim() function is right for greyscale image' );