summaryrefslogtreecommitdiff
path: root/Pages
diff options
context:
space:
mode:
authorJake Mannens <jake@asger.xyz>2023-08-29 15:47:37 +1000
committerJake Mannens <jake@asger.xyz>2025-08-20 00:48:44 +1000
commit98053c0fc6e27998ccb8e0ad75900d2b48d6f70e (patch)
treeb552085007432de023e8f24a0d7417aa17a5bd48 /Pages
parentd4f0eae4dc54f356f296ff26aba006e69d21ec0b (diff)
Moved thumbnail generation from media controller to media service
Diffstat (limited to 'Pages')
-rw-r--r--Pages/Gallery.razor5
1 files changed, 4 insertions, 1 deletions
diff --git a/Pages/Gallery.razor b/Pages/Gallery.razor
index 6b8e330..b94c694 100644
--- a/Pages/Gallery.razor
+++ b/Pages/Gallery.razor
@@ -11,8 +11,11 @@
<link rel="stylesheet" href="@(nameof(HyperBooru)).styles.css"/>
@foreach(var media in Media) {
+ // Precalculate thumbnail size to help the browser
+ // lay out the images during initial page load
+ int width = media.Width * 200 / media.Height;
<a href="/ViewMedia?m=@(media.Guid)">
- <img src="/media/thumb/@(media.Guid)?h=200" />
+ <img src="/media/thumb/@(media.Guid)?h=200" width=@width height="200"/>
</a>
}