Commit c9e22a8f authored by Georg Ringer's avatar Georg Ringer Committed by Anja Leichsenring
Browse files

[BUGFIX] Use correct maximum width/height for media preview

Smaller images must not be blown up in visual size if smaller than
400x590px.

Resolves: #94475
Releases: master, 10.4
Change-Id: I8ef7e084a55d41778d6a71ff50cdc3125bcb176f
Reviewed-on: https://review.typo3.org/c/Packages/TYPO3.CMS/+/69909

Tested-by: core-ci's avatarcore-ci <typo3@b13.com>
Tested-by: default avatarGuido Schmechel <guido.schmechel@brandung.de>
Tested-by: Daniel Haupt's avatarDaniel Haupt <mail@danielhaupt.de>
Tested-by: Anja Leichsenring's avatarAnja Leichsenring <aleichsenring@ab-softlab.de>
Reviewed-by: default avatarGuido Schmechel <guido.schmechel@brandung.de>
Reviewed-by: Daniel Haupt's avatarDaniel Haupt <mail@danielhaupt.de>
Reviewed-by: Anja Leichsenring's avatarAnja Leichsenring <aleichsenring@ab-softlab.de>
parent 5c8d0397
......@@ -316,8 +316,8 @@ class ElementInformationController
$fileRenderer = $rendererRegistry->getRenderer($this->fileObject);
$preview['url'] = PathUtility::getAbsoluteWebPath($this->fileObject->getPublicUrl() ?? '');
$width = '590m';
$height = '400m';
$width = min(590, $this->fileObject->getMetaData()['width'] ?? 590) . 'm';
$height = min(400, $this->fileObject->getMetaData()['height'] ?? 400) . 'm';
// Check if there is a FileRenderer
if ($fileRenderer !== null) {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment