feat: replace tv show icon

This commit is contained in:
2023-08-09 13:32:28 +02:00
parent fb96e9f71a
commit 95525406d1
11 changed files with 36 additions and 37 deletions

View File

@ -23,7 +23,7 @@ type ImageParams = {
const log = createLogger("api/image");
async function getRemoteImage(image: string) {
log.debug("[api/image] fetching", { image });
log.debug("fetching", { image });
const sourceRes = await fetch(image);
if (!sourceRes.ok) {
return "Error retrieving image from URL.";
@ -68,6 +68,10 @@ function modifyImage(
format = MagickFormat.Webp;
}
if (params.mediaType === "image/png") {
format = MagickFormat.Png;
}
ImageMagick.read(imageBuffer, format, (image) => {
const sizingData = getWidthHeight(image, params);
if (params.mode === "resize") {