﻿id	summary	reporter	owner	description	type	status	priority	milestone	component	version	severity	resolution	keywords	cc
15989	image_resize_dimensions() mistakenly defaults crop center as image's center of gravity.	jacof	nacin	"WordPress add_image_size() routine calls ultimately for image_resize_dimensions(), which calculates the cropped image dimensions. (http://core.trac.wordpress.org/browser/tags/3.0.3/wp-includes/media.php#L333)

The function assumes that the cropping center is always the gravity center of the image, whereas the user must be able to select where and how the cropping will be made.

{{{
$s_x = floor( ($orig_w - $crop_w) / 2 );
$s_y = floor( ($orig_h - $crop_h) / 2 );
}}}

Due to this, custom thumbnails result cropped around wrong centers.

WordPress' Editor inside the Multimedia dialog doesn't affect post thumbnails defined by the user's theme, but only the thumbnails defined in the admin, as it doesn't regenerate them after rescaling the image. A temporary fix is regenerating all of the thumbnails using a third party plugin (""Regenerate Post Thumbnails""). This temporary fix generates (#Thumbs)*(#Images)*(#Resizes)+(#Images) in the Server, which is over demanding. 
 
Fixing the Wordpress Editor to affect post-thumbnails (as it should) would not be a proper fix, since the user must not be constrained to reducing the dimensions of his/her image as a whole in order to produce a correct thumbnail. 

The two solutions feasable for this are:

1- Correct the Wordpress Multimedia Editor to regenerate thumbnails after rescaling the image (short-term).

2- Modify image_resize_dimensions() to accept optional $x=0, $y=0 and allowing, ultimately, the selection of those values in the Multimedia Editor by the user, for each image, and for each thumbnail. 
"	defect (bug)	closed	normal	3.4	Post Thumbnails	3.1	major	fixed	has-patch commit	jacof scott@… gabriel.koen@… matt@… ben@…
