Skip to content
This repository was archived by the owner on Apr 29, 2019. It is now read-only.

Commit a10d403

Browse files
author
Oleksii Korshenko
authored
MAGETWO-86711: Log file path when image open throws exception #13144
2 parents 78da6da + 61e35ab commit a10d403

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

lib/internal/Magento/Framework/Image/Adapter/Gd2.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,10 @@ public function open($filename)
6262
throw new \OverflowException('Memory limit has been reached.');
6363
}
6464
$this->imageDestroy();
65-
$this->_imageHandler = call_user_func($this->_getCallback('create'), $this->_fileName);
65+
$this->_imageHandler = call_user_func(
66+
$this->_getCallback('create', null, sprintf('Unsupported image format. File: %s', $this->_fileName)),
67+
$this->_fileName
68+
);
6669
}
6770

6871
/**

lib/internal/Magento/Framework/Image/Adapter/ImageMagick.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ public function open($filename)
7777
try {
7878
$this->_imageHandler = new \Imagick($this->_fileName);
7979
} catch (\ImagickException $e) {
80-
throw new \Exception('Unsupported image format.', $e->getCode(), $e);
80+
throw new \Exception(sprintf('Unsupported image format. File: %s', $this->_fileName), $e->getCode(), $e);
8181
}
8282

8383
$this->backgroundColor();

0 commit comments

Comments
 (0)