Modern Image Formats

Beskrivning

This plugin adds WebP and AVIF support for media uploads within the WordPress application. By default, AVIF images will be generated if supported on the hosting server, otherwise WebP will be used as the output format. When both formats are available, the output format can be selected under Settings > Media. Modern images will be generated only for new uploads, pre-existing images will only converted to a modern format if images are regenerated. Images can be regenerated with a plugin like Regenerate Thumbnails or via WP-CLI with the wp media regenerate command.

By default, only modern image format sub-sizes will be generated for JPEG or PNG uploads – only the original uploaded file will still exist as a JPEG/PNG image, generated image sizes will be WebP or AVIF files. To change this behavior, there is a checkbox in Settings > Media ”Output fallback images” that – when checked – will result in the plugin generating both the original format as well as WebP or AVIF images for every sub-size (noting again that this will only affect newly uploaded images, i.e. after making said change).

Detta tillägg hette tidigare WebP Uploads.

Installation

Installation inifrån WordPress

  1. Besök Tillägg > Lägg till nytt.
  2. Sök efter Modern Image Formats.
  3. Installera och aktivera tillägget Modern Image Formats.

Manuell installation

  1. Ladda upp hela mappen webp-uploads till katalogen /wp-content/plugins/.
  2. Besök Tillägg.
  3. Aktivera tillägget Modern Image Formats.

Vanliga frågor

Var kan jag skicka in min återkoppling om tillägget?

Feedback is encouraged and much appreciated, especially since this plugin may contain future WordPress core features. If you have suggestions or requests for new features, you can submit them as an issue in the WordPress Performance Team’s GitHub repository. If you need help with troubleshooting or have a question about the plugin, please create a new topic on our support forum.

Var kan jag rapportera säkerhetsproblem?

Performance-teamet och WordPress-communityn tar säkerhetsfel på allvar. Vi uppskattar dina ansträngningar att ansvarsfullt rapportera dina upptäckter och kommer att göra allt vi kan för att erkänna dina bidrag.

För att rapportera ett säkerhetsproblem, besök WordPress HackerOne-programmet.

Hur kan jag bidra till tillägget?

Bidrag är alltid välkomna! Läs mer om hur du kan engagera dig i Handboken för Core Performance-team.

I’ve activated the Modern Image Formats plugin, but WebP images are not always generated when I upload a JPEG image. Why?

Det finns två huvudsakliga anledningar till att en WebP-bild kanske inte genereras:

  1. The Modern Image Formats plugin has identified that the WebP version of the uploaded JPEG image would have a larger file size than the original JPEG image, so it does not generate the WebP version.
  2. JPEG-bilden laddades inte upp till Mediabiblioteket. För närvarande genereras WebP-versioner endast för bilder till mediebiblioteket. WebP-versioner genereras inte för JPEG-bilder som läggs till på din webbplats på andra sätt, t.ex. i en mallfil eller i Anpassaren.

With the Modern Image Formats plugin activated, will the plugin generate JPEG and WebP versions of every image that I upload?

By default, the Modern Image Formats plugin will only generate WebP versions of the images that you upload. If you wish to have both WebP and JPEG versions generated, you can navigate to Settings > Media and enable the Generate JPEG files in addition to WebP option.

Recensioner

4 november 2024 4 svar
the images are compressed correctly but the type remains image/jpeg and I don’t know if this can lead to future problems
26 oktober 2024 1 svar
I hope I’m not the single one here with the same problem. My website images now not getting loaded properly. Need to refresh a couple of times to see pictures by picture. It shows that my pictures are missing and look like broken images (404 images not found). Now WordPress automatically .avif not .jpg as I upload my Pictures.P.S. I want to know if is a way do disable/uninstall this crap?
10 oktober 2024 1 svar
Just does not do anything. No message. No Error. Just not converting any images. Since there is also not a lot of documentation or community around this plugin I will give up and do this externally.
6 oktober 2024 3 svar
Don’t ever regenerate thumbnail with this plugin, it will broke a lot of Images on the frontend because Block editor is still mentioning the old extension rather than AVIF or WEBP. so if you don’t want a lot of your images is broken, don’t use it. Atleast until the problem is fixed.
18 juli 2024 5 svar
This plugin worked like it says but it did not change all of the images in the blog posts – only some. So I have a ton of broken images because they are referencing the .jpg and not the .avif I even tried regenrate thumbnails and that did not fix the issue. All of the broken images are the thumnails that are resized. It would be better if it did not automatically delete those images so that at least if it didnt replace them all in the blog posts the old image would still resolve.
Läs alla 13 betyg

Bidragsgivare och utvecklare

”Modern Image Formats” är programvara med öppen källkod. Följande personer har bidragit till detta tillägg.

Bidragande personer

”Modern Image Formats” har översatts till 10 språk. Tack till översättarna för deras bidrag.

Översätt ”Modern Image Formats” till ditt språk.

Intresserad av programutveckling?

Läs programkoden, kika på SVN-filförvaret eller prenumerera på utvecklarloggen via RSS.

Ändringslogg

2.5.0

Enhancements

  • Switch to wp_content_img_tag filter for improved image handling. (1772)

2.4.0

Enhancements

  • Automatically opt into 1536×1536 and 2048×2048 sizes when generating fallback images. (1679)
  • Convert WebP to AVIF on upload. (1724)
  • Enable end user opt-in to generate all sizes in fallback format. (1689)

2.3.0

Enhancements

  • Introduce webp_uploads_get_file_mime_type helper function. (1642)
  • Rename webp_uploads_get_file_mime_type to webp_uploads_get_attachment_file_mime_type to clarify scope. (1662)

Bug Fixes

  • Fix bug that would prevent uploaded images from being converted to the intended output format when having fallback formats enabled. (1635)

2.2.0

Enhancements

  • Convert uploaded PNG files to AVIF or WebP. (1421)

Bug Fixes

  • Account for responsive images being disabled when generating a PICTURE element. (1449)

2.1.0

Enhancements

  • Improve disabling checkbox for Picture Element on Media settings screen. (1470)

Bug Fixes

  • Add missing full size image in PICTURE > SOURCE srcset. (1437)
  • Correct the fallback image in PICTURE element. (1408)
  • Don’t wrap PICTURE element if JPEG fallback is not available. (1450)
  • Fix setting sizes attribute on PICTURE > SOURCE elements. (1354)
  • Remove string type hint from webp_uploads_sanitize_image_format() to prevent possible fatal error. (1410)

Documentation

  • Explain how to regenerate images in the Modern Image Formats readme. (1348)

2.0.2

Enhancements

  • I18N: Add context to Modern Image Formats section title. (1287)

Bug Fixes

  • Improve compatibility of styling picture elements. (1307)

2.0.1

Bug Fixes

  • Fix fatal error when another the_content filter callback returns null instead of a string. (1283)

2.0.0

Features

  • Add picture element support. (73)
  • Add AVIF image format support. Add setting for output image format to choose between WebP and AVIF. (1176)

Enhancements

  • Improve Settings->Media controls for Modern Image Formats. (1273)
  • Remove obsolete fallback script now that picture element is supported. (1269)

1.1.1

Enhancements

  • Prepend Settings link in webp-uploads. (1146)
  • Improve overall code quality with stricter static analysis checks. (775)
  • Bump minimum PHP requirement to 7.2. (1130)

Documentation

  • Updated inline documentation. (1160)

1.1.0

  • Add link to WebP settings to plugins table. (1036)
  • Rename plugin to ”Modern Image Formats”. (1101)
  • Use plugin slug for generator tag. (1103)
  • Delete option when uninstalling the Modern Image Formats plugin. (1116)
  • Bump minimum required WP version to 6.4. (1062)
  • Update tested WordPress version to 6.5. (1027)

1.0.5

  • Exclude ”.wordpress-org” directory when deploying standalone plugins. (866)

1.0.4

  • Bump minimum required PHP version to 7.0 and minimum required WP version to 6.3. (851)

1.0.3

  • Add standalone plugin assets. (815)

1.0.2

  • Fix WebP handling when editing images based on WordPress 6.3 change. (796)

1.0.1

  • Bump tested up to version to 6.3. (772)

1.0.0

  • Initial release of the Modern Image Formats plugin as a standalone plugin. (664)