aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/includes/acp/acp_icons.php
diff options
context:
space:
mode:
Diffstat (limited to 'phpBB/includes/acp/acp_icons.php')
-rw-r--r--phpBB/includes/acp/acp_icons.php23
1 files changed, 23 insertions, 0 deletions
diff --git a/phpBB/includes/acp/acp_icons.php b/phpBB/includes/acp/acp_icons.php
index fa1e324cc6..8213c55ccb 100644
--- a/phpBB/includes/acp/acp_icons.php
+++ b/phpBB/includes/acp/acp_icons.php
@@ -89,6 +89,18 @@ class acp_icons
continue;
}
+ // adjust the width and height to be lower than 128px while perserving the aspect ratio
+ if ($img_size[0] > 127 && $img_size[0] > $img_size[1])
+ {
+ $img_size[1] = (int) ($img_size[1] * (127 / $img_size[0]));
+ $img_size[0] = 127;
+ }
+ else if ($img_size[1] > 127)
+ {
+ $img_size[0] = (int) ($img_size[0] * (127 / $img_size[1]));
+ $img_size[1] = 127;
+ }
+
$_images[$path . $img]['file'] = $path . $img;
$_images[$path . $img]['width'] = $img_size[0];
$_images[$path . $img]['height'] = $img_size[1];
@@ -388,6 +400,17 @@ class acp_icons
$image_height[$image] = $img_size[1];
}
+ if ($image_width[$image] > 127 && $image_width[$image] > $image_height[$image])
+ {
+ $image_height[$image] = (int) ($image_height[$image] * (127 / $image_width[$image]));
+ $image_width[$image] = 127;
+ }
+ else if ($image_height[$image] > 127)
+ {
+ $image_width[$image] = (int) ($image_width[$image] * (127 / $image_height[$image]));
+ $image_height[$image] = 127;
+ }
+
$img_sql = array(
$fields . '_url' => $image,
$fields . '_width' => $image_width[$image],