chiark / gitweb /
Forbid undo of new-game if it would change the params.
[sgt-puzzles.git] / icons / icon.pl
index b9cce7e33e067f9acf6a84146ea54374c1969610..fcb1aa3e2cb754c413aaef9e626526e442ab2b3f 100755 (executable)
@@ -127,7 +127,7 @@ sub readicon {
     # point, to avoid having to do it ourselves (.BMP and hence
     # .ICO are bottom-up).
     my $data = [];
-    open IDATA, "convert -flip -depth 8 $filename rgba:- |";
+    open IDATA, "convert -set colorspace sRGB -flip -depth 8 $filename rgba:- |";
     push @$data, $rgb while (read IDATA,$rgb,4,0) == 4;
     close IDATA;
     # Check we have the right amount of data.
@@ -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};
                }