diff --git a/src/helpers/image.ts b/src/helpers/image.ts index c0accc7..abd7241 100644 --- a/src/helpers/image.ts +++ b/src/helpers/image.ts @@ -9,7 +9,7 @@ async function getSharp(): Promise { return s; } -export async function generateThumbHash(image: { width: number, height: number }) { +export async function generateThumbHash(image: ImageMetadata) { const sharp = await getSharp(); if (!sharp) return; @@ -20,7 +20,6 @@ export async function generateThumbHash(image: { width: number, height: number } const smallHeight = Math.floor(image.height * scaleFactor); try { - //@ts-ignore const smallImg = await sharp(image.fsPath) .resize(smallWidth, smallHeight) @@ -32,7 +31,8 @@ export async function generateThumbHash(image: { width: number, height: number } const buffer = rgbaToThumbHash(smallWidth, smallHeight, smallImg); return Buffer.from(buffer).toString("base64"); } catch (error) { - console.log("Could not generate thumbhash", error) + //@ts-ignore + console.log(`Could not generate thumbhash for ${image.fsPath}`, error) return undefined }