Use origURL
from react-native-image-picker, when provided.
#4475
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Major update (marking this as "blocked" until we investigate more): Looks like React Native has fixed issue facebook/react-native#27099 (linked here), with PR facebook/react-native#31457?! 🎉 I'd predict that this fix would be released in RN v0.65.
Part of #4340.
The added comments are pretty absurdly long, and I'd appreciate any recommendations for how to fix that while still having enough detail. 🙂
This follows the discussion on CZO up to here. My comment there still applies:
In particular, this change should eliminate the size inflation that happens when selecting an existing image from the media library on iOS—for some iOS versions. Unfortunately, we don't know the iOS version at which Apple will decide to remove a deprecated iOS API that this optimization depends on (discussion in chat).
We'd obviously prefer to use a library that didn't depend on a deprecated API for this optimization. Unfortunately, if we were to upgrade to the latest version of react-native-image-picker, we'd lose the optimization entirely. And on the most obvious alternative to react-native-image-picker—expo-image-picker—the symptom of the deprecated API being removed would be much worse than missing out on an optimization: it looks like the app would just crash.
As mentioned in the code comments, images coming straight from the camera will still be inflated to almost the same level as they were before. The major obstacle to fixing this is that React Native rudely interferes by uncompressing and recompressing such an image before uploading it, with a
compressionQuality
of 1.0 (the highest possible value; see discussion on CZO for more detail).