From: Morris Jobke Date: Thu, 10 Sep 2020 10:07:56 +0000 (+0200) Subject: Change 0 to null to properly encode image to BMP if the first pixel is black X-Git-Tag: v20.0.0beta4~7^2 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=refs%2Fpull%2F22768%2Fhead;p=nextcloud-server.git Change 0 to null to properly encode image to BMP if the first pixel is black Ref #22288 Signed-off-by: Morris Jobke --- diff --git a/lib/private/legacy/OC_Image.php b/lib/private/legacy/OC_Image.php index 1e2791f62c9..3e9812c99f2 100644 --- a/lib/private/legacy/OC_Image.php +++ b/lib/private/legacy/OC_Image.php @@ -1211,7 +1211,7 @@ if (!function_exists('imagebmp')) { } // RLE8 elseif ($compression == 1 && $bit == 8) { for ($j = $height - 1; $j >= 0; $j--) { - $lastIndex = 0; + $lastIndex = null; $sameNum = 0; for ($i = 0; $i <= $width; $i++) { $index = imagecolorat($im, $i, $j);