Hello! Thank you for this module.
There is an issue if imageCompression function is used in a "for" loop. If options object is defined before the loop then on each iteration function imageCompression changes options' properties:
For example, if I try to upload 3 photos and the first one has exifOrientation = 6 then the rest of the photos will be rotated as well, because exifOrientation will be in the options object after the first iteration.
I guess it is because of this line:
options.exifOrientation = options.exifOrientation || await getExifOrientation(file)
Hello! Thank you for this module. There is an issue if imageCompression function is used in a "for" loop. If options object is defined before the loop then on each iteration function imageCompression changes options' properties:
For example, if I try to upload 3 photos and the first one has exifOrientation = 6 then the rest of the photos will be rotated as well, because exifOrientation will be in the options object after the first iteration. I guess it is because of this line:
options.exifOrientation = options.exifOrientation || await getExifOrientation(file)
I think compress function should use a copy of options object. I've opened PR for this issue: https://github.com/Donaldcwl/browser-image-compression/pull/71