ivpusic / react-native-image-crop-picker

iOS/Android image picker with support for camera, video, configurable compression, multiple images and cropping
MIT License
6.05k stars 1.54k forks source link

Upload size is getting doubled for a file selected from the tmp path #2072

Open saberprashant opened 1 week ago

saberprashant commented 1 week ago

Version

Tell us which versions you are using:

Platform

Tell us to which platform this issue is related

Expected behaviour

When selecting a file from a tmp folder and uploading it, the uploaded file's size should remain the same.

Actual behaviour

On selecting an image using openPicker or openCropper method and using the path and other data to create a formData object for the file upload, the compressed file size (say 250kB) is getting almost doubled or larger after upload (like 500 kB). But, if I select the same file, use it in POSTman, and upload it via the same API, the uploaded file size comes out to be 250kB only.

Steps to reproduce

1.

2.

3.

Attachments

File from the react-native-image-crop-picker tmp folder:

image

Image object used for the formData payload:

image

Output from file upload(on the backend using s3 uploads directly without any image optimization):

image

Love react-native-image-crop-picker? Please consider supporting our collective: 👉 https://opencollective.com/react-native-image-crop-picker/donate

nikhileupheus commented 1 week ago

+1 Facing same issue.