Skip to content

Commit

Permalink
fix(icons): retry icon resize after failure
Browse files Browse the repository at this point in the history
  • Loading branch information
jeabakker committed Oct 10, 2023
1 parent 22625d7 commit e04e396
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions engine/classes/Elgg/EntityIconService.php
Expand Up @@ -401,6 +401,12 @@ protected function generateIcon(\ElggEntity $entity, \ElggFile $file, $type = 'i
if (!_elgg_services()->imageService->resize($source, $destination, $resize_params)) {
$this->getLogger()->error("Failed to create {$size} icon from
{$file->getFilenameOnFilestore()} with coords [{$x1}, {$y1}],[{$x2}, {$y2}]");

if ($size !== 'master') {
// remove 0 byte icon in order to retry the resize on the next request
$icon->delete();
}

return false;
}
}
Expand Down

0 comments on commit e04e396

Please sign in to comment.