File: exif.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 (34 lines) | stat: -rw-r--r-- 833 bytes parent folder | download | duplicates (5)
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
#!/usr/bin/perl -w

use Test::More;
use strict;

# Some basic tests for Exif extraction. Highly incomplete.

BEGIN
   {
   plan tests => 7;
   chdir 't' if -d 't';
   use lib '../lib';
   use_ok ("Image::Info") or die($@);
   };

use Image::Info qw(image_info dim);

my $i = image_info("../img/test.jpg") || die;

#use Data::Dumper; print Dumper($i), "\n";

is ($i->{DateTimeDigitized}, "1999:12:06 16:38:40", 'DateTimeDigitized');

is ($i->{Make}, "OLYMPUS OPTICAL CO.,LTD", 'Make');

# test parsing of MakerNote (especially that there are no trailing \x00):

# this is a "UNDEFINED" value with trailing zeros \x00:
is ($i->{'Olympus-CameraID'}, 'OLYMPUS DIGITAL CAMERA', 'Olympus-CameraID');

isnt ($i->{UserComment}, "ASCII", 'UserComment');
like ($i->{UserComment}, qr/^\s+\z/, 'UserComment');

is (dim($i), '320x240', 'dim()');