Skip to content

Commit

Permalink
Merge pull request #105 from chialab/use-gif-in-thumbhelper
Browse files Browse the repository at this point in the history
MediaUrl when stream is a gif
  • Loading branch information
nicolocarpignoli authored Nov 27, 2024
2 parents 4d036b3 + 25ae3ba commit fd16a0e
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/View/Helper/ThumbHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,10 @@ public function url(ObjectEntity|null $object, array|string $thumbOptions = 'def

$stream = $this->Media->getStream($media);
if ($stream !== null) {
if ($stream?->mime_type === 'image/gif') {
return $media->get('media_url');
}

$res = Thumbnail::get($stream, $thumbOptions);
if (!empty($res['url']) && (!empty($res['ready']) || $allowPending)) {
return $res['url'];
Expand Down

0 comments on commit fd16a0e

Please sign in to comment.