aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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