From c3d2390c0d90fa011c6a14f01951006c68936a1c Mon Sep 17 00:00:00 2001 From: Tim Weisenberger Date: Fri, 12 Jul 2024 08:56:48 +0200 Subject: [PATCH] fix: Ensure print-request is always evaluated --- Classes/ViewHelpers/PictureViewHelper.php | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/Classes/ViewHelpers/PictureViewHelper.php b/Classes/ViewHelpers/PictureViewHelper.php index cfd700b..239b4af 100644 --- a/Classes/ViewHelpers/PictureViewHelper.php +++ b/Classes/ViewHelpers/PictureViewHelper.php @@ -29,8 +29,6 @@ */ class PictureViewHelper extends AbstractTagBasedViewHelper { - private const MAX_INLINE_IMAGE_SIZE = 50000; // 5KB - /** * @var string */ @@ -180,14 +178,14 @@ private function getImgTag(FileInterface $image): string $tag->addAttribute('title', $this->getImageTitle($image)); $tag->addAttribute('src', $processedImageUri); - if ($this->arguments['lazy']) { - $tag->addAttribute('loading', 'lazy'); - $tag->addAttribute('decoding', 'async'); - $tag->addAttribute('fetchpriority', 'low'); - } elseif ($this->isPrintRequest() || $this->arguments['eager']) { + if ($this->isPrintRequest() || $this->arguments['eager']) { $tag->addAttribute('loading', 'eger'); $tag->addAttribute('fetchpriority', 'high'); $tag->removeAttribute('decoding'); + } elseif ($this->arguments['lazy']) { + $tag->addAttribute('loading', 'lazy'); + $tag->addAttribute('decoding', 'async'); + $tag->addAttribute('fetchpriority', 'low'); } return $tag->render();