Branch Coverage

blib/lib/Image/Pngslimmer.pm
Criterion Covered Total %
branch 176 300 58.6


line true false branch
40 196 0 if ($generatedcrc eq $readcrc)
54 1 27 if ($startpng ne $pngsig)
59 0 27 if (substr($blob, 12, 4) ne 'IHDR')
62 0 27 if (checkcrc(substr($blob, 8)) < 1)
75 0 74 if (checkcrc(substr($blob, $searchindex - 4)) < 1)
78 27 47 if (substr($blob, $searchindex, 4) eq 'IDAT')
83 0 47 if ($nextindex == 0) { }
91 0 27 if ($idatfound == 0)
97 0 27 if (checkcrc(substr($blob, $pnglength - 12)) < 1)
98 0 27 if (substr($blob, $pnglength - 8, 4) ne 'IEND')
108 0 6 unless (defined $level)
111 0 6 if ($strategy eq 'Z_FILTERED') { }
128 0 6 unless ($status == Z_OK())
132 0 6 unless ($status == Z_OK())
137 0 6 unless ($status == Z_OK())
152 8 16 if (substr($blobin, $searchindex + 4, 4) eq 'IDAT')
158 0 8 if ($numberofidats == 0)
165 8 0 if ($chunknumber == 0) { }
166 8 0 if ($numberofidats == 1) { }
175 0 0 if ($numberofidats - 1 == $chunknumber) { }
191 0 8 unless $x = 'Compress::Raw::Zlib::Inflate'->new(-'WindowBits', -MAX_WBITS(), -'ADLER32', 1, -'AppendOutput', 1)
199 0 8 unless (defined $outputlump)
203 0 8 if ($calc_crc != $uncompcrc)
214 0 2 unless (defined $output)
223 0 2 unless (length $crusheddata < $rawlength)
247 0 2 if (ispng($blobin) < 1)
262 2 6 if (substr($blobin, $searchindex, 4) eq 'IDAT')
263 2 0 if ($idatfound == 0) { }
289 0 1 if ($colourtype != 2 or $depth != 8)
297 0 32 if ($filtertype != 0)
322 18 0 if ($ctype == 2) { }
0 0 elsif ($ctype == 0) { }
0 0 elsif ($ctype == 4) { }
0 0 elsif ($ctype == 6) { }
323 18 0 if ($bdepth == 8) { }
331 0 0 if ($bdepth == 16) { }
0 0 elsif ($bdepth == 8) { }
0 0 elsif ($bdepth == 4) { }
0 0 elsif ($bdepth == 2) { }
0 0 elsif ($bdepth == 1) { }
355 0 0 if ($bdepth == 8) { }
364 0 0 if ($bdepth == 8) { }
404 96 2976 if ($count_width < $comp_width) { }
453 96 2976 if ($count == 0) { }
503 2976 96 if ($count > 0) { }
515 2976 96 if ($count_width >= $comp_width) { }
565 2976 96 if ($count > 0) { }
577 2976 96 if ($count_width >= $comp_width) { }
591 2883 189 if ($count_width >= $comp_width and $count > 0) { }
609 1849 1223 if ($paeth_pa <= $paeth_pb and $paeth_pa <= $paeth_pc) { }
361 862 elsif ($paeth_pb <= $paeth_pc) { }
700 22 10 if ($count_paeth <= $count_zero and $count_paeth <= $count_sub and $count_paeth <= $count_up and $count_paeth <= $count_ave) { }
1 9 elsif ($count_ave <= $count_zero and $count_ave <= $count_sub and $count_ave <= $count_up) { }
5 4 elsif ($count_up <= $count_zero and $count_up <= $count_sub) { }
4 0 elsif ($count_sub <= $count_zero) { }
779 0 1 if (ispng($blobin) < 1)
785 0 1 if ($$ihdr{'colourtype'} == 3)
790 0 1 if ($$ihdr{'bitdepth'} < 8)
795 0 1 if ($$ihdr{'compression'} != 0)
800 0 1 if ($$ihdr{'filter'} != 0)
805 0 1 if ($$ihdr{'interlace'} != 0)
811 0 1 unless (defined $datachunk)
815 1 0 if ($canfilter > 0) { }
841 1 1 if (substr($blobin, $searchindex, 4) eq 'IDAT')
842 1 0 if ($foundidat == 0) { }
871 0 2 if (ispng($blob) < 1)
897 4 8 if ((ord $chunktext & 32) == 0)
915 5 0 unless $$ihdr{'colourtype'} == 3
928 465 15 if ($pointis > $comp_width) { }
952 5568 0 if ($lines_done > 0) { }
981 0 0 if ($lines_done > 0) { }
992 0 0 if ($pointis > $compwidth) { }
1019 9312 0 if ($lines_done > 0) { }
1026 9021 291 if ($pointis > $compwidth) { }
1045 9021 291 if ($pointis > $compwidth) { }
1056 6227 3085 if ($paeth_a <= $paeth_b and $paeth_a <= $paeth_c) { }
3085 0 elsif ($paeth_b <= $paeth_c) { }
1089 0 160 if ($filtertype == 0) { }
97 63 elsif ($filtertype == 4) { }
5 58 elsif ($filtertype == 1) { }
58 0 elsif ($filtertype == 2) { }
1132 0 5 if ($alpha)
1135 0 0 if ($cdepth == 4) { }
0 0 elsif ($cdepth == 8) { }
0 0 elsif ($cdepth == 2) { }
1137 0 0 if ($bdepth == 8) { }
1164 2022 3098 if (defined $colourlist{$colour}) { }
1183 0 2 unless (ispng($blobin) > 0)
1189 0 2 unless (ispalettized($blobin) < 1)
1215 0 1 unless ispng($blobin) > 0
1218 0 1 unless ispalettized($blobin) < 1
1222 1 0 unless $colour_limit
1227 0 1 if ($colours < 1)
1230 1 0 if ($colours < 256) { }
1263 1 3 if (substr($blobin, $searchindex, 4) eq 'IDAT')
1264 1 0 if ($foundidat == 0) { }
1299 0 1 if ($alpha)
1302 0 0 if ($cdepth == 4) { }
0 0 elsif ($cdepth == 8) { }
0 0 elsif ($cdepth == 2) { }
1304 0 0 if ($bdepth == 8) { }
1394 0 512 if ($numb == 0)
1412 6 1016 unless defined $$boundingbox[5]
1420 650 1382 if ($lengths[$i] > $lengths[$longestaxis])
1435 508 0 if ($n > 1)
1440 543 64227 if ($length > $biggest)
1454 182 328 if ($longestaxis == 2)
1472 6 1016 if (scalar @_ == 1)
1528 7362 235645 if ($newdistance < $distance)
1533 88 7274 if ($distance <= 12)
1545 2 0 if (not defined $colourspaces or $colourspaces == 0)
1564 508 2 unless $colcount == 0
1607 994 30 unless ($palnumber)
1617 0 1024 if ($cdepth >= 6) { }
1627 608 2464 if ($colerror[$ll] == 0)
1631 1189 1275 if ($colerror[$ll] < 1)
1635 2375 89 if ($pixelpoint + 1 < $width)
1645 31 2344 if ($unpacked > $max_value) { }
27 2317 elsif ($unpacked < 0) { }
1654 2285 90 if ($linesdone + 1 < $totallines)
1665 0 2285 if ($unpacked > $max_value) { }
0 2285 elsif ($unpacked < 0) { }
1676 2371 93 if ($linesdone + 1 < $totallines)
1685 31 2340 if ($unpacked > $max_value) { }
13 2327 elsif ($unpacked < 0) { }
1694 2308 63 if ($pixelpoint > 0)
1703 0 2308 if ($unpacked > $max_value) { }
1 2307 elsif ($unpacked < 0) { }
1733 0 2 unless ispng($blobin) > 0
1736 0 2 unless ispalettized($blobin) < 1
1740 2 0 unless $colour_limit
1742 1 1 unless $dither
1747 0 2 if ($colours < 1)
1750 0 0 if ($colours < 256 and $colours < $colour_limit || $colour_limit == 0)
1758 0 2 if ($colour_limit > 256)
1770 0 2 if ($alpha)
1773 0 0 if ($cdepth == 4) { }
0 0 elsif ($cdepth == 8) { }
0 0 elsif ($cdepth == 2) { }
1775 0 0 if ($bdepth == 8) { }
1815 2 2 if (substr($blobin, $searchindex, 4) eq 'IDAT')
1816 2 0 if ($foundidat == 0) { }
1852 1024 1024 if ($dither == 1)
1864 994 30 unless ($colourlookup{$colour})
1907 0 15 if (ispng($blob) < 1)
1935 48 20 if ((ord $chunk_text & 32) == 0)
1941 68 0 if ((ord substr($blob, $searchindex + 1, 1) & 32) == 0)
1949 68 0 if ($chunk_crc_checked == 1) { }
1955 48 20 if ($crit_status > 0) { }
1963 68 0 if ($pub_status > 0) { }