misc: appropriately size images
This commit is contained in:
1 parent
ad3b9e5f36
commit
6bc3c0bd94
2 files changed
+5
-5
No files matched your search
@@ -21,9 +21,9 @@ export const bestImageURL = (
|
||||
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 * 2}&format=webp`
|
||||
if (post.url) return `${post.url}?thumbnail=${width}&format=webp`
|
||||
else if (post.thumbnail_url)
|
||||
return `${post.thumbnail_url}?thumbnail=${width * 2}&format=webp`
|
||||
return `${post.thumbnail_url}?thumbnail=${width}&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 * 2).toString()
|
||||
findClosestNumber([128, 256, 512, 728, 1024, 1536], width).toString()
|
||||
)
|
||||
return url.toString()
|
||||
} catch (e) {
|
||||
|
||||
Reference in new issue
Block a user