[wp-trac] [WordPress Trac] #36255: Custom Logo: Crop UI

WordPress Trac noreply at wordpress.org
Fri Mar 18 05:26:35 UTC 2016


#36255: Custom Logo: Crop UI
--------------------------+--------------------------
 Reporter:  mor10         |       Owner:  westonruter
     Type:  defect (bug)  |      Status:  accepted
 Priority:  normal        |   Milestone:  4.5
Component:  Customize     |     Version:  trunk
 Severity:  normal        |  Resolution:
 Keywords:  has-patch     |     Focuses:  ui
--------------------------+--------------------------

Comment (by westonruter):

 OK, I think I figured out the issue with cropping. When Site Icon was
 added (#16434) it defined a `CustomizeImageCropper` which included
 ([https://core.trac.wordpress.org/changeset/33154#file9 r33154]):

 {{{#!js
 cropDetails.dst_width  = control.params.width;
 cropDetails.dst_height = control.params.height;
 }}}

 This worked fine for an image with a hard crop, such as a square site
 icon, which is what this new cropper was added for. However, defining the
 destination width and height is not desired when `flex_width` and
 `flex_height` have been defined. So I believe all that is needing to be
 done is change the above to:

 {{{#!js
 if ( ! control.params.flex_width ) {
         cropDetails.dst_width = control.params.width;
 }
 if ( ! control.params.flex_height ) {
         cropDetails.dst_height = control.params.height;
 }
 }}}

 See [attachment:36255.3.diff].

 Aside: I don't see any `WP_Customize_Cropped_Image_Control` instances in
 Core even making use of `flex_width` or `flex_height`.

 @obenland @celloexpressions please review, as you both were the Site Icon
 developers.

--
Ticket URL: <https://core.trac.wordpress.org/ticket/36255#comment:20>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list