From 84fee84349b90d3b56c163417de0780dbb79f3f7 Mon Sep 17 00:00:00 2001 From: tibbi Date: Fri, 1 Dec 2017 10:04:57 +0100 Subject: [PATCH] lets provide Subsampling our own orientation --- .../com/simplemobiletools/gallery/fragments/PhotoFragment.kt | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/fragments/PhotoFragment.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/fragments/PhotoFragment.kt index bffd0b422..599b17d3a 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/fragments/PhotoFragment.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/fragments/PhotoFragment.kt @@ -224,12 +224,15 @@ class PhotoFragment : ViewPagerFragment() { private fun addZoomableView() { if ((medium.isImage()) && isFragmentVisible && view.subsampling_view.isGone()) { + val exif = android.media.ExifInterface(medium.path) + val orientation = exif.getAttributeInt(android.media.ExifInterface.TAG_ORIENTATION, android.media.ExifInterface.ORIENTATION_NORMAL) + ViewPagerActivity.wasDecodedByGlide = false view.subsampling_view.apply { maxScale = 10f beVisible() setImage(ImageSource.uri(medium.path)) - orientation = SubsamplingScaleImageView.ORIENTATION_USE_EXIF + this.orientation = degreesForRotation(orientation) setOnImageEventListener(object : SubsamplingScaleImageView.OnImageEventListener { override fun onImageLoaded() { }