sandrios / sandriosCamera

Easy integration of camera for image and video capturing with Image Picker.
MIT License
187 stars 54 forks source link

Captured image orientation changes while upload to server #11

Closed lendra85 closed 7 years ago

lendra85 commented 7 years ago

I had capture the photo using camera, it was good when displaying from preview screen, but after the image path has uplloaded then the orientation changed -90 degrees. I tried to detect the orientation of file by ExifInterface, but always return 0. How i can solve this?

sohambannerjee8 commented 7 years ago

Even I am also facing the same.Please let me know if anyone found any solution.

jeetdholakia commented 7 years ago

Same issue here. Please fix.

faisaldebouni commented 7 years ago

you'll have to rotate image (either after or before upload). there is a header in the image meta data which will specify the orientation the image was taken in.

this function will rotate image to correct orientation (php/server side) https://stackoverflow.com/a/21797668

this for rotating before upload (java) https://stackoverflow.com/a/14066265

(note: picasso auto rotates image to correct orientation, but it seems, for some reason, it doesn't read exif headers when you download the image from server again)

arpitgandhi9 commented 7 years ago

Please checkout 90b79ac3f and let me know if this fixes the issue. If yes, then it shall be merged with master and will be available with next release.