Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Conversation

b1ink0
Copy link
Contributor

@b1ink0 b1ink0 commented Nov 20, 2024

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

Copy link

github-actions bot commented Nov 20, 2024

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 <[email protected]>
Co-authored-by: mukeshpanchal27 <[email protected]>
Co-authored-by: felixarntz <[email protected]>
Co-authored-by: adamsilverstein <[email protected]>

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

@mukeshpanchal27 mukeshpanchal27 added [Type] Enhancement A suggestion for improvement of an existing feature [Plugin] Modern Image Formats Issues for the Modern Image Formats plugin (formerly WebP Uploads) labels Nov 20, 2024
Copy link
Member

@felixarntz felixarntz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@b1ink0 This basically looks good to me, only two outstanding comments to address.

plugins/webp-uploads/hooks.php Outdated Show resolved Hide resolved
@felixarntz felixarntz added this to the webp-uploads n.e.x.t milestone Nov 20, 2024
@felixarntz felixarntz added [Plugin] Modern Image Formats Issues for the Modern Image Formats plugin (formerly WebP Uploads) and removed [Plugin] Modern Image Formats Issues for the Modern Image Formats plugin (formerly WebP Uploads) labels Nov 20, 2024
@mukeshpanchal27 mukeshpanchal27 merged commit b0007c6 into WordPress:trunk Nov 21, 2024
14 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Plugin] Modern Image Formats Issues for the Modern Image Formats plugin (formerly WebP Uploads) [Type] Enhancement A suggestion for improvement of an existing feature
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Automatically opt into 1536x1536 and 2048x2048 sizes when generating fallback images
3 participants