Branch Coverage

lib/Image/Info.pm
Criterion Covered Total %
branch 61 80 76.2


line true false branch
33 1 84 if ref $source eq "HASH"
38 0 84 if ref $head eq "HASH"
40 0 84 unless my $format = determine_file_format($head)
56 34 51 unless (defined &$sub)
58 0 34 if (my $fail = $mod_failure{$mod})
62 0 34 if ($@)
66 0 34 unless defined &$sub
77 1 84 if $@
78 6 78 wantarray ? :
84 1 1 if ref $source eq "HASH"
87 0 1 unless my $head = _head($source)
88 0 1 unless my $format = determine_file_format($head)
99 61 27 if (not ref $source) { }
27 0 elsif (ref $source eq 'SCALAR') { }
101 0 61 if ($] < 5.006) { }
104 0 0 unless open $fh, $source
107 2 59 unless open $fh, "<", $source
118 27 0 if (eval {
120 0 27 unless open my $s, "<", $source
128 0 0 unless seek $source, 0, 0
145 0 85 unless $read
147 0 85 if (ref $source eq 'IO::String') { }
152 0 85 unless seek $source, 0, 0
167 21 65 if /^\xFF\xD8/
168 8 57 if /^\x89PNG\x0d\x0a\x1a\x0a/
169 9 48 if /^GIF8[79]a/
170 1 47 if /^MM\x00\x2a/
171 5 42 if /^II\x2a\x00/
172 4 38 if /^BM/
173 3 35 if /^\000\000\001\000/
174 9 26 if /^P[1-6]/
175 3 23 if m((^/\* XPM \*/)|(static\s+char\s+\*\w+\[\]\s*=\s*{\s*"\d+))
176 5 18 if m[^(?:/\*.*\*/\n)?#define\s]
177 3 15 if /\A....ftypavif/s
178 5 10 if /^(<\?xml|[\012\015\t ]*<svg\b)/
179 10 0 if /^RIFF.{4}WEBP/s
188 4 13 wantarray ? :
194 1 1 unless $x
219 1748 127 if @$a <= 1
226 145 72 $delete ? :