File Coverage

blib/lib/Image/EXIF.pm
Criterion Covered Total %
statement 15 36 41.6
branch 0 12 0.0
condition n/a
subroutine 5 11 45.4
pod 0 5 0.0
total 20 64 31.2


line stmt bran cond sub pod time code
1             package Image::EXIF;
2              
3 1     1   7496 use 5.008;
  1         4  
  1         51  
4 1     1   7 use strict;
  1         3  
  1         40  
5 1     1   5 use warnings;
  1         2  
  1         65  
6              
7             our $VERSION = '2.01';
8              
9 1     1   5 use Carp ();
  1         2  
  1         18  
10              
11 1     1   4 use XSLoader;
  1         2  
  1         445  
12             XSLoader::load(__PACKAGE__, $VERSION);
13              
14             sub new {
15 0     0 0   my ($class, $file_name) = @_;
16              
17 0           my $self = $class->_new_instance;
18              
19 0 0         $self->file_name("$file_name") if defined $file_name;
20              
21 0           return $self;
22             }
23              
24             # These exist for compatibility with the historical API
25 0     0 0   sub error { 0 }
26 0     0 0   sub errstr { undef }
27              
28             sub file_name {
29 0     0 0   my $self = shift;
30 0 0         if (@_) {
31 0           my $file_name = shift;
32 0 0         Carp::croak("Image::EXIF file name undefined")
33             if !defined $file_name;
34 0           $self->_load_file("$file_name");
35             }
36 0 0         return $self->_file_name if defined wantarray;
37             }
38              
39             sub get_all_info {
40 0     0 0   my ($self) = @_;
41              
42 0           my %hash;
43 0           for my $key (qw) {
44 0           my $method = "get_$key\_info";
45 0 0         my $data = $self->$method or next;
46 0           $hash{$key} = $data;
47             }
48              
49 0 0         return %hash ? \%hash : undef;
50             }
51              
52             sub DESTROY {
53 0     0     my ($self) = @_;
54 0           $self->_destroy_instance;
55             }
56              
57             1;
58             __END__