Make WordPress Core

Opened 12 months ago

Last modified 5 months ago

#58611 assigned defect (bug)

wp_get_missing_image_subsizes can return incorrect subsizes for a rotated image

Reported by: ianmjones's profile ianmjones Owned by: antpb's profile 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.


12 months ago
#1

  • Keywords has-patch added; needs-patch removed

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.

This ticket was mentioned in Slack in #core-media by ianmjones. View the logs.


12 months ago

#3 @antpb
12 months ago

  • Milestone changed from Awaiting Review to 6.3

#4 @antpb
12 months ago

  • Owner set to antpb
  • Status changed from new to assigned

This ticket was mentioned in Slack in #core-media by ianmjones. View the logs.


12 months ago

This ticket was mentioned in Slack in #core-media by antpb. View the logs.


12 months ago

This ticket was mentioned in Slack in #core-media by ianmjones. View the logs.


11 months ago

#8 @azaozz
11 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.


10 months ago

#10 @marybaum
10 months ago

Asking @antpb if maybe the EXIF data import should not include the rotation data.
Then we can consider an acceptable patch.

#11 @nicolefurlan
9 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.


9 months ago

#13 @antpb
9 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."

This ticket was mentioned in Slack in #core by audrasjb. View the logs.


5 months ago

#15 @audrasjb
5 months ago

  • Milestone changed from 6.5 to Future Release

As per today's bug scrub, we decided to move this ticket to Future Release to give it more time to get a patch.

Note: See TracTickets for help on using tickets.