Project

General

Profile

Actions

Bug #95695

closed

Uncatched Exception in image size detection

Added by Alexander Stehlik over 2 years ago. Updated over 1 year ago.

Status:
Closed
Priority:
Should have
Assignee:
-
Category:
File Abstraction Layer (FAL)
Target version:
-
Start date:
2021-10-19
Due date:
% Done:

100%

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

Description

When editors upload files with invalid Extensions or the mime type can not be correctly detected an Exception occurs when the file is (re-)indexed:

#0 TYPO3\CMS\Core\Imaging\ImageMagickFile->resolvePrefix()
#1 TYPO3\CMS\Core\Imaging\ImageMagickFile->__construct('/var/www/typo3-...', 0)
#2 TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('TYPO3\\CMS\\Core\\...', '/var/www/typo3-...', 0)
#3 TYPO3\CMS\Core\Imaging\ImageMagickFile::fromFilePath('/var/www/typo3-...', 0)
#4 TYPO3\CMS\Core\Imaging\GraphicalFunctions->executeIdentifyCommandForImageFile('/var/www/typo3-...')
#5 TYPO3\CMS\Core\Imaging\GraphicalFunctions->imageMagickIdentify('/var/www/typo3-...')
#6 TYPO3\CMS\Core\Type\File\ImageInfo->getImageSizes()
#7 TYPO3\CMS\Core\Type\File\ImageInfo->getWidth()
#8 TYPO3\CMS\Core\Resource\Index\Indexer->extractRequiredMetaData(Object(TYPO3\CMS\Core\Resource\File))
#9 TYPO3\CMS\Core\Resource\Index\Indexer->updateIndexEntry(Object(TYPO3\CMS\Core\Resource\File))
...

This can be problematic if a folder is moved / copied because the indexing is aborted as soon as the index entry of the invalid file is processed. This might lead to an inconsistent index state.

Two examples found so far in a larger file base:

  • an HTML file was uploaded with a .pdf ending
  • another PDF had a mime type of application/octet-stream instead of application/pdf
Actions

Also available in: Atom PDF