chiark / gitweb /
Improve 'illegal colour' error message in icon.pl.
authorSimon Tatham <anakin@pobox.com>
Sun, 24 Apr 2016 06:29:25 +0000 (07:29 +0100)
committerSimon Tatham <anakin@pobox.com>
Sun, 24 Apr 2016 06:29:25 +0000 (07:29 +0100)
It actually went off this morning, after an upgrade of ImageMagick,
and I found that it contained both unprintable characters in the
colour description and the wrong variable in the coordinate display.

icons/icon.pl

index b9cce7e33e067f9acf6a84146ea54374c1969610..d0c5a8e03e8ffa731dafb1f9f0a2731b4c72b487 100755 (executable)
@@ -203,7 +203,8 @@ sub readicon {
                $currbits += $depth;
                if ($x < $w && defined ($pix = $data->[$y*$w+$x])) {
                    if (!defined $pal{$pix}) {
-                       die "illegal colour value $pix at pixel $i in $filename\n";
+                        my $pixprintable = unpack "H*", $pix;
+                       die "illegal colour value $pixprintable at pixel ($x,$y) in $filename\n";
                    }
                    $currbyte |= $pal{$pix};
                }