From: Simon Tatham Date: Sun, 24 Apr 2016 06:29:25 +0000 (+0100) Subject: Improve 'illegal colour' error message in icon.pl. X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~ian/git?a=commitdiff_plain;h=02ce237f911f7b970ea9b093226a9e7d09fffbf4;p=sgt-puzzles.git Improve 'illegal colour' error message in icon.pl. 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. --- diff --git a/icons/icon.pl b/icons/icon.pl index b9cce7e..d0c5a8e 100755 --- a/icons/icon.pl +++ b/icons/icon.pl @@ -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}; }