How to fix the «failed to open stream: Invalid argument in vendor/magento/framework/Image/Adapter/Gd2.php» Magento 2.2 bug in Windows?

image
bug
filesystem
windows
bug-fix
magento22
magento222

(Dmitry Fedyuk) #1

Replace the code:

with the following one:

$result = str_replace('/', DIRECTORY_SEPARATOR, $result);
$prefix = (substr($result, 0, 1) == DIRECTORY_SEPARATOR) ? DIRECTORY_SEPARATOR : '';
$result = $this->join($result, $this->getModule());
$result = $this->join($result, $this->getMiscPath());
$result = $this->join($result, str_replace('/', DIRECTORY_SEPARATOR, $this->getFilePath()));

How to fix the Magento 2.2.x image URLs bug in Windows?
How to fix the «Unable to write file into directory: Access forbidden» bug in Windows?
(Dmitry Fedyuk) #2

See also: