summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--modules/gallery/models/item.php10
1 files changed, 5 insertions, 5 deletions
diff --git a/modules/gallery/models/item.php b/modules/gallery/models/item.php
index 07f781d1..d16a5dc4 100644
--- a/modules/gallery/models/item.php
+++ b/modules/gallery/models/item.php
@@ -628,7 +628,7 @@ class Item_Model_Core extends ORM_MPTT {
list ($height, $width) = $this->scale_dimensions($max);
if ($center_vertically && $max) {
// The constant is divide by 2 to calculate the file and 10 to convert to em
- $margin_top = ($max - $height) / 20;
+ $margin_top = (int)(($max - $height) / 20);
$extra_attrs["style"] = "margin-top: {$margin_top}em";
$extra_attrs["title"] = $this->title;
}
@@ -656,10 +656,10 @@ class Item_Model_Core extends ORM_MPTT {
if ($height) {
if (isset($max)) {
if ($width > $height) {
- $height = (int)($max * ($height / $width));
+ $height = (int)($max * $height / $width);
$width = $max;
} else {
- $width = (int)($max * ($width / $height));
+ $width = (int)($max * $width / $height);
$height = $max;
}
}
@@ -700,10 +700,10 @@ class Item_Model_Core extends ORM_MPTT {
$height = $this->height;
if ($width > $max_size || $height > $max_size) {
if ($width > $height) {
- $height *= $max_size / $width;
+ $height = (int)($height * $max_size / $width);
$width = $max_size;
} else {
- $width *= $max_size / $height;
+ $width = (int)($width * $max_size / $height);
$height = $max_size;
}
}