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 #1

Updated by Gerrit Code Review over 2 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

Actions #2

Updated by Gerrit Code Review over 2 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

Actions #3

Updated by Gerrit Code Review over 2 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

Actions #4

Updated by Gerrit Code Review over 2 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

Actions #5

Updated by Alexander Stehlik over 2 years ago

  • Status changed from Under Review to Resolved
  • % Done changed from 0 to 100
Actions #6

Updated by Benni Mack over 1 year ago

  • Status changed from Resolved to Closed
Actions

Also available in: Atom PDF