WordPress / performance

Performance plugin from the WordPress Performance Group, which is a collection of standalone performance modules.
https://wordpress.org/plugins/performance-lab/
GNU General Public License v2.0
367 stars 101 forks source link

Automatically opt into 1536x1536 and 2048x2048 sizes when generating fallback images #1679

Closed b1ink0 closed 1 day ago

b1ink0 commented 2 days ago

Summary

Fixes #1512

Relevant technical choices

This PR automatically opt into 1536x1536 and 2048x2048 sizes when generating fallback images. This only happens when the "generate fallback images" is enabled.

The opt in is done by modifying the $_wp_additional_image_sizes global which is the array containing extra image sizes. The provide_additional_mime_types property is set to true for the 1536x1536 and 2048x2048 image sizes so that the selected modern image format of these sizes is also generated.

Before

For the demo img these images were generated ( fallback images is enabled ) Screenshot 2024-11-20 at 1 58 21 PM

After

For the demo img these images are now generated ( fallback images is enabled ) Screenshot 2024-11-20 at 1 58 55 PM

github-actions[bot] commented 2 days ago

The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the props-bot label.

If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message.

Co-authored-by: b1ink0 <b1ink0@git.wordpress.org>
Co-authored-by: mukeshpanchal27 <mukesh27@git.wordpress.org>
Co-authored-by: felixarntz <flixos90@git.wordpress.org>
Co-authored-by: adamsilverstein <adamsilverstein@git.wordpress.org>

To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook.