Generate WebP thumbnails even for builtin footprints

This commit is contained in:
Jan Böhmer 2023-04-01 18:43:57 +02:00
parent 4cb1313a77
commit 66c1eff79f
2 changed files with 3 additions and 6 deletions

View file

@ -16,7 +16,7 @@ liip_imagine:
thumbnail_md: thumbnail_md:
quality: 80 quality: 90
filters: filters:
thumbnail: thumbnail:
size: [250, 250] size: [250, 250]

View file

@ -149,11 +149,8 @@ class AttachmentURLGenerator
return $this->urlGenerator->generate('attachment_view', ['id' => $attachment->getID()]); return $this->urlGenerator->generate('attachment_view', ['id' => $attachment->getID()]);
} }
//For builtin resources it is not useful to create a thumbnail //GD can not work with SVG, so serve it directly...
//because the footprints images are small and highly optimized already. if ('svg' === $attachment->getExtension()) {
if (('thumbnail_md' === $filter_name && $attachment->isBuiltIn())
//GD can not work with SVG, so serve it directly...
|| 'svg' === $attachment->getExtension()) {
return $this->assets->getUrl($asset_path); return $this->assets->getUrl($asset_path);
} }