Opened 2 months ago
Closed 2 months ago
#7904 closed defect (bug) (fixed)
Photo dimensions incorrectly validated
Reported by: |
|
Owned by: |
|
---|---|---|---|
Milestone: | Priority: | normal | |
Component: | Photo Directory | Keywords: | needs-patch |
Cc: |
Description
wp_get_attachment_metadata() retrieves the metadata of the scaled version of uploaded images, not the original. https://github.com/WordPress/wordpress.org/blob/c4d8d5902c132eb79729c3473d94426926b16dc0/wordpress.org/public_html/wp-content/plugins/photo-directory/inc/uploads.php#L693
Thus even tho the original does meet the 2000px minimum requirement, the scaled version might not and thus the image is rejected.
I tested this by installing the plugin wp-frontend-uploader on a test site, uploading a photo, and checking the metadata with wp_get_attachment_metadata
The metadata returned dimensions of the *-scaled.jpg version instead of the original.
Change History (2)
Note: See
TracTickets for help on using
tickets.
If the uploaded image exceeds 2560px in either dimension, WordPress scales it down proportionally so that the largest side is exactly 2560px.
An image that is 2592px wide and 4608px high will be shrunk down by about 44.5%
This will leave the wide side with only 1440px.