File Coverage

blib/lib/File/Headerinfo/Image.pm
Criterion Covered Total %
statement 15 15 100.0
branch 1 2 50.0
condition n/a
subroutine 4 4 100.0
pod 1 1 100.0
total 21 22 95.4


line stmt bran cond sub pod time code
1             package File::Headerinfo::Image;
2              
3 1     1   6 use strict;
  1         41  
  1         51  
4 1     1   7 use base qw(File::Headerinfo);
  1         2  
  1         224  
5 1     1   1140 use Image::Size;
  1         5912  
  1         153  
6              
7             =head1 NAME
8              
9             File::Headerinfo::Image - an extractor of useful information from image files.
10              
11             =head1 DESCRIPTION
12              
13             I is a thin (going on invisible) wrapper around Image::Size, which is able to retrieve dimensions from most types of image file.
14              
15             =cut
16              
17             sub parse_file {
18 2     2 1 3 my $self = shift;
19 2         11 my ($w, $h, $type) = Image::Size::imgsize( $self->path );
20 2 50       16833 return unless $w;
21 2         74 $self->filetype(lc($type));
22 2         19 $self->width($w);
23 2         17 $self->height($h);
24             }
25              
26             =head1 COPYRIGHT
27              
28             Copyright 2004 William Ross (wross@cpan.org)
29              
30             This library is free software; you can redistribute it
31             and/or modify it under the same terms as Perl itself.
32              
33             =head1 SEE ALSO
34              
35             L, L, L, L
36              
37             =cut
38              
39             1;