-
Notifications
You must be signed in to change notification settings - Fork 24.3k
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
Converting local image uri to blob inflates initial image size #21731
Comments
Note: I could not replicate this on Android |
As a current workaround I am using |
I've came across the same issue when uploading a FormData obj to the server (which doesn't come as surprise) |
Is there any advance in this matter? Im facing the same problem of @naorzr, thats a great increase on the size of the image when is uploaded using formData and its only happening on ios. Some one has any workaround? Could be upload the image in base64 but in that case i'll face also an increasing of size and what we really need is that the size is the same |
Guys, any update on how to control increase in image size while uploading a FormData obj to the server? Am facing this issue for iOS only |
@spaul03 If using rn-fetch-blob is not an option, then I have no idea.. wasted like a day and a half on this problem, but couldn't work it out. |
The only workaround that i found was uploading the image as a base64 string. In my case im using the library react-native-image-base64 and then uploading the file on a JSON payload. I dont really know if this is a good approach for larger images, but at least in my usea case it works like a charm |
@naorzr will it work for an expo detached app? my build started failing after it asked for POD UPDATE |
@spaul03 it depends, if you're using expokit then there are some issues with rn-fetch-blob and expokit, but if you detached to bare react native, then it should work fine, did you remember to do cd ios && pod install? |
Hey there, it looks like there has been no activity on this issue recently. Has the issue been fixed, or does it still require the community's attention? This issue may be closed if no further activity occurs. You may also label this issue as a "Discussion" or add it to the "Backlog" and I will leave it open. Thank you for your contributions. |
Closing this issue after a prolonged period of inactivity. If this issue is still present in the latest release, please feel free to create a new issue with up-to-date information. |
Environment
Description
Converting a local image to a blob using
fetch
results in different blob sizes depending on whether or not you've rendered an image to the screen.If you get an image from the camera roll, then convert it to a blob, the value of
blob.size
is equal to the true size of the image. However, if you first render an image to the screen then get the image and convert it you will notice the value ofblob.size
increases.I've noticed at least a 2x increase in blob size with all images.
Reproducible Demo
Change
App.js
to:The text was updated successfully, but these errors were encountered: