From d7c0237cfc3a4fb757e8c0f2d57f49d1ea125cb8 Mon Sep 17 00:00:00 2001 From: deni2s Date: Tue, 17 Jan 2023 22:57:57 +0200 Subject: [PATCH] Fixes warnings at least for PHP 8.2 Fixes warnings at least for PHP 8.2 if w or h param is not specified. --- phpthumb.class.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/phpthumb.class.php b/phpthumb.class.php index 494cd14..d3624e7 100644 --- a/phpthumb.class.php +++ b/phpthumb.class.php @@ -1986,8 +1986,8 @@ public function ImageMagickThumbnailToGD() { } } list($nw, $nh) = phpthumb_functions::TranslateWHbyAngle($this->w, $this->h, $this->ra); - $nw = ((round($nw) != 0) ? round($nw) : ''); - $nh = ((round($nh) != 0) ? round($nh) : ''); + $nw = ((isset($nw) && round($nw) != 0) ? round($nw) : ''); + $nh = ((isset($nh) && round($nh) != 0) ? round($nh) : ''); $commandline .= ' -'.$IMresizeParameter.' '.phpthumb_functions::escapeshellarg_replacement($nw.'x'.$nh); }