aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorbrettp <brettp@36083f99-b078-4883-b0ff-0f9b5a30f544>2010-01-20 20:42:03 +0000
committerbrettp <brettp@36083f99-b078-4883-b0ff-0f9b5a30f544>2010-01-20 20:42:03 +0000
commite632ce4ad04df682c4ae8d18cfbaab5866260fc2 (patch)
tree7f65230f0cef832567b8fc1f6db8f0b40d3e85e0
parent1e762d4d4614ba98ee26da3f1862c8bf0464eb49 (diff)
downloadelgg-e632ce4ad04df682c4ae8d18cfbaab5866260fc2.tar.gz
elgg-e632ce4ad04df682c4ae8d18cfbaab5866260fc2.tar.bz2
Resetting cropping coords for images that can't be cropped in filestore.
git-svn-id: http://code.elgg.org/elgg/trunk@3816 36083f99-b078-4883-b0ff-0f9b5a30f544
-rw-r--r--engine/lib/filestore.php8
1 files changed, 5 insertions, 3 deletions
diff --git a/engine/lib/filestore.php b/engine/lib/filestore.php
index 9e114c262..4627c93f0 100644
--- a/engine/lib/filestore.php
+++ b/engine/lib/filestore.php
@@ -875,6 +875,9 @@ function get_resized_image_from_existing_file($input_name, $maxwidth, $maxheight
// Size checking should be done in action code, but for backward compatibility
// this duplicates the previous behavior.
if (!$upscale && ($height < $new_height || $width < $new_width)) {
+ // zero out offsets
+ $widthoffset = $heightoffset = 0;
+
// determine if we can scale it down at all
// (ie, if only one dimension is too small)
// if not, just use original size.
@@ -885,9 +888,8 @@ function get_resized_image_from_existing_file($input_name, $maxwidth, $maxheight
} elseif ($width < $new_width) {
$ratio = $new_height / $height;
}
-
- $new_height = floor($height * $ratio);
- $new_width = floor($width * $ratio);
+ $region_height = $new_height = floor($height * $ratio);
+ $region_width = $new_width = floor($width * $ratio);
}
// load original image