payloadcms / payload

Payload is the open-source, fullstack Next.js framework, giving you instant backend superpowers. Get a full TypeScript backend and admin panel instantly. Use Payload as a headless CMS or for building powerful applications.
https://payloadcms.com
MIT License
24.75k stars 1.57k forks source link

Error: input image exeeds pixel limit when uploading through localAPI #8414

Open djkato opened 1 month ago

djkato commented 1 month ago

Link to reproduction

https://forgejo.djkato.net/djkato/payload-sharp-resolution-error

Describe the Bug

This specific image crashes localAPI upload.

payload-1  |
payload-1  | /home/node/app/node_modules/payload/src/uploads/generateFileData.ts:302
payload-1  |     throw new FileUploadError(req.t)
payload-1  |           ^
payload-1  | FileUploadError: There was a problem while uploading the file.
payload-1  |     at generateFileData (/home/node/app/node_modules/payload/src/uploads/generateFileData.ts:302:11)
payload-1  |     at create (/home/node/app/node_modules/payload/src/collections/operations/create.ts:129:57)
payload-1  | [17:04:01] INFO (payload): Connected to MongoDB server successfully!
payload-1  | [17:04:01] INFO (payload): Starting Payload...
payload-1  | [17:04:01] INFO (payload): Payload Admin URL: /admin
payload-1  | [17:04:01] ERROR (payload): Error uploading file
payload-1  |     err: {
payload-1  |       "type": "Error",
payload-1  |       "message": "Input image exceeds pixel limit",
payload-1  |       "stack":
payload-1  |           Error: Input image exceeds pixel limit
payload-1  |     }
mongo-1    | {"t":{"$date":"2024-09-25T17:04:01.879+00:00"},"s":"I",  "c":"-",        "id":20883,   "ctx":"conn1","msg":"Interrupted operation as its client disconnected","attr":{"opId":13313}}
payload-1  | [nodemon] app crashed - waiting for file changes before starting...

To Reproduce

clone https://forgejo.djkato.net/djkato/payload-sharp-resolution-error, then run docker compose up The image inside ./media breaks sharp somehow.

Payload Version

2.28.0

Adapters and Plugins

No response

FrancoisSoler commented 4 weeks ago

hi, same issue here, but i'm not using Docker or anything, just a standalone script inside Payload

[18:28:35] ERROR (payload): Error uploading file err: { "type": "Error", "message": "Input image exceeds pixel limit", "stack": Error: Input image exceeds pixel limit } [18:28:35] ERROR (payload): Error processing meta image for article 'test-article': There was a problem while uploading the file.