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:
parent
29f3124366
commit
fc1e6f8f72
|
@ -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 ) ) {
|
||||
|
|
Loading…
Reference in New Issue