[wp-trac] [WordPress Trac] #12218: image_get_intermediate_size() may return croped image when full image is requested
WordPress Trac
wp-trac at lists.automattic.com
Sat Feb 13 12:20:50 UTC 2010
#12218: image_get_intermediate_size() may return croped image when full image is
requested
--------------------------+-------------------------------------------------
Reporter: dd32 | Owner:
Type: defect (bug) | Status: new
Priority: normal | Milestone: 3.0
Component: Upload | Version: 3.0
Severity: normal | Keywords:
--------------------------+-------------------------------------------------
At present image_get_intermediate_size() is not aware of croped images,
infact, Images being croped is not stored in the meta data at all.
This has caused a bug to appear in the twentyten theme which uses a post
thumbnail of 940x198px (croped).
If you upload an image 1024x768, and attempt to display it as 640x480,
you'll recieve the next largest image which fits,
image_get_intermediate_size() will return the 940x198px version. (For
example, On the twentyten Attachment page)
The solution i've come accross is to store if the image has been auto-
croped in the meta data, and upon retrieval, only return croped images for
sizes which speecify croped as OK.
I'm attaching a POC patch, ideally, it should automatically add the list
of custom image sizes which are cropped and test against that.
--
Ticket URL: <http://core.trac.wordpress.org/ticket/12218>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software
More information about the wp-trac
mailing list