fix(media-proxy): serve and request images on one size ladder (#1833)

This commit is contained in:
Hampus
2026-08-24 12:27:33 +02:00
committed by GitHub
parent 051985b767
commit 171dc7e5b7
4 changed files with 190 additions and 39 deletions
@@ -33,9 +33,13 @@ const MEDIA_PROXY_IMAGE_SIZE_QUERY_VALUES = [
'3072',
'4096',
'8192',
'12000',
'16384',
] as const;
export type MediaProxyImageSizeQueryValue = (typeof MEDIA_PROXY_IMAGE_SIZE_QUERY_VALUES)[number];
type ParseNumericLiteral<T extends string> = T extends `${infer N extends number}` ? N : never;
export type MediaProxyImageSize = ParseNumericLiteral<MediaProxyImageSizeQueryValue>;
export const MEDIA_PROXY_IMAGE_SIZES: ReadonlyArray<MediaProxyImageSize> = MEDIA_PROXY_IMAGE_SIZE_QUERY_VALUES.map(
(value) => Number(value) as MediaProxyImageSize,
);