Skip to content

Commit 52cbe93

Browse files
committed
Use image size limits for animated images
1 parent b553b74 commit 52cbe93

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

app/support/media-files/process.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,12 +53,13 @@ export async function processMediaFile(
5353

5454
// Check the file size, if it is too big, throw an error
5555
{
56+
const type = info.type === 'video' && info.isAnimatedImage ? 'image' : info.type;
5657
const limits = currentConfig().attachments.fileSizeLimitByType;
57-
const sizeLimit = limits[info.type] ?? limits['default'];
58+
const sizeLimit = limits[type] ?? limits['default'];
5859

5960
if (commonResult.fileSize > sizeLimit) {
6061
throw new ContentTooLargeException(
61-
`This '${info.type}' file is too large (the maximum size is ${sizeLimit} bytes)`,
62+
`This '${type}' file is too large (the maximum size is ${sizeLimit} bytes)`,
6263
);
6364
}
6465
}

0 commit comments

Comments
 (0)