Skip to content

Commit

Permalink
[BUGFIX] Handle array access in LocalImageProcessor
Browse files Browse the repository at this point in the history
Handle missing image dimensions (width, height)
without throwing an exception.

In same cases, image dimension may not be able to be
set properly.

Resolves: #99406
Releases: main, 11.5
Change-Id: I81124dcaf29932448a87b69ab5bf6445eeb7469c
Reviewed-on: https://review.typo3.org/c/Packages/TYPO3.CMS/+/77844
Reviewed-by: Stefan Bürk <stefan@buerk.tech>
Reviewed-by: Oliver Klee <typo3-coding@oliverklee.de>
Tested-by: core-ci <typo3@b13.com>
Reviewed-by: Christian Kuhn <lolli@schwarzbu.ch>
Tested-by: Stefan Bürk <stefan@buerk.tech>
Tested-by: Christian Kuhn <lolli@schwarzbu.ch>
  • Loading branch information
sypets authored and sbuerk committed Feb 13, 2023
1 parent 8587306 commit 66d3625
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -114,8 +114,8 @@ protected function checkForExistingTargetFile(TaskInterface $task)
$task->setExecuted(true);
$imageDimensions = $this->getGraphicalFunctionsObject()->getImageDimensions($localProcessedFile);
$properties = [
'width' => $imageDimensions[0],
'height' => $imageDimensions[1],
'width' => $imageDimensions[0] ?? 0,
'height' => $imageDimensions[1] ?? 0,
'size' => filesize($localProcessedFile),
'checksum' => $task->getConfigurationChecksum(),
];
Expand Down

0 comments on commit 66d3625

Please sign in to comment.