[wp-trac] [WordPress Trac] #21819: Use an image size for custom headers instead of duplicating an attachment
WordPress Trac
noreply at wordpress.org
Tue Mar 21 03:11:29 UTC 2017
#21819: Use an image size for custom headers instead of duplicating an attachment
-------------------------+-----------------------
Reporter: koopersmith | Owner:
Type: enhancement | Status: assigned
Priority: normal | Milestone: 4.7.4
Component: Customize | Version: 3.5
Severity: normal | Resolution:
Keywords: needs-patch | Focuses:
-------------------------+-----------------------
Comment (by westonruter):
@joemcgill could you elaborate?
Let's talk about the use case for a custom logo. Let's say the logo
requires a 400x400 image, but we upload a 640x480 image. The user performs
the crop and then… you're saying that there could very well be multiple
400x400 crops of an image that capture different parts of the image (e.g.
center,center vs top,left) and so each should be able to co-exist?
What if the cropped image created a new ad hoc image size on the fly and
gave it a name like, `custom_logo-400x400` and then stored it among the
`_wp_attachment_metadata` for the main attachment. The then problem is
that the different responsive image sizes for this 400x400 image would not
be created, unless we were to loop through all of the theme's image sizes
that are smaller than 400x400 and create a similar ad hoc image size for
each, e.g. `custom_logo-{$image_size}`.
This also then crosses into similar territory with #36441, and what
happens if the user uploads a square 512x512 image when a 400x400 image is
required. They shouldn't have to crop it since it's already square. But
then could we create an ad hoc `custom_logo-400x400` image size?
All of this is closely related to responsive image support for images in
the customizer media control (#36191).
--
Ticket URL: <https://core.trac.wordpress.org/ticket/21819#comment:15>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list