Fix the scale image check in image editor, fixes #11473 for trunk

git-svn-id: http://svn.automattic.com/wordpress/trunk@12446 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
azaozz 2009-12-18 09:52:32 +00:00
parent 29f3124366
commit fc1e6f8f72
1 changed files with 2 additions and 1 deletions

View File

@ -509,7 +509,8 @@ function wp_save_image($post_id) {
$sY = imagesy($img);
// check if it has roughly the same w / h ratio
if ( round($sX / $sY, 2) == round($fwidth / $fheight, 2) ) {
$diff = round($sX / $sY, 2) - round($fwidth / $fheight, 2);
if ( -0.1 < $diff && $diff < 0.1 ) {
// scale the full size image
$dst = wp_imagecreatetruecolor($fwidth, $fheight);
if ( imagecopyresampled( $dst, $img, 0, 0, 0, 0, $fwidth, $fheight, $sX, $sY ) ) {