From dfcaca0302a07c9c8f83161c1fe41e9ee9230fcd Mon Sep 17 00:00:00 2001 From: Jim Parry Date: Fri, 20 Sep 2019 16:14:51 -0700 Subject: [PATCH] EXIF not supported for GIF --- system/Images/Handlers/BaseHandler.php | 22 ++++++++++++++++++---- 1 file changed, 18 insertions(+), 4 deletions(-) diff --git a/system/Images/Handlers/BaseHandler.php b/system/Images/Handlers/BaseHandler.php index cc5c13685eee..6c5d1988a805 100644 --- a/system/Images/Handlers/BaseHandler.php +++ b/system/Images/Handlers/BaseHandler.php @@ -1,5 +1,4 @@ image->getPathname()); - if (! is_null($key) && is_array($exif)) + $exif = null; // default + switch ($this->image->imageType) { - $exif = $exif[$key] ?? false; + case IMAGETYPE_JPEG: + case IMAGETYPE_TIFF_II: + $exif = exif_read_data($this->image->getPathname()); + if (! is_null($key) && is_array($exif)) + { + $exif = $exif[$key] ?? false; + } } return $exif; @@ -800,6 +813,7 @@ protected function reproportion() } //-------------------------------------------------------------------- + /** * Return image width. *