[wp-trac] [WordPress Trac] #34851: Flex Sizes In WP_Customize_Cropped_Image_Control Not Working
WordPress Trac
noreply at wordpress.org
Fri Jan 15 02:08:54 UTC 2016
#34851: Flex Sizes In WP_Customize_Cropped_Image_Control Not Working
-----------------------------+------------------------------
Reporter: stephen.punwasi | Owner:
Type: defect (bug) | Status: new
Priority: normal | Milestone: Awaiting Review
Component: Customize | Version: 4.3.1
Severity: normal | Resolution:
Keywords: | Focuses:
-----------------------------+------------------------------
Comment (by coreymckrill4ttf):
I'm seeing this in 4.4.1 as well. It looks like this is happening because
when [[https://core.trac.wordpress.org/browser/tags/4.4.1/src/wp-
includes/js/media-views.js#L381|the script]] submits the parameters for
executing the crop, it sets the destination file dimensions to be whatever
the "suggested" width and height are in the Customizer's control
definition.
{{{#!javascript
cropDetails.dst_width = control.params.width;
cropDetails.dst_height = control.params.height;
}}}
Changing `dst_width` and `dst_height` to equal the normal `width` and
`height` values in the cropDetails object appears to fix the problem,
because then the destination file has the same dimensions as the area
selected for the crop. That may not always be the desired outcome, if the
cropped file is expected to have a min/max dimension limit, but in that
case, it seems like there should probably be other parameters for the
`WP_Customize_Cropped_Image_Control` to specify this behavior.
--
Ticket URL: <https://core.trac.wordpress.org/ticket/34851#comment:2>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list