[wp-trac] [WordPress Trac] #36441: Customizer: when setting header image, site icon and logo, do not force the user to crop the image if cropping is not required
WordPress Trac
noreply at wordpress.org
Sat Mar 18 19:53:11 UTC 2017
#36441: Customizer: when setting header image, site icon and logo, do not force the
user to crop the image if cropping is not required
-------------------------------------+--------------------
Reporter: azaozz | Owner:
Type: defect (bug) | Status: new
Priority: normal | Milestone: 4.7.4
Component: Customize | Version:
Severity: normal | Resolution:
Keywords: has-patch needs-testing | Focuses:
-------------------------------------+--------------------
Changes (by westonruter):
* keywords: needs-patch => has-patch needs-testing
Comment:
See [attachment:36441.0.diff].
The key change here is that if the aspect ratio of the selected image is
the same as the required aspect ratio, then it allows cropping to be
skipped.
What I'm not certain about now is, if you skip cropping, whether the theme
will be able to get the best image size when displaying. For example,
`the_custom_logo()` will currently use the `full` size, which here is
wrong. Instead it should be asking for the `array( $width, $height )` as
defined when you added `custom-logo` theme support. This assumes that a
theme has done an `add_image_size()` call with the same dimensions as the
custom logo is defined to need. Presumably this would then allow
`wp_get_attachment_image()` to get the cropped image size as opposed to
getting the full size. We wouldn't want the full high res image to always
be used if the user skipped cropping.
--
Ticket URL: <https://core.trac.wordpress.org/ticket/36441#comment:5>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list