MDL-81256 lib: fix rounding of thumbnail image size

This commit is contained in:
Marina Glancy
2024-04-08 10:02:07 +01:00
parent c0038b965e
commit 151edb5949
2 changed files with 6 additions and 6 deletions
+2 -2
View File
@@ -359,8 +359,8 @@ function resize_image_from_image($original, $imageinfo, $width, $height, $forcec
}
if ($ratio < 1) {
$targetwidth = floor($originalwidth * $ratio);
$targetheight = floor($originalheight * $ratio);
$targetwidth = round($originalwidth * $ratio);
$targetheight = round($originalheight * $ratio);
} else {
// Do not enlarge the original file if it is smaller than the requested thumbnail size.
$targetwidth = $originalwidth;