Branch Coverage

blib/lib/Image/MetaData/JPEG.pm
Criterion Covered Total %
branch 93 106 87.7


line true false branch
25 4 1 if $Image::MetaData::JPEG::show_warnings
78 6 63 if $options
87 69 0 unless $status
89 7 62 $this->Error ? :
125 1 25 if $$this{'read_only'}
127 0 25 unless defined $filename
134 0 25 unless open my $out, '>', $filename
142 0 25 scalar grep({not $_;} @results) ? :
156 1 68 unless defined $file_input
159 26 42 if (ref $file_input eq 'SCALAR') { }
166 1 41 unless open $$this{'handle'}, '<', $file_input
180 1 68 unless ref $$this{'handle'}
182 26 42 if ref $$this{'handle'} eq 'SCALAR'
204 498 278 $is_file ? :
776 3198 if $offset eq 'LENGTH'
208 116 3082 if $length <= 0
212 1985 1097 if ($is_file) { }
213 0 1985 unless seek $handle, $offset, 0
216 0 1985 if not defined $read or $read < $length
270 1 66 unless $isize
276 0 654 unless exists $JPEG_MARKER_BY_CODE{$marker}
283 252 402 $regex && !($name =~ /$regex/) ? :
285 121 533 if $name =~ /^RST|EOI|SOI/
286 0 533 unless $isize > $offset + 2
295 0 533 if $length < 2
296 1 653 unless $isize >= $offset + $length
302 479 115 $length ? :
594 59 unless $$this{'read_only'} and $flag
310 58 595 if ($name =~ /SOS|^RST/)
311 6 52 if $$this{'read_only'}
319 37 610 if ($name eq 'EOI' and $offset < $isize)
321 37 0 unless $$this{'read_only'}
364 654 35 $offset < $length && ${$this->get_data($offset, 1);} eq $punctuation ? :
365 2 655 unless $length - $offset > 1
369 1 654 if $marker_byte ne $punctuation
372 1 653 if $garbage
431 52 0 pos $$buffer ? :
457 258 414 unless defined $regex and length $regex > 0
463 140 532 defined $do_indexes && $do_indexes eq 'INDEXES' ? :
482 4 26 unless defined $regex and length $regex > 0
485 1 25 if $regex eq 'METADATA'
508 1 55 unless ref $segref
511 27 28 unless ref $segref eq 'ARRAY'
517 18 0 exists $$segref[0] ? :
18 37 unless defined $pos
521 1 54 if $pos < 0 or $pos > $max_pos
524 1 53 if $pos == 0 and $$this{'segments'}[0]{'name'} eq 'SOI'
529 39 14 unless defined $overwrite
557 2 30 unless $name
560 0 32 unless $name =~ /^(COM|APP([0-9]|1[0-5]))$/
566 2 30 $last_segment < $_[0] ? :
572 12 20 if ($name =~ /^COM/)
578 20 2 if ($name =~ /^APP(.*)$/)