File: tiff_e.t

package info (click to toggle)
libimage-info-perl 1.28-1
  • links: PTS
  • area: main
  • in suites: jessie, jessie-kfreebsd, lenny, squeeze, wheezy
  • size: 568 kB
  • ctags: 193
  • sloc: perl: 4,152; makefile: 46
file content (43 lines) | stat: -rw-r--r-- 915 bytes parent folder | download | duplicates (7)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
#!/usr/bin/perl -w

# Test the same TIFF file in little and big endian

use Test::More;
use strict;

BEGIN
  {
  chdir 't' if -d 't';
  use lib '../blib/';
  use lib '../lib/';
  plan tests => 10;
  }

use Image::Info qw(image_info);

##
## TIFF Little Endian file
##

my @le = image_info("../img/le.tif");
ok ( @le, 'TIFF Little Endian: image_info ran ok');
is ( @le, 1, 'One image found' );

is ( $le[0]->{SamplesPerPixel}, 4, 'SamplesPerPixel is 4' );
is ( $le[0]->{width}, 260, 'Width is right for the image');
is ( $le[0]->{height}, 6, 'Height is right for the image');

##
## TIFF Big Endian file
##

my @be = image_info("../img/be.tif");
ok ( @be, 'TIFF Big Endian: image_info ran ok');
is ( @be, 1, 'One image found' );

is ( $be[0]->{SamplesPerPixel}, 4, 'SamplesPerPixel is 4' );
is ( $be[0]->{width}, 260, 'Width is right for the image');
is ( $be[0]->{height}, 6, 'Height is right for the image');

1;