Skip to content

Commit

Permalink
fix: avoid erroring out on corrupt image data
Browse files Browse the repository at this point in the history
Signed-off-by: Josh Richards <[email protected]>
  • Loading branch information
joshtrichards authored and artonge committed Jul 8, 2024
1 parent 1c71990 commit 5d40c0c
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lib/Listener/SizeMetadataProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -61,9 +61,10 @@ public function handle(Event $event): void {
return;
}

$size = getimagesizefromstring($node->getContent());
$size = @getimagesizefromstring($node->getContent());

if ($size === false) {
$this->logger->debug('SizeMetadataProvider->handle(): Corrupt image data detected ' . $node->getPath());
return;
}

Expand Down

0 comments on commit 5d40c0c

Please sign in to comment.