]> source.dussan.org Git - nextcloud-server.git/commitdiff
Cast float/char to int to avoid invalid scalar argument warning 22288/head
authorMorris Jobke <hey@morrisjobke.de>
Tue, 18 Aug 2020 14:51:59 +0000 (16:51 +0200)
committerMorris Jobke <hey@morrisjobke.de>
Tue, 18 Aug 2020 14:51:59 +0000 (16:51 +0200)
Signed-off-by: Morris Jobke <hey@morrisjobke.de>
build/psalm-baseline.xml
lib/private/legacy/OC_Image.php

index 5a2d3ab43bf160b8647e83f0c7cf333add80439a..2e040c3e5ea2bb961a6e25d131b787bc6a62a3aa 100644 (file)
     <InvalidReturnType occurrences="1">
       <code>bool</code>
     </InvalidReturnType>
-    <InvalidScalarArgument occurrences="19">
-      <code>$bits</code>
-      <code>$lastIndex</code>
+    <InvalidScalarArgument occurrences="17">
       <code>$this-&gt;bitDepth</code>
       <code>90</code>
       <code>$imagePath</code>
index 4fdbfb3909f332872088fcfcdfaefa2997361e14..1e2791f62c917e17fab4ef2b3953861cf686d57d 100644 (file)
@@ -1175,7 +1175,7 @@ if (!function_exists('imagebmp')) {
                } elseif ($bit == 32) {
                        $bit = 24;
                }
-               $bits = pow(2, $bit);
+               $bits = (int)pow(2, $bit);
                imagetruecolortopalette($im, true, $bits);
                $width = imagesx($im);
                $height = imagesy($im);
@@ -1211,7 +1211,7 @@ if (!function_exists('imagebmp')) {
                        } // RLE8
                        elseif ($compression == 1 && $bit == 8) {
                                for ($j = $height - 1; $j >= 0; $j--) {
-                                       $lastIndex = "\0";
+                                       $lastIndex = 0;
                                        $sameNum = 0;
                                        for ($i = 0; $i <= $width; $i++) {
                                                $index = imagecolorat($im, $i, $j);