Project

General

Profile

Actions

Bug #93407

closed

No thumbnail generation of .pdf in filelist if not present in [GFX][imagefile_ext]

Added by Claus Harup over 3 years ago. Updated almost 3 years ago.

Status:
Closed
Priority:
Should have
Assignee:
-
Category:
Image Generation / GIFBUILDER
Target version:
Start date:
2021-02-02
Due date:
% Done:

0%

Estimated time:
TYPO3 Version:
9
PHP Version:
7.4
Tags:
Complexity:
Is Regression:
Sprint Focus:

Description

If I do not want my clients to choose .pdf documents as images in i.e. "text with image" I simply remove .pdf from [GFX][imagefile_ext] - that works!!!
But the negative side effect is that there will be no thumbnail generation of .pdf files in the filelist - see attached image :-(


Files

Screenshot 2021-02-02 092948.png (15.2 KB) Screenshot 2021-02-02 092948.png Claus Harup, 2021-02-02 08:29
Actions #1

Updated by Christoph Lehmann over 3 years ago

You can restrict possible file extensions per field and content element in TCA, see:

https://docs.typo3.org/m/typo3/reference-coreapi/master/en-us/ApiOverview/Fal/UsingFal/Tca.html#tca-definition

There you can replace $GLOBALS['TYPO3_CONF_VARS']['GFX']['imagefile_ext'] with your list of allowed file extensions.


[GFX][imagefile_ext] is the central setting which defines which file extensions are images file extensions and thus which files can be used for thumbnail generation, etc.

Actions #2

Updated by Claus Harup over 3 years ago

I know I can restrict file extensions, but i.e. $GLOBALS['TCA']['tt_content']['image']['config'] is using [GFX][imagefile_ext] and that 's core generated....
Wouldn't it be smart to simply add the .pdf extension to the thumbnail generation regardless of the content of [GFX][imagefile_ext]?

Actions #3

Updated by Claus Harup over 3 years ago

Update:

I added this to AdditionalConfiguration.php

if (TYPO3_MODE === 'BE') {
    /*
     * This is done due to the fact that if ['GFX']['imagefile_ext'] does not contain 'pdf' no thumbnail generation
     * for pdf files is carried out...
     */

    $addExtension = 'pdf';

    if (!GeneralUtility::inList($GLOBALS['TYPO3_CONF_VARS']['GFX']['imagefile_ext'], $addExtension)) {
        $GLOBALS['TYPO3_CONF_VARS']['GFX']['imagefile_ext'] .= ',' . $addExtension;
    }
}

.... it works like a charm :-)

Actions #4

Updated by Oliver Bartsch almost 3 years ago

  • Status changed from New to Closed

Hi, I'm a bit curios since pdf is defined by default, see https://github.com/TYPO3/TYPO3.CMS/blob/v9.5.27/typo3/sysext/core/Configuration/DefaultConfiguration.php#L29. However, since you've already solved it for you and nobody else is reporting similar problems here, I'll close this issue now. If you think this is the wrong decision or experience the issue again, please either reopen it or create a new issue, referencing this one.

Actions

Also available in: Atom PDF