urbanriskmap / riskmap

Files for Cognicity RiskMap web, all deployments
GNU General Public License v3.0
5 stars 8 forks source link

Bugs on image orientation #233

Open emirhartato opened 7 years ago

emirhartato commented 7 years ago

Problems

Image orientation shows differently on different platform. Here's the comparison:

  1. Desktop (Safari and Chrome) screen shot 2017-08-31 at 12 07 54

  2. iOS (Safari) img_0580

  3. Android (Chrome) img_0582

How to replicate this issue

  1. Use Telegram for reporting using iOS (iPhone 7) - haven't tried via Twitter
  2. Upload image with portrait orientation
  3. The image will rotated 90 degrees, so I did rotate the image to fix. Apparently it fixed on iOS - but it broke for other platforms.
  4. Upload.

Proposed Solution

  1. Would it possible to put an algorithm for auto-rotate the image into correct orientation - so users doesn't have to fix or rotate manually?

OR

  1. Tweak the image rotation function on the cards.

Any other solutions are welcome.

matthewberryman commented 7 years ago

Going to have to be option 2. Card code for rotation seems to rotate the photo on card display but not actually rotate the uploaded file, c.f. https://github.com/urbanriskmap/cognicity-cards/blob/master/src/routes/cards/photo/photo.js Rotating the file before upload, or alternatively adjusting the EXIF and making sure the image-lambda code uses libraries that support EXIF and then rotating the raw image according to EXIF data there, is probably the way to go as support of EXIF orientation is still sketchy (hence variation between iOS and Android).