5

I wanted to start building a theme from scratch & my first step was to create a new theme with "Blank" as a parent. I then browsed a few pages & saw that everything works just fine.
On the next step, I removed the parent from my theme & checked again.
Now, the homepage loads OK (only with no CSS, as expected), but on categories & product pages I get this exception:

Exception #0 (Exception): Warning: getimagesize(): Filename cannot be empty in {Magento-Root-Dir}/vendor/magento/module-catalog/Model/Product/Image.php on line 890
...

Thing I already tried (that didn't solve the problem):
* Reset owner & permissions.
* Removing all the generated stuff (cache, page_cache, view_preprocessed, generation, generated, di, static files, ...) & catalog images cache.
* Running all sort of CLI commands like setup:upgrade, setup:static-content:deploy, setup:di:compile, ...
* Resizing product images using catalog:images:resize.


* I'm using Magento 2.2.2 with developer mode enabled.
* Environment: Ubuntu 16.04 LTS + Apache/2.4.18 & php7.0.26
-- Any Idea??

UPDATE:
During some debugging I discovered that the method getMediaAttributes when called from \Magento\Catalog\Helper\Image on line 191, returns different results for Blank theme than my custom parentless theme. On my theme it's like the product has no images (& it's the same product). Does it ring a bell? So far that's what I found out...

1
  • Having this same exact issue. Developer mode can't load any product images.
    – Octoxan
    Jan 10, 2018 at 17:22

2 Answers 2

3

The problem is in /etc/view.xml some sizes are missing, you can use the default file form luma theme and change the image sizes in it and it should work.

2
  • I am getting same error in my custom theme and now I used etc/view.xml from luma theme, but still getting same error, any other suggestion how to fix this? Jun 1, 2018 at 12:11
  • Please try to refresh your cache and try php bin/magento catalog:images:resize Jun 6, 2018 at 8:54
0

Usually it happens when magento can not access product images or even default placeholder. solution can come in two ways:

First, rechecking the file and folder permissions for media folder & sub-folders.

Second, re-upload product images and also assign default placeholder from following path

Admin > Configuration > Catalog > Product Image Placeholders

1
  • 1
    This is not a solution to the described case.
    – Pini
    Feb 26, 2018 at 10:33

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.