Bug #64224
GIFBUILDER with FAL and UTF-8 filesystem
Status: | Resolved | Start date: | 2015-01-09 | |
---|---|---|---|---|
Priority: | Should have | Due date: | ||
Assigned To: | - | % Done: | 100% |
|
Category: | File Abstraction Layer (FAL) | Spent time: | - | |
Target version: | 7.1 (Cleanup) | |||
TYPO3 Version: | 6.2 | Is Regression: | No | |
PHP Version: | Sprint Focus: | On Location Sprint | ||
Complexity: |
Description
given is a file "wärme.png"
given is the file is used in a content element via a file refernce (FAL)
given is a TypoScript setup to render the image via a GIFBUILDER Object
then I see a broken image rendered as the filename is not processed correctly
ContentObjectRender->getImgResource() does return '$processedFileObject->getPublicUrl()' inside the imgResource of the processdFile which is rawurlencoded().
This patch/change cures the problem by adding an extra rawurldecod() inside the GifBuilder. Does not feel like the proper solution and I will see if it breaks anywhere else for some time.
iff --git a/typo3/sysext/frontend/Classes/Imaging/GifBuilder.php b/typo3/sysext/frontend/Classes/Imaging/GifBuilder.php index 9d13e6c..306b676 100644 --- a/typo3/sysext/frontend/Classes/Imaging/GifBuilder.php +++ b/typo3/sysext/frontend/Classes/Imaging/GifBuilder.php @@ -206,7 +206,7 @@ class GifBuilder extends \TYPO3\CMS\Core\Imaging\GraphicalFunctions { $fileInfo = $this->getResource($conf['file'], $conf['file.']); if ($fileInfo) { $this->combinedFileNames[] = preg_replace('/\\.[[:alnum:]]+$/', '', basename($fileInfo[3])); - $this->setup[$theKey . '.']['file'] = $fileInfo[3]; + $this->setup[$theKey . '.']['file'] = rawurldecode($fileInfo[3]); $this->setup[$theKey . '.']['BBOX'] = $fileInfo; $this->objBB[$theKey] = $fileInfo; if ($conf['mask']) {
Related issues
Associated revisions
[BUGFIX] Use getForLocalProcessing() for FAL images in GIFBUILDER
GIFBUILDER must use getForLocalProcessing() for FAL images, so
image processing is possible for files containing special
chars (e.g. umlauts) when using an UTF-8 filesystem.
Resolves: #64224
Releases: master, 6.2
Change-Id: Ib3b372ceea1afa839787c61a3f118b3f62f05dcc
Reviewed-on: http://review.typo3.org/36180
Reviewed-by: Frans Saris <franssaris@gmail.com>
Tested-by: Frans Saris <franssaris@gmail.com>
Reviewed-by: Benjamin Mack <benni@typo3.org>
Tested-by: Benjamin Mack <benni@typo3.org>
[BUGFIX] Use getForLocalProcessing() for FAL images in GIFBUILDER
GIFBUILDER must use getForLocalProcessing() for FAL images, so
image processing is possible for files containing special
chars (e.g. umlauts) when using an UTF-8 filesystem.
Resolves: #64224
Releases: master, 6.2
Change-Id: Ib3b372ceea1afa839787c61a3f118b3f62f05dcc
Reviewed-on: http://review.typo3.org/36180
Reviewed-by: Frans Saris <franssaris@gmail.com>
Tested-by: Frans Saris <franssaris@gmail.com>
Reviewed-by: Benjamin Mack <benni@typo3.org>
Tested-by: Benjamin Mack <benni@typo3.org>
(cherry picked from commit fd232edeab2c72a7bac582b454b8db6b788f017c)
Reviewed-on: http://review.typo3.org/36340
[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: Stephan Großberndt <stephan@grossberndt.de>
Tested-by: Stephan Großberndt <stephan@grossberndt.de>
Reviewed-by: Frans Saris <franssaris@gmail.com>
Tested-by: Stefan Froemken <froemken@gmail.com>
Tested-by: Christoph Lehmann <christoph.lehmann@networkteam.com>
Tested-by: Philipp Mueller <philipp.mueller@lavitto.ch>
Reviewed-by: Christian Kuhn <lolli@schwarzbu.ch>
Tested-by: Christian Kuhn <lolli@schwarzbu.ch>
[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/37533
Reviewed-by: Christian Kuhn <lolli@schwarzbu.ch>
Tested-by: Christian Kuhn <lolli@schwarzbu.ch>
History
#1 Updated by Peter Niederlag 7 months ago
- Subject changed from GIFBUILDE with FAL and UTF-8 filesystem to GIFBUILDER with FAL and UTF-8 filesystem
#2 Updated by Peter Niederlag 7 months ago
- Category set to File Abstraction Layer (FAL)
#3 Updated by Mathias Schreiber 7 months ago
- Target version set to 7.1 (Cleanup)
- Sprint Focus set to On Location Sprint
#4 Updated by Markus Klein 7 months ago
IMO using getPublicUrl() for internal further processing is just plain wrong. Does not work for protected storages I guess and will for sure not work if there's some other driver than the LocalDriver.
#5 Updated by Peter Niederlag 7 months ago
Markus Klein wrote:
IMO using getPublicUrl() for internal further processing is just plain wrong. Does not work for protected storages I guess and will for sure not work if there's some other driver than the LocalDriver.
I do very much agree, but what's the alternative? GifBuilder relies on ContentObjectRenderer->getImgResource(), that doesn't seem debatable to me. However this will add 'originalFile' in case of an fileObject so maybe GifBuilder should pick up on that on if it's available?
#6 Updated by Frans Saris 7 months ago
For processing a file use getForLocalProcessing() and not getPublicUrl().
#7 Updated by Torben Hansen 7 months ago
Frans Saris wrote:
For processing a file use getForLocalProcessing() and not getPublicUrl().
Using getForLocalProcessing() seems to work fine if we directly use it in GifBuilder
$this->setup[$theKey . '.']['file'] = $fileInfo['originalFile']->getForLocalProcessing();
Should there be a check to see, if $fileInfo['originalFile'] is really available?
#8 Updated by Peter Niederlag 7 months ago
Hi,
first of all, many thx for your initiative.
Torben Hansen wrote:
Frans Saris wrote:
For processing a file use getForLocalProcessing() and not getPublicUrl().
Using getForLocalProcessing() seems to work fine if we directly use it in GifBuilder
[...]
Should there be a check to see, if $fileInfo['originalFile'] is really available?
If GIFBUILDER can still work without FAL (which I think is true), then there must be a check if originalFile is available. Should not be to expensive and is just making this beast less error prone.
#9 Updated by Gerrit Code Review 6 months ago
- Status changed from New to Under Review
Patch set 1 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at http://review.typo3.org/36180
#10 Updated by Gerrit Code Review 6 months ago
Patch set 2 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at http://review.typo3.org/36180
#11 Updated by Gerrit Code Review 6 months ago
Patch set 1 for branch TYPO3_6-2 of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at http://review.typo3.org/36340
#12 Updated by Torben Hansen 6 months ago
- Status changed from Under Review to Resolved
- % Done changed from 0 to 100
Applied in changeset fd232edeab2c72a7bac582b454b8db6b788f017c.