-
Notifications
You must be signed in to change notification settings - Fork 24.8k
Closed
Labels
Needs: Triage 🔍StaleThere has been a lack of activity on this issue and it may be closed soon.There has been a lack of activity on this issue and it may be closed soon.
Description
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
AmauryLiet and chrisbobbe
Metadata
Metadata
Assignees
Labels
Needs: Triage 🔍StaleThere has been a lack of activity on this issue and it may be closed soon.There has been a lack of activity on this issue and it may be closed soon.