Branch Coverage

blib/lib/PDF/API2/Resource/XObject/Image/PNG.pm
Criterion Covered Total %
branch 46 74 62.1


line true false branch
25 0 5 if ref $class
28 0 5 unless $self->is_obj($pdf)
34 1 4 if (ref $file) { }
38 1 3 unless open $fh, "<", $file
50 4 14 if ($buf eq 'IHDR') { }
2 12 elsif ($buf eq 'PLTE') { }
4 8 elsif ($buf eq 'IDAT') { }
0 8 elsif ($buf eq 'tRNS') { }
4 4 elsif ($buf eq 'IEND') { }
53 0 4 if $cm
54 0 4 if $im
55 0 4 if $fm
79 3 1 unless ref $file
87 0 4 if ($bpc == 16)
90 0 2 unless ($bpc == 1 or $bpc == 2 or $bpc == 4 or $bpc == 8)
95 0 4 if ($cs == 0) { }
0 4 elsif ($cs == 2) { }
2 2 elsif ($cs == 3) { }
0 2 elsif ($cs == 4) { }
2 0 elsif ($cs == 6) { }
105 0 0 if (defined $trns and not $opts{'-notrans'})
123 0 0 if (defined $trns and not $opts{'-notrans'})
161 0 2 if (defined $trns and not $opts{'-notrans'})
200 0 0 unless ($opts{'-notrans'})
240 2 0 unless ($opts{'-notrans'})
259 0 2 if ($use_xs and $bpc == 8 and not $ENV{'PDFAPI2_PNG_PP'}) { }
291 82304 11936 if ($pa <= $pb and $pa <= $pc) { }
11154 782 elsif ($pb <= $pc) { }
307 1 1 if ($file and not $ENV{'PDFAPI2_PNG_PP'})
309 0 1 unless ($@)
314 0 0 if $libpng
323 0 2 if ($use_xs and $bpc == 8 and not $ENV{'PDFAPI2_PNG_PP'}) { }
349 0 574 if ($filter == 0) { }
18 556 elsif ($filter == 1) { }
494 62 elsif ($filter == 2) { }
0 62 elsif ($filter == 3) { }
62 0 elsif ($filter == 4) { }