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
23.39k stars 1.49k forks source link

Uploading files from Apple Photos fails #8317

Open max-degterev opened 1 day ago

max-degterev commented 1 day ago

Link to reproduction

No response

Describe the Bug

Currently trying to upload a photo picked from Apple Photo Gallery fails with an error:

err: {
      "type": "Error",
      "message": "extract_area: bad extract area",
      "stack":
          Error: extract_area: bad extract area
    }

would it be possible to pass failOnError: false to sharp? I see that you construct the options object but there is no way to pass props down to it.

To Reproduce

Try uploading a photo made with an iPhone

Payload Version

payload@2.28.0

Adapters and Plugins

No response

max-degterev commented 1 day ago

might be related: https://github.com/lovell/sharp/issues/4077

max-degterev commented 1 day ago

confirmed, using https://www.npmjs.com/package/jpeg-autorotate before uploading fixes the issue. still would be great to have this patched in payload itself