Open
Description
Preconditions (*)
- Magento 2.4.2
Steps to reproduce (*)
- In extension code use \Magento\Framework\Image\Factory::create($filePath) where $filePath is not a valid file.
- View var/log/exception.log. Filepath is empty in exception log file.
Description (*)
This appears to be a problem with the Magento Framework GD2 library assuming $this->_fileName has been set where it may not necessarily be the case.
The file_exists check is on $fileName (which does have a valid value in the bug scenario here), so I would expect the exception message to use the same value for consistency and to log the correct value.
Expected result (*)
- There should be a log entry: main.ERROR: File "filePath" does not exist.
Actual result (*)
- There is a log entry: main.ERROR: File "" does not exist.
- The file path is empty and it is not clear what file was attempted to be found.
- Severity: S4 - Affects aesthetics, professional look and feel, “quality” or “usability”.