Skip to content

Commit 4f2a913

Browse files
committed
fix(backend:common): prevent errors on invalid image metadata with failOn: 'none' option in sharp
1 parent 8ac40cd commit 4f2a913

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

backend/src/common/image.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ let textToSvgCache: Promise<TextToSVG> | null = null
2727

2828
export async function generateThumbnail(filePath: string, size: number): Promise<Readable> {
2929
return sharp(filePath, {
30+
failOn: 'none',
3031
sequentialRead: true, // sequential read = more efficient I/O
3132
limitInputPixels: 268e6 // protects against extremely large images
3233
})

0 commit comments

Comments
 (0)