swissspidy / media-experiments

WordPress media experiments
GNU General Public License v2.0
69 stars 1 forks source link

AVIF thumbnail generation not working #487

Closed gyurmey2 closed 1 month ago

gyurmey2 commented 1 month ago

Hi, I started testing the plugin, but for some reason images that should be in AVIF format are generated to PNG format.

swissspidy commented 1 month ago

Did you choose AVIF as the desired output fornat in the preferences?

gyurmey2 commented 1 month ago

Yes, exactly. You can also please test it using the link I provided.

swissspidy commented 1 month ago

I cannot reproduce this issue on my own website.

This InstaWP link you shared doesn't work properly. InstaWP is breaking the loading of some scripts and styles.

Screenshot 2024-06-01 at 11 37 17

Instead of loading scripts it responds with an interstitial page, as you can see from this screenshot:

Screenshot 2024-06-01 at 11 38 01

Please try the plugin somewhere else while InstaWP is broken like this.

gyurmey2 commented 1 month ago

You're right, something was wrong.

In this case it should be ok. fenr3 PZLolf9ohcI

swissspidy commented 1 month ago

Works like a charm on that site for me, the JPG image is converted to AVIF.

gyurmey2 commented 1 month ago

Thanks for testing, but this page is still PNG.

me

swissspidy commented 1 month ago

Huh, interesting, it looks like the thumbnails didn‘t convert to the right format. I‘ll take a closer look.

swissspidy commented 1 month ago

Looks like it's an issue with the image library preference.

A workaround for now is to change it to libvips (which is recommended anyway):

Screenshot 2024-06-02 at 17 35 41
gyurmey2 commented 1 month ago

I understand and thank you. I deliberately chose "Browser" because it completely solves this issue.

swissspidy commented 1 month ago

You mean because the image processing runs in the browser? well, libvips also runs in the browser :) So you won't have any memory issues.

"Browser" just means it uses the browser's built-in Canvas API to resize images, whereas libvips runs libvips via WebAssembly in a web worker and is much faster.

Please give it a try :)

If you are worried about server memory issues, the important setting is the "thumbnail generation" part and whether you choose "client-side" or "server-side" there. server-side would be the issue.

I'll see if I can make the wording a bit more clearer.

gyurmey2 commented 1 month ago

Thanks for the explanation. And I think I need to take another look at this ;)

The plugin itself is really amazing!