Bug #95695
closedUncatched Exception in image size detection
100%
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
Updated by Gerrit Code Review about 3 years ago
- Status changed from New to Under Review
Patch set 2 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/71881
Updated by Gerrit Code Review about 3 years ago
Patch set 3 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/71881
Updated by Gerrit Code Review about 3 years ago
Patch set 4 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/71881
Updated by Gerrit Code Review about 3 years ago
Patch set 5 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/71881
Updated by Alexander Stehlik about 3 years ago
- Status changed from Under Review to Resolved
- % Done changed from 0 to 100
Applied in changeset e00c3173f36dbe6a4e21ed61e1bc3053fa2c7b68.