[wp-trac] [WordPress Trac] #19393: Image crop position
WordPress Trac
wp-trac at lists.automattic.com
Tue Nov 29 18:46:06 UTC 2011
#19393: Image crop position
-------------------------+-----------------------------
Reporter: bradt | Owner:
Type: enhancement | Status: new
Priority: normal | Milestone: Awaiting Review
Component: Media | Version: 3.3
Severity: normal | Keywords:
-------------------------+-----------------------------
In WP, images are cropped to center horizontally and vertically. Setting a
different crop position is very painful and a bit of hack using
filters/hooks (see [https://gist.github.com/1405838]). The small attached
patch enhances the `$crop` parameter of `add_image_size`, allowing an
array to be passed in containing the crop position. For example,
{{{
add_image_size( 'product-screenshot', 300, 300, array( 'left', 'top' ) );
}}}
The `$crop` parameter still accepts true/false values and the patch should
be fully backward compatible. Syntax is borrowed from CSS' `background-
position` property, so it should be familiar to designers/developers.
--
Ticket URL: <http://core.trac.wordpress.org/ticket/19393>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software
More information about the wp-trac
mailing list