]> git.imager.perl.org - imager.git/blobdiff - fileformatdocs/pngdump.pl
fixes to the fountain filter
[imager.git] / fileformatdocs / pngdump.pl
index e79d964e4d67e6bb31d9db6419746e37ade5af90..f2dcf249390570cef76ce21edd99d335108140c4 100644 (file)
@@ -56,10 +56,11 @@ while (my ($dlen, $data, $len, $type, $payload, $crc) = read_chunk($fh)) {
 EOS
     $colour_type = $ct;
     $bits = $d;
-    my $channels = $ct == 2 ? 3 : $ct == 4 ? 2 : $ct == 6 ? 4 : 0;
+    my $channels = $ct == 2 ? 3 : $ct == 4 ? 2 : $ct == 6 ? 4 : 1;
     my $bitspp = $channels * $d;
     $sline_len = int((($w * $bitspp) + 7) / 8);
     ++$sline_len; # filter byte
+    print "  Line length: $sline_len\n";
   }
   elsif ($type eq 'sRGB') {
     print "  Rendering intent: ", ord($payload), "\n";