-
Notifications
You must be signed in to change notification settings - Fork 165
Refine logic to select smaller image size #292
Copy link
Copy link
Closed
Labels
[Plugin] Modern Image FormatsIssues for the Modern Image Formats plugin (formerly WebP Uploads)Issues for the Modern Image Formats plugin (formerly WebP Uploads)[Type] EnhancementA suggestion for improvement of an existing featureA suggestion for improvement of an existing feature
Milestone
Description
Activity
Metadata
Metadata
Assignees
Labels
[Plugin] Modern Image FormatsIssues for the Modern Image Formats plugin (formerly WebP Uploads)Issues for the Modern Image Formats plugin (formerly WebP Uploads)[Type] EnhancementA suggestion for improvement of an existing featureA suggestion for improvement of an existing feature
As outlined in #186 (comment), there is a flaw with the current approach of choosing the smaller image MIME file in frontend content:
While attaching the
webp_uploads_get_mime_types_by_filesize()function to thewebp_uploads_content_image_mimesfilter seems elegant, I think this is the wrong integration point here. It's not sufficient to universally choose a preferred MIME type based on thefullimage size. We have to instead modifywebp_uploads_img_tag_update_mime_type()directly and make this check for every image size individually.