From 03ac5eb042295f744b4a44c544601b9df47d454e Mon Sep 17 00:00:00 2001 From: dmester Date: Sat, 2 Nov 2019 12:38:56 +0100 Subject: [PATCH] Bug fix: getImageData using the internal PNG encoder generated "Undefined offset" warnings and produced artifacts when the icon contained more than 256 colors (#4). --- src/Canvas/Png/PngPalette.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Canvas/Png/PngPalette.php b/src/Canvas/Png/PngPalette.php index ab1aed8..37887b6 100644 --- a/src/Canvas/Png/PngPalette.php +++ b/src/Canvas/Png/PngPalette.php @@ -46,7 +46,7 @@ function __construct(& $colorRanges) $lookup[$value] = $colorsCount++; $colors[] = $value; - if ($colorsCount == 256) { + if ($colorsCount > 256) { break; } }