Skip to content
This repository has been archived by the owner on Jun 8, 2024. It is now read-only.

HTML remains unchanged #59

Closed
2 tasks done
DanMan opened this issue Jan 30, 2020 · 8 comments
Closed
2 tasks done

HTML remains unchanged #59

DanMan opened this issue Jan 30, 2020 · 8 comments

Comments

@DanMan
Copy link

DanMan commented Jan 30, 2020

Actual behaviour

HTML is not changed, but (some?) WebP images are generated (present in media/image folders). But it seems like only for the base images, not the thumbnails with the dimension suffix (e.g. 200x200 and thelike).

The status page thinks there are no WebP encoders, but encoding actually works on the command line (status there is "OK" as well).

Expected behaviour

All WebP images should be created and the generated HTML should include the WebP images instead of PNG ones.

Environment

Shopware 5.6.3
Plugin 1.1.0 and Google Binary only
PHP 7.2.27
Webspace configured via Plesk Obsidian 18.0.21

Steps to reproduce

  1. Install plugin as documented
  2. Load any frontend page like the product listing
  3. Check HTML and see no mention of WebP images

Checklist

  • I have checked all issues and haven't found a similar report.
  • I am using the latest stable version of this plugin.
@shyim
Copy link
Member

shyim commented Jan 30, 2020

Did you enabled webp in the plugin config?

@DanMan
Copy link
Author

DanMan commented Jan 30, 2020

Yes, I have. I'm using a template that inherits from the "Responsive" base template.

It works on a different server that doesn't use Plesk. So it might have to do with that. Is there some check implemented on the template level?

I'm not sure getGoogleWebpConverterPath() works as intended.

@DanMan
Copy link
Author

DanMan commented Jan 30, 2020

Another thing: when running frosh:webp:generate it only counts as much images as "stack" as there are in the media manager. Shouldn't the number be larger due to the thumbnails generated by sw:thumbnail:generate?

In any case, if I enable Smarty debugging, there are "webp" entries among the article thumbnails. But they're not used in the output.

@DanMan
Copy link
Author

DanMan commented Jan 30, 2020

Ok, so it kinda works, if I copy for example the plugin's FroshWebP/Resources/views/frontend/listing/product-box/product-image.tpl into my own template and re-compile it. But even then, not nearly all images are showing up. Most are broken.

@shyim
Copy link
Member

shyim commented Feb 16, 2020

frosh:webp:generate Just generates the images for the normal image. That's the reason why ./bin/console sw:thumbnail:generate -f is required.

Did you done both commands?
Have you something special configured in your theme?

@DanMan
Copy link
Author

DanMan commented Feb 19, 2020

Well, that's not what the installation instruction says, which is to run sw:thumbnail:generate first, then frosh:webp:generate. I've now run the former again, and now it seems to work.

But it also tried to convert the SVG files, which failed. We use one for the site logo, and that one's missing now. The generated HTML has changed and refers to a WebP image that doesn't exist.

Strangely, the browser doesn't fall back on the also referenced SVG file in the HTML but insists to show the broken WebP file instead. What gives?

@shyim
Copy link
Member

shyim commented Feb 19, 2020

PHP cannot handle svg ad Image. WebP should be ignored on svg

@DanMan
Copy link
Author

DanMan commented Feb 20, 2020

I've just tried it again with some banners, and it wasn't enough to run frosh:webp:generate first and then sw:thumbnail:generate. I had to use the force flag for the latter to have the new images show up.

That's ok for small albums like the one for banners, since you can pass the albumId as parameter. But if the product images change (new products added) and you must force re-generating all of them not just the new ones, it can take hours during which at least some images will be broken on the website. Not good.

Why is it that sw:thumbnail:generate doesn't pick up on the new images, if you don't force it?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants