-
Notifications
You must be signed in to change notification settings - Fork 24.9k
RCTImagePickerManager crash on image from CameraRoll #4412
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
Conversation
|
By analyzing the blame information on this pull request, we identified @nicklockwood, @dvcrn and @yusefnapora to be potential reviewers. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Isn't this method already called on the main thread?
|
I'm not sure if this is a good default behaviour. In internal projects, we've used RCTImageStoreManager to (temporarily) store images taken this way. |
|
Yes, this is good point. I'll rewrite my PR to use temporary storage |
7e90dca to
6761e12
Compare
|
@doochik updated the pull request. |
|
I've updated my PR. Images from CameraRoll now save to the temporary storage. And about errors. I've fixed this bug #4411. So now i can pass args something like this. Do you like it? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: can you use [...] syntax for accessing keys? Also, no need to cast here:
UIImage *originalImage = info[UIImagePickerControllerOriginalImage];
|
One minor style issue, but otherwise this is good to go. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you add a warning here that this will cause a memory-leak as-is? You need to remove the image from the imageStoreManager once you're done using it. We're looking into providing automatic solutions for this.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@javache do you mean a console warning? Or a warning in the documentation?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just documentation. A warning in the console that you can't fix doesn't sound very useful :)
|
The error API looks good, but I don't think it's necessary in this case since imageStoreManager doesn't explicitly generate errors. (Any error would/should be a fatal runtime error). |
Image from CameraRoll haven't UIImagePickerControllerReferenceURL. So we need to save it to PhotoAlbums first
6761e12 to
0b5fb69
Compare
|
I've fixed your comments, squash commits and rebase to master |
|
@doochik updated the pull request. |
|
@facebook-github-bot shipit |
|
Thanks for importing. If you are an FB employee go to https://our.intern.facebook.com/intern/opensource/github/pull_request/197772487225713/int_phab to review. |
2 similar comments
|
Thanks for importing. If you are an FB employee go to https://our.intern.facebook.com/intern/opensource/github/pull_request/197772487225713/int_phab to review. |
|
Thanks for importing. If you are an FB employee go to https://our.intern.facebook.com/intern/opensource/github/pull_request/197772487225713/int_phab to review. |
Summary: Image from CameraRoll haven't UIImagePickerControllerReferenceURL. So we need to save it to PhotoAlbums first. To save image I've used the same method from RCTCameraRollManager. Closes facebook#4412 Reviewed By: svcscm Differential Revision: D2707249 Pulled By: nicklockwood fb-gh-sync-id: eee683bd4179700bed46ebf45e569197f3ad2077
Image from CameraRoll haven't UIImagePickerControllerReferenceURL. So we need to save it to PhotoAlbums first.
To save image I've used the same method from RCTCameraRollManager.