Skip to content

Sync-in · Sovereign platform for file storage, sharing, synchronization, and collaboration.

fix(backend:common): prevent errors on invalid image metadata with `failOn: 'none'` option in sharp

johaven901fdf8cf9ed
diff --git a/backend/src/common/image.ts b/backend/src/common/image.ts
index f17c2b14..850784b5 100644
--- a/backend/src/common/image.ts
+++ b/backend/src/common/image.ts
@@ -27,6 +27,7 @@ let textToSvgCache: Promise<TextToSVG> | null = null
export async function generateThumbnail(filePath: string, size: number): Promise<Readable> {
return sharp(filePath, {
+ failOn: 'none',
sequentialRead: true, // sequential read = more efficient I/O
limitInputPixels: 268e6 // protects against extremely large images
})