Add width / height to attachments in attachments.tpl
authorTim Düsterhus <duesterhus@woltlab.com>
Tue, 27 Apr 2021 14:16:56 +0000 (16:16 +0200)
committerTim Düsterhus <duesterhus@woltlab.com>
Tue, 27 Apr 2021 14:16:56 +0000 (16:16 +0200)
com.woltlab.wcf/templates/attachments.tpl

index 5faadfbfc36d59a89532f11a0f96f9b11fadebd7..6c89fd14971c30cbe15d7e03503c65653b926f30 100644 (file)
                                                                <div class="attachmentThumbnailContainer">
                                                                        <span class="attachmentThumbnailImage">
                                                                                {if $attachment->hasThumbnail()}
-                                                                                       <img src="{$attachment->getThumbnailLink('thumbnail')}" alt="" {if $attachment->thumbnailWidth >= ATTACHMENT_THUMBNAIL_WIDTH && $attachment->thumbnailHeight >= ATTACHMENT_THUMBNAIL_HEIGHT} class="attachmentThumbnailImageScalable"{/if}>
+                                                                                       <img
+                                                                                               src="{$attachment->getThumbnailLink('thumbnail')}"
+                                                                                               alt=""
+                                                                                               {if $attachment->thumbnailWidth >= ATTACHMENT_THUMBNAIL_WIDTH && $attachment->thumbnailHeight >= ATTACHMENT_THUMBNAIL_HEIGHT}
+                                                                                                       class="attachmentThumbnailImageScalable"
+                                                                                               {/if}
+                                                                                               width="{$attachment->thumbnailWidth}"
+                                                                                               height="{$attachment->thumbnailHeight}"
+                                                                                               loading="lazy"
+                                                                                       >
                                                                                {else}
-                                                                                       <img src="{$attachment->getLink()}" alt="" {if $attachment->width >= ATTACHMENT_THUMBNAIL_WIDTH && $attachment->height >= ATTACHMENT_THUMBNAIL_HEIGHT} class="attachmentThumbnailImageScalable"{/if}>
+                                                                                       <img
+                                                                                               src="{$attachment->getLink()}"
+                                                                                               alt=""
+                                                                                               {if $attachment->width >= ATTACHMENT_THUMBNAIL_WIDTH && $attachment->height >= ATTACHMENT_THUMBNAIL_HEIGHT}
+                                                                                                       class="attachmentThumbnailImageScalable"
+                                                                                               {/if}
+                                                                                               width="{$attachment->width}"
+                                                                                               height="{$attachment->height}"
+                                                                                               loading="lazy"
+                                                                                       >
                                                                                {/if}
                                                                        </span>