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 <josh.t.richards@gmail.com>
  • Loading branch information
joshtrichards authored and artonge committed Jul 8, 2024
1 parent 1828dea commit c2cb7cc
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 c2cb7cc

Please sign in to comment.