Fix BLOB JPG preview thumbnail

Signed-off-by: Florian Schirmer <jolt@tuxbox.org>
This commit is contained in:
Florian Schirmer 2021-01-21 14:28:25 +01:00 committed by William Desportes
parent e0d6d1d7bd
commit fec6d65d96
No known key found for this signature in database
GPG Key ID: 90A0EF1B8251A889

View File

@ -24,6 +24,7 @@ use function imagesx;
use function imagesy;
use function in_array;
use function intval;
use function round;
use function str_replace;
use function stripos;
use function substr;
@ -194,11 +195,11 @@ class TransformationWrapperController extends AbstractController
$ratioHeight = $srcHeight / $_REQUEST['newHeight'];
if ($ratioWidth < $ratioHeight) {
$destWidth = $srcWidth / $ratioHeight;
$destHeight = $_REQUEST['newHeight'];
$destWidth = intval(round($srcWidth / $ratioHeight));
$destHeight = intval($_REQUEST['newHeight']);
} else {
$destWidth = $_REQUEST['newWidth'];
$destHeight = $srcHeight / $ratioWidth;
$destWidth = intval($_REQUEST['newWidth']);
$destHeight = intval(round($srcHeight / $ratioWidth));
}
if ($_REQUEST['resize']) {