Shows the thumbnails a browser can't load from their own site: those on plain http, which an https page would block, and those behind hotlink protection. It fetches and caches the images GET /api/remote/image serves, which the frontend routes a thumbnail through when it is on http or when loading it directly failed, and scales them down as the site's own are.

Functions

f
clearImageCache(): void

Empties the cache, for the tests' reset between cases.

f
fetchProxiedImage(
url: string,
width?: ImageWidth | null
): Promise<ProxiedImage | null>

Returns the image at url, from the cache or else from its host; null when the host answers with an error, or with anything but a raster image of 5 MB at most. With width, it comes as a WebP copy scaled down to it, or as it is when no copy can be made (scalableImage, and ffmpeg). The route checks url with isValidHttpUrl first.

Interfaces

I
ProxiedImage

Returned to GET /api/remote/image by fetchProxiedImage, which sends it back under contentType.