Opened 12 years ago
Closed 10 years ago
#21004 closed defect (bug) (fixed)
add_image_size hard crop messes up image editor rendering
Reported by: | geniepop | Owned by: | |
---|---|---|---|
Milestone: | 3.5 | Priority: | normal |
Severity: | normal | Version: | 3.4 |
Component: | Media | Keywords: | has-patch |
Focuses: | Cc: |
Description
When I add an image size with hard crop set to true ( ex: add_image_size('index-thumbnail', 420, 550, true); ) it makes it so that you cannot edit the full size of an image in the image editor - only a cropped version.
http://i47.tinypic.com/20h2dfr.png
(link to screenshot)
The left image in the screenshot is the editor when I removed 'true' from my add_image_size arguments. The right image is with 'true' added back in.
I also see that others had the same problem in this thread: http://wordpress.org/support/topic/help-add_image_size-and-image-cropping?replies=6
...but it was closed without any resolution.
Attachments (1)
Change History (4)
Note: See
TracTickets for help on using
tickets.
Instead of the full size,
stream_preview_image()
loads the nearest image size that matches 400x400, apparently assuming that it will have the same proportions as the original, which is not the case here.We could probably remove the size parameter to make it always load the original.
The resulting preview image should still be properly scaled later by
_image_get_preview_ratio()
:http://core.trac.wordpress.org/browser/tags/3.4/wp-admin/includes/image-edit.php#L364