From fc1e6f8f7254ff3746ef7d1c0767b08d06375218 Mon Sep 17 00:00:00 2001 From: azaozz Date: Fri, 18 Dec 2009 09:52:32 +0000 Subject: [PATCH] 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 --- wp-admin/includes/image-edit.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/wp-admin/includes/image-edit.php b/wp-admin/includes/image-edit.php index 3305dd499d..b15575ae3d 100644 --- a/wp-admin/includes/image-edit.php +++ b/wp-admin/includes/image-edit.php @@ -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 ) ) {