Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Uploading files from Apple Photos fails #8317

Closed
max-degterev opened this issue Sep 19, 2024 · 7 comments · Fixed by #8510
Closed

Uploading files from Apple Photos fails #8317

max-degterev opened this issue Sep 19, 2024 · 7 comments · Fixed by #8510
Assignees
Labels

Comments

@max-degterev
Copy link

max-degterev commented Sep 19, 2024

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

[email protected]

Adapters and Plugins

No response

@max-degterev max-degterev added status: needs-triage Possible bug which hasn't been reproduced yet v2 labels Sep 19, 2024
@max-degterev
Copy link
Author

might be related: lovell/sharp#4077

@max-degterev
Copy link
Author

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

@PatrikKozak PatrikKozak self-assigned this Sep 25, 2024
@github-actions github-actions bot removed the status: needs-triage Possible bug which hasn't been reproduced yet label Sep 25, 2024
@max-degterev
Copy link
Author

max-degterev commented Oct 1, 2024

IMG_9160.jpeg.zip
Attached a test image, archived to avoid github compressing

@PatrikKozak
Copy link
Contributor

Hey @max-degterev - thank you for the test image! I've opened a PR that should fix your issue here - can you confirm though that this is happening on your end because you have some defined imageSizes that are not necessarily of the same aspect ratio as the original image?

@max-degterev
Copy link
Author

Hey yeah basically crop is applied without respecting the orientation, I quickly checked your PR and it seems to do the right thing, if orientation > 4 need to swap width and height. See the same in sharp doc: https://sharp.pixelplumbing.com/api-input (Look for getNormalSize)

@github-actions github-actions bot removed the status: verified If an issue has been reproduced label Oct 8, 2024
Copy link

This issue has been automatically locked.
Please open a new issue if this issue persists with any additional detail.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Oct 10, 2024
Copy link

🚀 This is included in version v2.30.2

@github-actions github-actions bot unlocked this conversation Oct 17, 2024
@github-actions github-actions bot locked and limited conversation to collaborators Oct 17, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants