From 015fde6a97fe428ac7a4c9d15732c1106033be73 Mon Sep 17 00:00:00 2001
From: tibbi <tibor@kaputa.sk>
Date: Thu, 23 Nov 2017 08:45:20 +0100
Subject: [PATCH] lets remove GlideDecoder for now, roll back to rgb_565 format

---
 .../com/simplemobiletools/gallery/fragments/PhotoFragment.kt | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)

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 323731665..17e6cb52f 100644
--- a/app/src/main/kotlin/com/simplemobiletools/gallery/fragments/PhotoFragment.kt
+++ b/app/src/main/kotlin/com/simplemobiletools/gallery/fragments/PhotoFragment.kt
@@ -26,7 +26,6 @@ import com.simplemobiletools.gallery.R
 import com.simplemobiletools.gallery.activities.PhotoActivity
 import com.simplemobiletools.gallery.activities.ViewPagerActivity
 import com.simplemobiletools.gallery.extensions.*
-import com.simplemobiletools.gallery.helpers.GlideDecoder
 import com.simplemobiletools.gallery.helpers.GlideRotateTransformation
 import com.simplemobiletools.gallery.helpers.MEDIUM
 import com.simplemobiletools.gallery.models.Medium
@@ -224,7 +223,6 @@ class PhotoFragment : ViewPagerFragment() {
         if ((medium.isImage()) && isFragmentVisible && view.subsampling_view.isGone()) {
             ViewPagerActivity.wasDecodedByGlide = false
             view.subsampling_view.apply {
-                setBitmapDecoderClass(GlideDecoder::class.java)
                 maxScale = 10f
                 beVisible()
                 setImage(ImageSource.uri(medium.path))
@@ -286,8 +284,7 @@ class PhotoFragment : ViewPagerFragment() {
     }
 
     fun rotateImageViewBy(degrees: Float) {
-        // do not make Subsampling view Gone, because it gets recycled and can crash with "Error, cannot access an invalid/free'd bitmap here!"
-        view.subsampling_view.beInvisible()
+        view.subsampling_view.beGone()
         loadBitmap(degrees)
     }