diff options
| author | Jake Mannens <jake@asger.xyz> | 2023-08-29 15:47:37 +1000 |
|---|---|---|
| committer | Jake Mannens <jake@asger.xyz> | 2025-08-20 00:48:44 +1000 |
| commit | 98053c0fc6e27998ccb8e0ad75900d2b48d6f70e (patch) | |
| tree | b552085007432de023e8f24a0d7417aa17a5bd48 /Pages | |
| parent | d4f0eae4dc54f356f296ff26aba006e69d21ec0b (diff) | |
Moved thumbnail generation from media controller to media service
Diffstat (limited to 'Pages')
| -rw-r--r-- | Pages/Gallery.razor | 5 |
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> } |
