adamsilverstein / modern-images-wp

Apache License 2.0
81 stars 8 forks source link

avif and jpg XL greyed out #36

Open myedgy opened 1 year ago

myedgy commented 1 year ago

Hello,

First of all thanks for this plugin. Do I need to install something special on my dedicated server, before I can select Avif from the dropdown menu?

Currently, its greyed out.

adamsilverstein commented 1 year ago

Hey @myedgy you need to have a server that supports the formats. If the option is greyed out, it is likely your server doesn't support the format. I'm not sure which hosts support AVIF, you will need to run on PHP 8.1 to get AVIF support.

You can also check which formats your server supports under Tools->Site Health->Info(tab)->Media Handling.

myedgy commented 1 year ago

Hello I have an dedicated server in full control. What should i need to install except php 8.1 (php 8.1 in already installed, but not elemontor is not compatible yet.) I will test it on a new wordpress install.

I have a avif convert libary installed to but that didn't worked.

myedgy commented 1 year ago

So I installed a fresh wordpress on Php 8.1.13 on Debian 11 And it's still grayed out.

At Media Handeling GD supported file formats | GIF, JPEG, PNG, WebP, BMP, AVIF

In the list of ImageMagick supported file formats its not listed.

cvladan commented 1 year ago

Although you have probably already resolved this issue, here is some additional information:

To enable AVIF, GD extension must be compiled with AVIF support. Additionally, it depends on libavif package, but that you already have installed. Please refer to the following article: AVIF image support in PHP 8.1

myedgy commented 1 year ago

Nope it's not solved yet. I did that step, will try it again.

adamsilverstein commented 1 year ago

@myedgy I suggest checking under Tools->Site Health->Info->Media to verify the supported formats for your server.

Oh - I see you say GD supports AVIF, that should make the option available. Are you on the latest version of core? some bugs were fixed that could break support if only one engine supports a format.

koech-v commented 11 months ago

@adamsilverstein Thank you for this plugin.

AVIF option is still greyed out yet GD supported file formats: GIF, JPEG, PNG, WebP, BMP, AVIF, XPM exists under Tools > Site Health > Info. Running PHP version 8.1 and latest WP version.

adamsilverstein commented 10 months ago

@koech-v - can you try activating this Gist as an mu plugin to see if that fixes the grayed out issue?

https://gist.github.com/adamsilverstein/c8b5d0145aeda7fe0a04e4573f2c7c32

adamsilverstein commented 10 months ago

Actually, I was able to reproduce this on a test server - it looks like _wp_image_editor_choose still isn't returning the correct editor. I updated the plugin in 1.2.0 to fall back to GD even when core returns no editor for the mime type. I'll try to look into this further in core; in the meantime can you please give 1.2.0 a test?

adamsilverstein commented 10 months ago

https://core.trac.wordpress.org/ticket/59760 will fix the issue for AVIF detection in GD.

JPEGXL detection isn't possible yet for this plugin since we rely on server side PHP support and JPEGXL isn't supported yet in PHP as far as I can tell.

koech-v commented 10 months ago

I updated the plugin and AVIF option is no longer greyed out and have set it as such, but image output is still as it was. I hope the ticket you just shared to WordPress Core will fix it in a future WordPress update.