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.
Ok @NomarCub, this is my 2nd try.
I'm still a bit unsure how to properly test this on mobile, so for now it's desktop only (added
Platform.isDesktopcheck to avoid registering the callback on non-desktop)I tried to put this one through its paces by testing various different types of images (local, remote, broken links, base64-encoded inlines, CORS protected etc) and it's working well for me. Also does not add any external dependencies. I added a check for CORS errors and a fallback to use allOrigins for now (should be rare). I heard on Discord that there may be API changes to better handle this coming soon.
Hope this one is merge-able!
video:
copy_image_v2.mp4
if anyone who doesn't have a nodejs environment set up wants to test, here's a precompiled gist:
https://gist.github.com/luckman212/18126c82fc90b9a66b16483e25e13dc9