Skip to content

Commit

Permalink
fix(asset-server-plugin): Better handling of malformed images
Browse files Browse the repository at this point in the history
Fixes #2275
  • Loading branch information
michaelbromley committed Jul 11, 2023
1 parent 2f336a7 commit 593e0e2
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ export class SharpAssetPreviewStrategy implements AssetPreviewStrategy {

if (assetType === AssetType.IMAGE) {
try {
const image = sharp(data).rotate();
const image = sharp(data, { failOn: 'truncated' }).rotate();
const metadata = await image.metadata();
const width = metadata.width || 0;
const height = metadata.height || 0;
Expand Down

0 comments on commit 593e0e2

Please sign in to comment.