Bug #93407
closedNo thumbnail generation of .pdf in filelist if not present in [GFX][imagefile_ext]
0%
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
Updated by Christoph Lehmann over 3 years ago
You can restrict possible file extensions per field and content element in TCA, see:
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.
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]?
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 :-)
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.