[wp-trac] [WordPress Trac] #19889: Image Editor doesn't apply changes to custom image sizes
WordPress Trac
noreply at wordpress.org
Tue Dec 18 21:33:06 UTC 2012
#19889: Image Editor doesn't apply changes to custom image sizes
--------------------------+-----------------------------
Reporter: Otto42 | Owner:
Type: defect (bug) | Status: reopened
Priority: normal | Milestone: Future Release
Component: Media | Version: 3.3.1
Severity: normal | Resolution:
Keywords: has-patch |
--------------------------+-----------------------------
Comment (by anatolbroder):
Let’s talk about the responsive challenge. Imagine we need 3 different
image ''ratios''.
1. Thumbnail (1:1)
1. Medium (1.5:1)
1. Large (3:1)
The most common transformation is the crop. I fact we ''must'' crop the
original image ''manually'', because the automatic crop function would
just cut out the middle part of the original. This is an ''artistic''
decision. So our edit list would look like:
* All sizes
* Thumbnail
* Medium
* Large
But for every ratio we need multiple versions. Think on different screen
widths and resolutions (mdpi, hdpi, xhdpi, …). So if i. e. we crop the
medium ratio, we want a 480 × 320, a 720 × 480, and a 960 × 640 version of
it. In fact, we register all the medium versions, but we need to crop
every ratio only ''once''.
* Medium
* 480 × 320
* 720 × 480
* 960 × 640
There are two solutions.
== Sizes ==
The naive one is a ''check'' list (☒) with all the registered sizes.
* All sizes
* Thumbnail
* 160 × 160
* 240 × 240
* 320 × 320
* Medium
* 480 × 320
* 720 × 480
* 960 × 640
* Large
* 1440 × 480
* 2160 × 720
* 2880 × 960
I think you can implement that one fast, till 3.6. Me, the editors of my
magazine and Jon Kristian would be happy with that.
== Shapes ==
The smart one is to go with ratios or ''shapes''. We should not define
sizes but shapes. (Call it whatever you want, my English is too bad.) The
medium shape would be a ''group'' of sizes.
So we can introduce an ''add_image_shape'' function you can define the
shape ratio, minimal size, etc.
{{{
add_image_shape( <name>, <ratio>, <min_width>, <max_width>, <crop>);
}}}
Then if we add a size with ''new_add_image_size'', we could pass the
defined shape through the parameter.
{{{
new_add_image_size( <name>, <shape>, <width>);
}}}
The edit list would look like.
* All shapes
* Thumbnail
* Medium
* Large
This is a different way to think. Please read the latest posts of
[http://www.w3.org/community/respimg/ Responsive Images Community Group]
if you don’t understand what I’m talking about. Maybe a new ticket is a
better place to discuss that way.
--
Ticket URL: <http://core.trac.wordpress.org/ticket/19889#comment:15>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software
More information about the wp-trac
mailing list