Opened 16 months ago
Last modified 8 months ago
#58611 assigned defect (bug)
wp_get_missing_image_subsizes can return incorrect subsizes for a rotated image
Reported by: | ianmjones | Owned by: | antpb |
---|---|---|---|
Milestone: | Future Release | Priority: | normal |
Severity: | normal | Version: | 6.2.2 |
Component: | Media | Keywords: | needs-patch |
Focuses: | Cc: |
Description
During the upload of a rotated image to the Media Library, the wp_get_missing_image_subsizes()
function often returns missing subsizes for the non-rotated original image that will never be generated for the rotated image.
This means for example, if a plugin is filtering wp_update_attachment_metadata
and waiting for all thumbnails to have been generated before performing some action, it may be told that there are missing thumbnails for a rotated image, that will not be generated. Therefore it will not be able to perform that action as not all the thumbnails are deemed to be available.
Change History (15)
This ticket was mentioned in PR #4681 on WordPress/wordpress-develop by @ianmjones.
16 months ago
#1
- Keywords has-patch added; needs-patch removed
This ticket was mentioned in Slack in #core-media by ianmjones. View the logs.
16 months ago
This ticket was mentioned in Slack in #core-media by ianmjones. View the logs.
15 months ago
This ticket was mentioned in Slack in #core-media by antpb. View the logs.
15 months ago
This ticket was mentioned in Slack in #core-media by ianmjones. View the logs.
15 months ago
#8
@
15 months ago
- Keywords needs-patch added; has-patch removed
- Milestone changed from 6.3 to 6.4
Moving this to 6.4 as it needs a patch.
This ticket was mentioned in Slack in #core by marybaum. View the logs.
13 months ago
#10
@
13 months ago
Asking @antpb if maybe the EXIF data import should not include the rotation data.
Then we can consider an acceptable patch.
#11
@
12 months ago
@antpb just checking in on this ticket. Could you review #comment:10?
This ticket was mentioned in Slack in #core-media by antpb. View the logs.
12 months ago
#13
@
12 months ago
- Milestone changed from 6.4 to 6.5
with this needing a rework on the solution to account for the suggestion @ianmjones made we should move to 6.5
From @ianmjones : "To properly determine whether the original image can be used to generate missing thumbnail sizes, we probably need to grab its width vs. height ratio and compare with the full size image's ration. If they're the same, then yay, we can use the original and maybe pick up a couple extra sizes, but otherwise, stick with the full size image."
During the upload of a rotated image, the
wp_get_missing_image_subsizes()
function currently incorrectly uses the dimensions of the non-rotated original image to determine which subsizes should exist.This changeset adds a condition that the original image should only be used for setting the image dimensions if the orientation of the Media Library item has not been changed.