From 618cf6d484efcaea3a4c3eb2ccbae7a4a7141d38 Mon Sep 17 00:00:00 2001 From: Greg Peatfield Date: Mon, 6 Jan 2020 15:06:54 -0500 Subject: [PATCH] Update displayImage to allow JPEG/PNG PHP needs "NULL" as the filename to output to screen. Script fails on all but GIF now due to "filename cannot be empty". https://www.phptutorial.info/?imagejpeg --- php_image_magician.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/php_image_magician.php b/php_image_magician.php index a582cbb..8a233ef 100755 --- a/php_image_magician.php +++ b/php_image_magician.php @@ -2513,7 +2513,7 @@ public function displayImage($fileType = 'jpg', $imageQuality="100") case 'jpg': case 'jpeg': header('Content-type: image/jpeg'); - imagejpeg($this->imageResized, '', $imageQuality); + imagejpeg($this->imageResized, NULL, $imageQuality); break; case 'gif': header('Content-type: image/gif'); @@ -2528,7 +2528,7 @@ public function displayImage($fileType = 'jpg', $imageQuality="100") // *** Invert qualit setting as 0 is best, not 9 $invertScaleQuality = 9 - $scaleQuality; - imagepng($this->imageResized, '', $invertScaleQuality); + imagepng($this->imageResized, NULL, $invertScaleQuality); break; case 'bmp': echo 'bmp file format is not supported.';