fix: 明确提示超大 PNG 像素限制
This commit is contained in:
8
server/utils/image-validation.ts
Normal file
8
server/utils/image-validation.ts
Normal file
@@ -0,0 +1,8 @@
|
||||
export const MAX_IMAGE_BYTES = 8 * 1024 * 1024
|
||||
export const MAX_IMAGE_WIDTH = 10_000
|
||||
export const MAX_IMAGE_HEIGHT = 10_000
|
||||
export const MAX_IMAGE_PIXELS = 40_000_000
|
||||
|
||||
export function isSharpPixelLimitError(error: unknown) {
|
||||
return error instanceof Error && /exceeds pixel limit/i.test(error.message)
|
||||
}
|
||||
Reference in New Issue
Block a user