From 8a41db4649a8f0cd22fd93acf48a17e0503cfb79 Mon Sep 17 00:00:00 2001 From: Clemens Schwaighofer Date: Fri, 9 Jun 2023 12:16:49 +0900 Subject: [PATCH] Output\Image cleanup for phpstan --- www/lib/CoreLibs/Output/Image.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/www/lib/CoreLibs/Output/Image.php b/www/lib/CoreLibs/Output/Image.php index 664f3a96..8f5a02ad 100644 --- a/www/lib/CoreLibs/Output/Image.php +++ b/www/lib/CoreLibs/Output/Image.php @@ -69,7 +69,7 @@ class Image } // does this picture exist and is it a picture if (file_exists($filename) && is_file($filename)) { - [$width, $height, $type] = getimagesize($filename) ?: []; + [$width, $height, $type] = getimagesize($filename) ?: [0, 0, null]; $convert_prefix = ''; $create_file = false; $delete_filename = ''; @@ -98,7 +98,7 @@ class Image if (!is_file($filename)) { $filename .= '-0'; } - [$width, $height, $type] = getimagesize($filename) ?: []; + [$width, $height, $type] = getimagesize($filename) ?: [0, 0, null]; } // if no size given, set size to original if (!$size_x || $size_x < 1) { @@ -117,7 +117,7 @@ class Image $status = exec($convert_string, $output, $return); // get the size of the converted data, if converted if (is_file($thumbnail)) { - [$width, $height, $type] = getimagesize($thumbnail) ?: []; + [$width, $height, $type] = getimagesize($thumbnail) ?: [0, 0, null]; } } if ($height > $size_y) { @@ -217,7 +217,7 @@ class Image return $thumbnail; } // $this->debug('IMAGE PREPARE', "FILENAME OK, THUMB WIDTH/HEIGHT OK"); - [$inc_width, $inc_height, $img_type] = getimagesize($filename) ?: []; + [$inc_width, $inc_height, $img_type] = getimagesize($filename) ?: [0, 0, null]; $thumbnail_write_path = null; $thumbnail_web_path = null; // path set first @@ -447,7 +447,7 @@ class Image if (!function_exists('exif_read_data') || !is_writeable($filename)) { return; } - [$inc_width, $inc_height, $img_type] = getimagesize($filename) ?: []; + [$inc_width, $inc_height, $img_type] = getimagesize($filename) ?: [0, 0, null]; // add @ to avoid "file not supported error" $exif = @exif_read_data($filename); $orientation = null;