diff --git a/lib/internal/Magento/Framework/Image/Adapter/Gd2.php b/lib/internal/Magento/Framework/Image/Adapter/Gd2.php index 444ab7113d429..365fa5939b6b5 100644 --- a/lib/internal/Magento/Framework/Image/Adapter/Gd2.php +++ b/lib/internal/Magento/Framework/Image/Adapter/Gd2.php @@ -62,7 +62,10 @@ public function open($filename) throw new \OverflowException('Memory limit has been reached.'); } $this->imageDestroy(); - $this->_imageHandler = call_user_func($this->_getCallback('create'), $this->_fileName); + $this->_imageHandler = call_user_func( + $this->_getCallback('create', null, sprintf('Unsupported image format. File: %s', $this->_fileName)), + $this->_fileName + ); } /** diff --git a/lib/internal/Magento/Framework/Image/Adapter/ImageMagick.php b/lib/internal/Magento/Framework/Image/Adapter/ImageMagick.php index 50b9a5a013273..e0ead031a9ba0 100644 --- a/lib/internal/Magento/Framework/Image/Adapter/ImageMagick.php +++ b/lib/internal/Magento/Framework/Image/Adapter/ImageMagick.php @@ -77,7 +77,7 @@ public function open($filename) try { $this->_imageHandler = new \Imagick($this->_fileName); } catch (\ImagickException $e) { - throw new \Exception('Unsupported image format.', $e->getCode(), $e); + throw new \Exception(sprintf('Unsupported image format. File: %s', $this->_fileName), $e->getCode(), $e); } $this->backgroundColor();