Fix exif orientation issue when resizing images. by kaymes · Pull Request #2001 · dropzone/dropzone

This PR fixes the issue with exif orientation when resizing image described in #1967.

With this PR, Exif data is removed from the image before resizing it. This way the browser doesn't fix the orientation and everything is correct when the Exif information is added to the resized image afterwards.

Initially I tried to re-use some of the code of the existing ExifRestorer. However, it proved to be quite slow with to do the base64 encoding/decoding of that class. Thus, I wrote a much simpler and faster version of it which uses the builtin atob() and btoa() functions and subsequently uses strings instead of arrays.
Since this proved effective I also changed the Exif restore code to a simpler and faster function and removed the ExifRestorer.

Unfortunately I haven't worked out how to build the distribution files so I could only do limited testing.