From 1e78fa418045c763b61a996fb5e3f418ce2e815d Mon Sep 17 00:00:00 2001 From: Xylight Date: Sat, 6 Jul 2024 11:23:18 -0700 Subject: [PATCH] misc: double image size --- src/lib/components/lemmy/post/helpers.ts | 10 +++++----- src/lib/components/lemmy/post/media/PostMedia.svelte | 4 ++-- src/lib/components/ui/Avatar.svelte | 2 +- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/lib/components/lemmy/post/helpers.ts b/src/lib/components/lemmy/post/helpers.ts index 0d5c59e6..46c131c7 100644 --- a/src/lib/components/lemmy/post/helpers.ts +++ b/src/lib/components/lemmy/post/helpers.ts @@ -18,12 +18,12 @@ export const bestImageURL = ( } if (compact && post.thumbnail_url) - return `${post.thumbnail_url}?thumbnail=256&format=webp` - else if (compact && post.url) return `${post.url}?thumbnail=256&format=webp` + return `${post.thumbnail_url}?thumbnail=512&format=webp` + else if (compact && post.url) return `${post.url}?thumbnail=512&format=webp` - if (post.url) return `${post.url}?thumbnail=${width}&format=webp` + if (post.url) return `${post.url}?thumbnail=${width * 2}&format=webp` else if (post.thumbnail_url) - return `${post.thumbnail_url}?thumbnail=${width}&format=webp` + return `${post.thumbnail_url}?thumbnail=${width * 2}&format=webp` return post.url ?? '' } @@ -37,7 +37,7 @@ export const optimizeImageURL = ( url.searchParams.append('format', 'webp') url.searchParams.append( 'thumbnail', - findClosestNumber([128, 256, 512, 1024], width).toString() + findClosestNumber([128, 256, 512, 1024], width * 2).toString() ) return url.toString() } catch (e) { diff --git a/src/lib/components/lemmy/post/media/PostMedia.svelte b/src/lib/components/lemmy/post/media/PostMedia.svelte index a29cf36e..1635626f 100644 --- a/src/lib/components/lemmy/post/media/PostMedia.svelte +++ b/src/lib/components/lemmy/post/media/PostMedia.svelte @@ -45,9 +45,9 @@ >