You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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: #71
The text was updated successfully, but these errors were encountered:
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: #71
The text was updated successfully, but these errors were encountered: