X-Git-Url: https://git.distorted.org.uk/~mdw/sgt/puzzles/blobdiff_plain/afc306fc5098945e25027fd6bce572d44a8a139f..fbd2dc512d5a3b913aa36c559e213debca115537:/icons/square.pl diff --git a/icons/square.pl b/icons/square.pl index 295b2f1..81be9d7 100755 --- a/icons/square.pl +++ b/icons/square.pl @@ -17,13 +17,13 @@ $ident =~ /(\d+) (\d+)/ or die "unable to get size for $infile\n"; # Read the input image data. $data = []; -open IDATA, "convert $infile rgb:- |"; +open IDATA, "convert -depth 8 $infile rgb:- |"; push @$data, $rgb while (read IDATA,$rgb,3,0) == 3; close IDATA; # Check we have the right amount of data. $xl = $w * $h; $al = scalar @$data; -die "wrong amount of image data ($al, expected $xl) from $img\n" +die "wrong amount of image data ($al, expected $xl) from $infile\n" unless $al == $xl; # Find the background colour. We assume the image already has a