This commit is contained in:
Sven Wappler 2020-12-21 13:13:42 +01:00
commit 269c7da0ce
2 changed files with 34 additions and 0 deletions

15
composer.json Normal file
View File

@ -0,0 +1,15 @@
{
"name": "wapplersystems/t3-patches",
"description" : "Patches for TYPO3 core",
"license": "GPL-2.0-or-later",
"require": {
"cweagans/composer-patches": "~1.0"
},
"extra": {
"patches": {
"typo3/cms-core": {
"Patch 1": "https://www.drupal.org/files/issues/add_a_startup-1543858-30.patch"
}
}
}
}

View File

@ -0,0 +1,19 @@
diff --git a/typo3/sysext/core/Classes/Imaging/GraphicalFunctions.php b/typo3/sysext/core/Classes/Imaging/GraphicalFunctions.php
index d7c4db4..d3621ce 100644
--- a/typo3/sysext/core/Classes/Imaging/GraphicalFunctions.php
+++ b/typo3/sysext/core/Classes/Imaging/GraphicalFunctions.php
@@ -2325,6 +2325,14 @@
*/
public function getImageScale($info, $w, $h, $options)
{
+ // Cropping may change the aspect ratio of the image.
+ // The image info is modified to represent the image size after cropping.
+ if (($options['crop'] ?? null) instanceof Area) {
+ /** @var Area $cropArea */
+ $cropArea = $options['crop'];
+ $info[0] = round($cropArea->getWidth());
+ $info[1] = round($cropArea->getHeight());
+ }
$out = [];
$max = strpos($w . $h, 'm') !== false ? 1 : 0;
if (strpos($w . $h, 'c') !== false) {