diff options
| author | Jake Mannens <jake@asger.xyz> | 2023-08-29 15:47:37 +1000 |
|---|---|---|
| committer | Jake Mannens <jake@asger.xyz> | 2023-08-29 15:47:37 +1000 |
| commit | cb8c17917d0363f09eeaa3c379617dc213b2dacf (patch) | |
| tree | 9c3c1c15cb6925b31fb9ef3eb93b66fb9e02a5ac /Pages | |
| parent | d3b8abea30cda6127e9318f7762df175d5f6d459 (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 e5b1e7b..a582c02 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> } |
