Opened 4 years ago
Last modified 2 years ago
#50061 accepted enhancement
Image_meta original_image as valid image_size
Reported by: | tomcent | Owned by: | antpb |
---|---|---|---|
Milestone: | Future Release | Priority: | normal |
Severity: | normal | Version: | 5.3 |
Component: | Media | Keywords: | dev-feedback |
Focuses: | Cc: |
Description
Since the introduction of the "Big Image Threshold" in Version 5.3 it is no longer possible to get the width and height of the original image. The name of the original file is stored as string in the image metadata (tested with wp_get_attachment_metadata) and functions
wp_get_original_image_path
and
wp_get_original_image_url
will only provide the path and url of the original image.
It would be more developer friendly to implement it as a valid image size in the "sizes" array with name "original" or similar. This way functions like wp_get_attachment_image_src could be used to get extended original image information, without breaking existing configurations.
Change History (7)
This ticket was mentioned in Slack in #core-media by antpb. View the logs.
3 years ago
#2
@
3 years ago
- Milestone changed from Awaiting Review to 6.0
- Owner set to antpb
- Status changed from new to accepted
This ticket was mentioned in Slack in #core-media by tomcent. View the logs.
3 years ago
This ticket was mentioned in Slack in #core by costdev. View the logs.
2 years ago
#5
@
2 years ago
Noting that we don't currently store the original size (width/height or filesize) info which we probably should consider to make getting the data more efficient in the new function (which would use the data when available).
This ticket was mentioned in Slack in #core by chaion07. View the logs.
2 years ago
#7
@
2 years ago
- Milestone changed from 6.0 to Future Release
Thanks @tomcent for reporting this. We reviewed this ticket during a recent bug-scrub session. Based on the feedback received from the team and considering Beta 01 coming into effect by the end of today we are updating the milestone. With no patch and @adamsilverstein last comment it is unlikely to be progressed within 6.0.
Props to @peterwilsoncc & @costdev
Cheers!
Great catch, I could see how this happens. Mentioned in the Media meeting @adamsilverstein said it might be beneficial for a new separate function to get those original source images that way current behavior works while giving the data that you need.