Skip to content
Snippets Groups Projects
Commit ef5f6cc8 authored by Torben Hansen's avatar Torben Hansen Committed by Christian Kuhn
Browse files

[BUGFIX] Regression when scaling/cropping in GIFBUILDER

The fix for issue #64224 introduced a regression in GIFBUILDER
resulting in problems with image scaling/cropping.

For $fileInfo and $maskInfo: use 'processedFile' for FAL files
if available and correctly distinguish between FAL- and non-FAL files
otherwise by checking for 'origFile'.

Resolves: #65378
Related: #64224
Releases: master, 6.2
Change-Id: Ib472bdcdc7f814e50ebd18e084f5fbe7d09fc410
Reviewed-on: http://review.typo3.org/37483


Reviewed-by: default avatarStephan Großberndt <stephan@grossberndt.de>
Tested-by: default avatarStephan Großberndt <stephan@grossberndt.de>
Reviewed-by: default avatarFrans Saris <franssaris@gmail.com>
Tested-by: default avatarStefan Froemken <froemken@gmail.com>
Tested-by: default avatarChristoph Lehmann <christoph.lehmann@networkteam.com>
Tested-by: default avatarPhilipp Mueller <philipp.mueller@lavitto.ch>
Reviewed-by: default avatarChristian Kuhn <lolli@schwarzbu.ch>
Tested-by: default avatarChristian Kuhn <lolli@schwarzbu.ch>
parent 9687a429
Branches
Tags
No related merge requests found
...@@ -217,9 +217,14 @@ class GifBuilder extends \TYPO3\CMS\Core\Imaging\GraphicalFunctions { ...@@ -217,9 +217,14 @@ class GifBuilder extends \TYPO3\CMS\Core\Imaging\GraphicalFunctions {
$fileInfo = $this->getResource($conf['file'], $conf['file.']); $fileInfo = $this->getResource($conf['file'], $conf['file.']);
if ($fileInfo) { if ($fileInfo) {
$this->combinedFileNames[] = preg_replace('/\\.[[:alnum:]]+$/', '', basename($fileInfo[3])); $this->combinedFileNames[] = preg_replace('/\\.[[:alnum:]]+$/', '', basename($fileInfo[3]));
if ($fileInfo['originalFile'] instanceof \TYPO3\CMS\Core\Resource\File) { if ($fileInfo['processedFile'] instanceof \TYPO3\CMS\Core\Resource\ProcessedFile) {
// Use processed file, if a FAL file has been processed by GIFBUILDER (e.g. scaled/cropped)
$this->setup[$theKey . '.']['file'] = $fileInfo['processedFile']->getForLocalProcessing(FALSE);
} elseif (!isset($fileInfo['origFile']) && $fileInfo['originalFile'] instanceof \TYPO3\CMS\Core\Resource\File) {
// Use FAL file with getForLocalProcessing to circumvent problems with umlauts, if it is a FAL file (origFile not set)
$this->setup[$theKey . '.']['file'] = $fileInfo['originalFile']->getForLocalProcessing(FALSE); $this->setup[$theKey . '.']['file'] = $fileInfo['originalFile']->getForLocalProcessing(FALSE);
} else { } else {
// Use normal path from fileInfo if it is a non-FAL file (even non-FAL files have originalFile set, but only non-FAL files have origFile set)
$this->setup[$theKey . '.']['file'] = $fileInfo[3]; $this->setup[$theKey . '.']['file'] = $fileInfo[3];
} }
$this->setup[$theKey . '.']['BBOX'] = $fileInfo; $this->setup[$theKey . '.']['BBOX'] = $fileInfo;
...@@ -227,7 +232,10 @@ class GifBuilder extends \TYPO3\CMS\Core\Imaging\GraphicalFunctions { ...@@ -227,7 +232,10 @@ class GifBuilder extends \TYPO3\CMS\Core\Imaging\GraphicalFunctions {
if ($conf['mask']) { if ($conf['mask']) {
$maskInfo = $this->getResource($conf['mask'], $conf['mask.']); $maskInfo = $this->getResource($conf['mask'], $conf['mask.']);
if ($maskInfo) { if ($maskInfo) {
if ($maskInfo['originalFile'] instanceof \TYPO3\CMS\Core\Resource\File) { // the same selection criteria as regarding fileInfo above apply here
if ($maskInfo['processedFile'] instanceof \TYPO3\CMS\Core\Resource\ProcessedFile) {
$this->setup[$theKey . '.']['mask'] = $maskInfo['processedFile']->getForLocalProcessing(FALSE);
} elseif (!isset($maskInfo['origFile']) && $maskInfo['originalFile'] instanceof \TYPO3\CMS\Core\Resource\File) {
$this->setup[$theKey . '.']['mask'] = $maskInfo['originalFile']->getForLocalProcessing(FALSE); $this->setup[$theKey . '.']['mask'] = $maskInfo['originalFile']->getForLocalProcessing(FALSE);
} else { } else {
$this->setup[$theKey . '.']['mask'] = $maskInfo[3]; $this->setup[$theKey . '.']['mask'] = $maskInfo[3];
......
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