Android Library - android-crop rotates captured images -


i using android-crop https://github.com/jdamcd/android-crop in order square crop result capturing image camera onactivityresult. problem reason library seams rotating images unpredictably.

the following activity of library creates output handiling onactivityresult - cropimageactivity.

the result cropping loaded picasso in imageview. image file temporary stored in environment.getexternalstoragepublicdirectory(environment.directory_dcim) , file given extra_output capturing of image, being cropped , loaded in imageview.

the problem android phones images rotated correctly, others not. nexus 5 ok, xperia z not , on...

i looking simple way make sure images correctly rotated. in advance help!

after struggle found answer. library extracting exif data mediastore, not storing temp files there. there 2 possible solutions came mind. first read exif orientation before cropping , set orientation attribute after cropping. other way save files media store.

croputil.copyexifrotation(croputil.getfrommediauri(this, this.getcontentresolver(),  this.sourceuri), croputil.getfrommediauri(this, this.getcontentresolver(), this.saveuri));         this.setresulturi(this.saveuri); 

Comments

Popular posts from this blog

twig - Using Twigbridge in a Laravel 5.1 Package -

jdbc - Not able to establish database connection in eclipse -

firemonkey - How do I make a beep sound in Android using Delphi and the API? -