Image-Info-1.22.tar.gz
[Image-Info.git] / t / svg.t
blobebf38d5fa24b4594c11a8ddf90d60640a80ab9d2
1 #!/usr/bin/perl -w
3 use Test::More;
4 use strict;
6 # test SVG images
8 BEGIN
10 plan tests => 13;
11 chdir 't' if -d 't';
12 use lib '../lib';
13 use_ok ("Image::Info") or die($@);
16 use Image::Info qw(image_info dim);
18 my $i = image_info("../img/test.svg") ||
19 die ("Couldn't read test.svg: $!");
21 #use Data::Dumper; print Dumper($i), "\n";
23 is ($i->{color_type}, 'sRGB', 'color_type');
24 is ($i->{file_media_type}, 'image/svg+xml', 'file_media_type');
26 is ($i->{SVG_StandAlone}, 'yes', 'SVG_StandAlone');
27 is ($i->{file_ext}, 'svg', 'file_ext');
28 is ($i->{SVG_Version}, 'unknown', 'SVG_Version unknown');
30 is (dim($i), '4inx3in', 'dim()');
32 #############################################################################
33 # second test file
34 $i = image_info("../img/graph.svg") ||
35 die ("Couldn't read graph.svg: $!");
37 #use Data::Dumper; print Dumper($i), "\n";
39 is ($i->{SVG_StandAlone}, 'yes', 'SVG_StandAlone');
40 is ($i->{file_ext}, 'svg', 'file_ext');
41 is ($i->{file_media_type}, 'image/svg+xml', 'file_media_type');
42 is ($i->{SVG_Title}, 'Untitled graph', 'title');
43 is ($i->{SVG_Version}, '1.1', 'SVG_Version 1.1');
45 is (dim($i), '209x51', 'dim()');