File Coverage

blib/lib/Image/Magick/Info.pm
Criterion Covered Total %
statement 12 23 52.1
branch 0 4 0.0
condition 0 3 0.0
subroutine 4 5 80.0
pod n/a
total 16 35 45.7


line stmt bran cond sub pod time code
1             package Image::Magick::Info;
2              
3 1     1   31550 use strict;
  1         3  
  1         34  
4 1     1   4 use warnings;
  1         2  
  1         22  
5 1     1   6 use Carp;
  1         6  
  1         111  
6              
7             require Image::Magick;
8              
9             require Exporter;
10 1     1   1042 use AutoLoader qw(AUTOLOAD);
  1         1686  
  1         7  
11              
12             our @ISA = qw(Exporter);
13              
14             our @EXPORT_OK = qw( get_info );
15              
16             our $VERSION = '0.03';
17              
18             my $im = new Image::Magick;
19              
20             sub get_info{
21 0     0     my ($filename, @info ) = @_;
22              
23 0 0 0       if( ref $filename eq "GLOB" || ref $filename eq "IO::File" ){
24 0           $im->Read( FILE => $filename );
25             }else{
26 0           $im->Read( $filename );
27             }
28            
29 0           my $ret;
30            
31 0           foreach my $i ( @info ){
32 0           eval {
33 0           $ret->{$i} = $im->get( $i );
34             };
35              
36 0 0         if( $@ ){
37 0           warn $@;
38             }
39             }
40            
41 0           return $ret;
42             }
43              
44              
45             1;
46             __END__