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

Smart Cropping doesn't work on V4 #132

Closed
abalsekar opened this issue Jul 25, 2019 · 3 comments
Closed

Smart Cropping doesn't work on V4 #132

abalsekar opened this issue Jul 25, 2019 · 3 comments

Comments

@abalsekar
Copy link

Smart cropping fails with Sharp. Using the demo console to produce this JSON request.
{
"bucket": "my-image-bucket",
"key": "my-image-number.jpg",
"edits": {
"resize": {
"width": 100,
"height": 100,
"fit": "inside"
},
"smartCrop": {
"faceIndex": 100
}
}
}

@hayesry
Copy link
Member

hayesry commented Aug 2, 2019

Hey @abalsekar, it's possible that your FaceIndex is out of range and is throwing an error. Recommend checking CloudWatch logs to confirm this but we've added a feature request (#133) to make Smart Cropping fail more gracefully (aka return the original image when the face index is out of range or no faces are detected at all by Rekognition). Hope this helps!

@hayesry
Copy link
Member

hayesry commented Aug 2, 2019

Also, a potential limitation might be that Rekognition only returns a zero-based array for the first 100 faces detected in an image. So the maximum might be 99 instead of 100 in this particular case.

@G-Lenz
Copy link
Contributor

G-Lenz commented Jan 29, 2021

We've fixed these issues with smart cropping in v5.2.0.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants