Branch Coverage

blib/lib/PDF/API2/Resource/XObject/Image/PNM.pm
Criterion Covered Total %
branch 26 88 29.5


line true false branch
23 0 3 if ref $class
26 0 3 unless $self->is_obj($pdf)
30 1 1 if ($opts{'-compress'}) { }
51 0 2 if (not defined $rc or $rc != 3)
56 0 2 unless ($in =~ /^P([123456])\s/)
62 2 0 if ($info{'type'} > 3) { }
69 0 2 if ($info{'type'} == 1 or $info{'type'} == 4) { }
0 2 elsif ($info{'type'} == 2 or $info{'type'} == 5) { }
82 0 16 if (not defined $rc or $rc != 1)
94 0 16 if ($info{'bgp'} eq 'b') { }
95 0 0 if ($no_comments =~ /^P\d\s+(\d+)\s+(\d+)\s/)
102 2 14 if ($no_comments =~ /^P\d\s+(\d+)\s+(\d+)\s+(\d+)\s/)
124 1 2 if (ref $file) { }
128 1 1 unless open $fh, "<", $file
134 0 2 if ($info->{'type'} == 1) { }
0 2 elsif ($info->{'type'} == 2) { }
0 2 elsif ($info->{'type'} == 3) { }
0 2 elsif ($info->{'type'} == 4) { }
0 2 elsif ($info->{'type'} == 5) { }
2 0 elsif ($info->{'type'} == 6) { }
148 0 0 if length $plain < $size
151 0 0 if length $plain > $size
175 0 0 if scalar @raster < $size
178 0 0 if scalar @raster > $size
182 0 0 if ($info->{'max'} <= 255) { }
184 0 0 unless $info->{'max'} == 255
188 0 0 unless $info->{'max'} == 65535
193 0 0 if ($bpc == 8) { }
216 0 0 if scalar @raster < $size * 3
219 0 0 if scalar @raster > $size * 3
223 0 0 if ($info->{'max'} <= 255) { }
225 0 0 unless $info->{'max'} == 255
229 0 0 unless $info->{'max'} == 65535
234 0 0 if ($bpc == 8) { }
249 0 0 $info->{'max'} <= 255 ? :
251 0 0 if ($info->{'max'} == 255 or $info->{'max'} == 65535) { }
255 0 0 $bpc == 8 ? :
259 0 0 if ($scale == 1) { }
265 0 0 if ($bpc == 8) { }
276 2 0 $info->{'max'} <= 255 ? :
278 2 0 if ($info->{'max'} == 255 or $info->{'max'} == 65535) { }
282 0 0 $bpc == 8 ? :
286 2 0 if ($scale == 1) { }
292 0 0 if ($bpc == 8) { }