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

[Question]: [Error: Call to function 'Context.renderAsync' has been rejected. #84

Open
SYursa opened this issue Feb 21, 2025 · 3 comments
Labels
question Further information is requested

Comments

@SYursa
Copy link

SYursa commented Feb 21, 2025

how i can resolve this issue on android, this problem is related with crop() function, this was described in the documentation but I still didn't understand how to solve it. (https://glazzes.github.io/react-native-zoom-toolkit/components/cropzoom.html#crop)
When i set fixedWidth in crop() its allow to call renderAsync() without error, but then i get image with unexpected size.
But when i call renderAsync() and without fixedWidth its not render, and throw error as: [Error: Call to function 'Context.renderAsync' has been rejected.
→ Caused by: java.lang.IllegalArgumentException: x + width must be <= bitmap.width()]

on ios work perfectly

if someone have facing with it, please give me hint how i can solve this problem

@SYursa SYursa added the question Further information is requested label Feb 21, 2025
@Glazzes
Copy link
Owner

Glazzes commented Feb 21, 2025

According to the error message it says it's trying to crop more than it is to crop, could you share me the console.log of that crop method execution?

@SYursa
Copy link
Author

SYursa commented Feb 21, 2025

(NOBRIDGE) LOG original image {"assetId": "120499", "base64": null, "duration": null, "exif": null, "fileName": "IMG_20231027_141557.jpg", "fileSize": 2436870, "height": 4624, "mimeType": "image/jpeg", "rotation": null, "type": "image", "uri": "file:///data/user/0/host.exp.exponent/cache/ExperienceData/%2540anonymous%252Finmate-photos-mobile-1a7f40b2-4453-4110-9aa3-5ceebc464564/ImagePicker/da831f1b-9f15-461a-8862-00312890cf9b.jpeg", "width": 3472}
(NOBRIDGE) LOG cropState {"height": 527.4181701660156, "rotate": 0, "rotateX": 0, "rotateY": 0, "scale": 1, "translateX": 0, "translateY": 0, "width": 396.0198717163508}
(NOBRIDGE) LOG cropContext {"context": {"flipHorizontal": false, "flipVertical": false, "rotationAngle": 0}, "crop": {"height": 4624, "originX": 84.5714285714284, "originY": 0, "width": 3303}, "resize": undefined}
(NOBRIDGE) LOG {"context": {"flipHorizontal": false, "flipVertical": false, "rotationAngle": 0}, "crop": {"height": 4624, "originX": 84.5714285714284, "originY": 0, "width": 3303}, "resize": undefined}

hope it help you

@SYursa
Copy link
Author

SYursa commented Feb 21, 2025

so, here my way to solve it

Image

i just call second crop() and put to fixedWidth width value from first one and its start working 🤷‍♂️

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

No branches or pull requests

2 participants