Sending a jpeg using XMLHttpRequest is increasing the file size on IOS
Description
Using XMLHttpRequest to upload a JPEG on IOS, increases the file size. Sending a compressed JPEG with XMLHttpRequest is uploading a file of which the file size is increased.
Executing the following will code will trigger the behaviour
const xhr = new XMLHttpRequest();
xhr.open('PUT', <FileUploadURL>);
xhr.send({uri: <Compressed JPEG uri>});
It seems to be that the following code is being executed on the IOS side
Libraries/Image/RCTImageLoader.mm
1104: imageData = UIImageJPEGRepresentation(image, 1.0);
From what I understand, this code is uncompressing and then recompressing the JPEG file using the compressing value supplied to the call (1.0).
React Native version:
0.63.3
Steps To Reproduce
Provide a detailed list of steps that reproduce the issue.
- Have a compressed JPEG file available
- Execute the code as provided above
- Inspect the difference between the original and the uploaded file
Expected Results
I expect that the original file is being uploaded, not a recompressed version with a different amount of compression
This issue is stale because it has been open 180 days with no activity. Remove stale label or comment or this will be closed in 7 days.
This issue was closed because it has been stalled for 7 days with no activity.