fix: 明确提示超大 PNG 像素限制

This commit is contained in:
2026-08-13 19:01:44 +08:00
parent 6f22b03ed9
commit ed81f24892
4 changed files with 32 additions and 5 deletions

View 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)
}