Branch Coverage

lib/Image/Info.pm
Criterion Covered Total %
branch 59 78 75.6


line true false branch
34 1 76 if ref $source eq "HASH"
39 0 76 if ref $head eq "HASH"
41 0 76 unless my $format = determine_file_format($head)
57 29 48 unless (defined &$sub)
59 0 29 if (my $fail = $mod_failure{$mod})
63 0 29 if ($@)
67 0 29 unless defined &$sub
78 1 76 if $@
79 4 72 wantarray ? :
85 1 1 if ref $source eq "HASH"
88 0 1 unless my $head = _head($source)
89 0 1 unless my $format = determine_file_format($head)
100 55 25 if (not ref $source) { }
25 0 elsif (ref $source eq 'SCALAR') { }
102 0 55 if ($] < 5.006) { }
105 0 0 unless open $fh, $source
108 2 53 unless open $fh, "<", $source
119 25 0 if (eval { do { require PerlIO::scalar; 'PerlIO::scalar'->VERSION(0.21) } } or not eval { do { require IO::Scalar; 1 } }) { }
121 0 25 unless open my $s, "<", $source
129 0 0 unless seek $source, 0, 0
146 0 77 unless $read
148 0 77 if (ref $source eq 'IO::String') { }
153 0 77 unless seek $source, 0, 0
168 17 61 if /^\xFF\xD8/
169 8 53 if /^\x89PNG\x0d\x0a\x1a\x0a/
170 9 44 if /^GIF8[79]a/
171 1 43 if /^MM\x00\x2a/
172 5 38 if /^II\x2a\x00/
173 4 34 if /^BM/
174 3 31 if /^\000\000\001\000/
175 8 23 if /^P[1-6]/
176 3 20 if m((^/\* XPM \*/)|(static\s+char\s+\*\w+\[\]\s*=\s*{\s*"\d+))
177 5 15 if m[^(?:/\*.*\*/\n)?#define\s]
178 5 10 if /^(<\?xml|[\012\015\t ]*
179 10 0 if /^RIFF.{4}WEBP/s
188 4 13 wantarray ? :
194 1 1 unless $x
219 1606 111 if @$a <= 1
226 124 64 $delete ? :