Skip to content

Commit

Permalink
Merge pull request #14480 from jeabakker/fixes-5
Browse files Browse the repository at this point in the history
fix(icons): retry icon resize after failure
  • Loading branch information
jdalsem committed Oct 10, 2023
2 parents 22625d7 + e04e396 commit 8b39eb7
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions engine/classes/Elgg/EntityIconService.php
Original file line number Diff line number Diff line change
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 8b39eb7

Please sign in to comment.