From 8b586a622e78017c86c824b443f60d0b14437033 Mon Sep 17 00:00:00 2001 From: brettp Date: Thu, 21 Jan 2010 16:17:58 +0000 Subject: Fixing bug in resizing function that would incorrectly attempt to crop a picture that was smaller than the target image. git-svn-id: http://code.elgg.org/elgg/trunk@3824 36083f99-b078-4883-b0ff-0f9b5a30f544 --- engine/lib/filestore.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'engine/lib/filestore.php') diff --git a/engine/lib/filestore.php b/engine/lib/filestore.php index 4627c93f0..f0b3baa4c 100644 --- a/engine/lib/filestore.php +++ b/engine/lib/filestore.php @@ -888,8 +888,10 @@ function get_resized_image_from_existing_file($input_name, $maxwidth, $maxheight } elseif ($width < $new_width) { $ratio = $new_height / $height; } - $region_height = $new_height = floor($height * $ratio); - $region_width = $new_width = floor($width * $ratio); + $region_height = $height; + $region_width = $width; + $new_height = floor($height * $ratio); + $new_width = floor($width * $ratio); } // load original image -- cgit v1.2.3