nervgh / angular-file-upload

[ALMOST NOT MAINTAINED] Angular File Upload is a module for the AngularJS framework
MIT License
3.44k stars 1.13k forks source link

ngf-thumbnail is breaking image orientation #881

Open adamreisnz opened 3 years ago

adamreisnz commented 3 years ago

Using ngf-src, when taking a photo with portrait orientation on Android, it is displayed correctly in the portrait orientation. However, when using ngf-thumbnail, the orientation is broken and the image is display turned 90 degrees.

This is consistently reproducible.

Am I missing some settings to prevent this from happening? Using ngf-fix-orientation="true" doesn't help.

adamreisnz commented 3 years ago

The same is happening after an Upload.resize() on the client. The resized image is oriented incorrectly. This is despite using restoreExif: true.

Applying Upload.applyExifRotation() turns the image upside down... 😩

adamreisnz commented 3 years ago

I ended up not using any in-browser resizing/rotation/scaling, and ended up only using ngf-src instead of ngf-thumbnail, as I couldn't find a combination of tools/hacks/fixes to ensure a correct image orientation.

Images are now displayed correctly and uploaded correctly, and the server is taking care of resizing via kraken.io.

Still a pity, as I would have liked to minimise bandwidth sent to the server by resizing images on the client before upload.

If anyone has any tips on how to fix the problems mentioned in this issue that'd be great.