]> source.dussan.org Git - nextcloud-server.git/commitdiff
Change 0 to null to properly encode image to BMP if the first pixel is black 22768/head
authorMorris Jobke <hey@morrisjobke.de>
Thu, 10 Sep 2020 10:07:56 +0000 (12:07 +0200)
committerMorris Jobke <hey@morrisjobke.de>
Thu, 10 Sep 2020 10:08:01 +0000 (12:08 +0200)
Ref #22288

Signed-off-by: Morris Jobke <hey@morrisjobke.de>
lib/private/legacy/OC_Image.php

index 1e2791f62c917e17fab4ef2b3953861cf686d57d..3e9812c99f2e69fda3290e8e6687765721e2d02f 100644 (file)
@@ -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);