Project

General

Profile

Actions

Bug #64224

closed

GIFBUILDER with FAL and UTF-8 filesystem

Added by Peter Niederlag over 9 years ago. Updated over 6 years ago.

Status:
Closed
Priority:
Should have
Assignee:
-
Category:
File Abstraction Layer (FAL)
Target version:
Start date:
2015-01-09
Due date:
% Done:

100%

Estimated time:
TYPO3 Version:
6.2
PHP Version:
Tags:
Complexity:
Is Regression:
No
Sprint Focus:

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 2 (0 open2 closed)

Related to TYPO3 Core - Bug #65378: Scaling/cropping images in GIFBUILDER does not workClosed2015-02-27

Actions
Related to TYPO3 Core - Bug #67192: Problem with IMAGE object when image file name contains utf-8 diacriticsRejected2015-05-29

Actions
Actions #1

Updated by Peter Niederlag over 9 years ago

  • Subject changed from GIFBUILDE with FAL and UTF-8 filesystem to GIFBUILDER with FAL and UTF-8 filesystem
Actions #2

Updated by Peter Niederlag over 9 years ago

  • Category set to File Abstraction Layer (FAL)
Actions #3

Updated by Mathias Schreiber over 9 years ago

  • Target version set to 7.1 (Cleanup)
  • Sprint Focus set to On Location Sprint
Actions #4

Updated by Markus Klein over 9 years 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.

Actions #5

Updated by Peter Niederlag over 9 years 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?

Actions #6

Updated by Frans Saris over 9 years ago

For processing a file use getForLocalProcessing() and not getPublicUrl().

Actions #7

Updated by Torben Hansen over 9 years 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?

Actions #8

Updated by Peter Niederlag over 9 years 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.

Actions #9

Updated by Gerrit Code Review over 9 years 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

Actions #10

Updated by Gerrit Code Review over 9 years 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

Actions #11

Updated by Gerrit Code Review over 9 years 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

Actions #12

Updated by Torben Hansen over 9 years ago

  • Status changed from Under Review to Resolved
  • % Done changed from 0 to 100
Actions #13

Updated by Anja Leichsenring over 8 years ago

  • Sprint Focus deleted (On Location Sprint)
Actions #14

Updated by Riccardo De Contardi over 6 years ago

  • Status changed from Resolved to Closed
Actions

Also available in: Atom PDF