Project

General

Profile

Actions

Bug #79301

closed

GIFBUILDER generates too long file names

Added by Thomas Oliver Moll almost 8 years ago. Updated about 6 years ago.

Status:
Closed
Priority:
Should have
Assignee:
-
Category:
-
Target version:
-
Start date:
2017-01-12
Due date:
% Done:

100%

Estimated time:
0.10 h
TYPO3 Version:
7
PHP Version:
7.0
Tags:
Complexity:
no-brainer
Is Regression:
Yes
Sprint Focus:

Description

Hi,

in commit [[https://github.com/TYPO3/TYPO3.CMS/commit/94e915fee3db6df4c43418d378101b400a113b69]] the generation for GIFBUILDER filenames was changed.

The Comment states, that the filePrefix should be limited to 100 characters.
The review [[https://review.typo3.org/#/c/34015/]] notices this but wants the comment to be removed.

I have a complicated GIFBULDER setup with lots of layers that are turned on and of by if statements.
Even the switched-off layers get serialized and produce a really long filename that can not be handled.

A simple modification of fileName() in GifBuilder.php does the Trick:

  public function fileName($pre)
    {
        /** @var $basicFileFunctions \TYPO3\CMS\Core\Utility\File\BasicFileUtility */
        $basicFileFunctions = GeneralUtility::makeInstance(BasicFileUtility::class);
        $filePrefix = implode('_', array_merge($this->combinedTextStrings, $this->combinedFileNames));
        $filePrefix = $basicFileFunctions->cleanFileName($filePrefix);

        /* shorten Prefix to avoid too long filenames */
        $filePrefix = substr($filePrefix,0,100);

        return $this->tempPath . $pre . $filePrefix . '_' . GeneralUtility::shortMD5(serialize($this->setup)) . '.' . $this->extension();
    }

IMHO, there should be an Option to set the Filename via TS. Or better to choose the filestore where it is stored.
I have TYPO3s with many websites in it. For every site there is a filestore. But when I annotate images via GIFBUILDER all the Images go into one directory (typo3temp) and not to the _processed folder of the filestore of the imagage that is annotated.

Actions

Also available in: Atom PDF