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

powershell Start-Process exit code -1073741502 when used with Credential from a windows service environment -

twig - Using Twigbridge in a Laravel 5.1 Package -

c# - LINQ join Entities from HashSet's, Join vs Dictionary vs HashSet performance -