performance icon indicating copy to clipboard operation
performance copied to clipboard

Add AVIF support to the Modern Image Formats plugin

Open adamsilverstein opened this issue 1 year ago • 3 comments

Feature Description

Now that WordPress 6.5+ supports the AVIF format, we should add support in the Modern Image Formats plugin (previously "WebP uploads").

Details

  • This feature should allow the user to choose between outputting WebP or AVIF images for uploaded images. We could add a dropdown to select the output format in the "uploading files" section of Settings->Media eg "Choose the image output format".
  • The AVIF option should only be available if the server actually supports AVIF. otherwise the UI should remain unchanged
  • When the user selects the AVIF format, all images are output in AVIF where they are currently output in WebP (nothing else changes)
  • The current checkbox for "Generate JPEG files in addition to WebP" needs to be renamed. We can remove the WebP mention, eg. "In addition, generate JPEG images" or "Generate JPEG fallback images"

Questions

  • Can we make AVIF the default for new installs?

Related:

https://github.com/WordPress/performance/issues/11 https://github.com/WordPress/performance/issues/1133

adamsilverstein avatar Apr 16 '24 16:04 adamsilverstein

How to remove old image format suffix when moving to new image format webp and aivf in the future?

  • Original photo: https://phankim.com/wp-content/uploads/2024/04/md_1712823488759Q76yt082f8.jpg

  • Photo after conversion: https://phankim.com/wp-content/uploads/2024/04/md_1712823488759Q76yt082f8-jpg.webp

  • The photo I want: https://phankim.com/wp-content/uploads/2024/04/md_1712823488759Q76yt082f8.webp

phanduynam avatar Apr 17 '24 01:04 phanduynam

How to remove old image format suffix when moving to new image format webp and aivf in the future?

@phanduynam we decided on this naming convention during development to avoid naming conflicts, for example if you upload file1.jpg and file1.jpeg, both would be converted to file1.webp without this naming convention, causing a possible naming conflict.

I don't see a direct way to change this with a filter.

Is this causing an issue for you or more something you noticed that seemed wrong? I guess filenames are considered an implementation detail most users shouldn't care about.

adamsilverstein avatar Apr 23 '24 18:04 adamsilverstein

I started work on adding AVIF support in https://github.com/WordPress/performance/pull/1176

adamsilverstein avatar Apr 23 '24 21:04 adamsilverstein