diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/pro/fragments/PhotoFragment.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/pro/fragments/PhotoFragment.kt index db7c6058d..9c39b95d0 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/pro/fragments/PhotoFragment.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/pro/fragments/PhotoFragment.kt @@ -464,7 +464,7 @@ class PhotoFragment : ViewPagerFragment() { val minTileDpi = if (showHighestQuality) -1 else getMinTileDpi() val bitmapDecoder = object : DecoderFactory { - override fun make() = MyGlideImageDecoder(rotation, mScreenWidth, mScreenHeight) + override fun make() = MyGlideImageDecoder(rotation) } val regionDecoder = object : DecoderFactory { diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/pro/helpers/MyGlideImageDecoder.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/pro/helpers/MyGlideImageDecoder.kt index dde41e841..b1a3461eb 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/pro/helpers/MyGlideImageDecoder.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/pro/helpers/MyGlideImageDecoder.kt @@ -7,9 +7,10 @@ import com.bumptech.glide.Glide import com.bumptech.glide.load.DecodeFormat import com.bumptech.glide.load.engine.DiskCacheStrategy import com.bumptech.glide.request.RequestOptions +import com.bumptech.glide.request.target.Target import com.davemorrissey.labs.subscaleview.ImageDecoder -class MyGlideImageDecoder(val degrees: Int, val width: Int, val height: Int) : ImageDecoder { +class MyGlideImageDecoder(val degrees: Int) : ImageDecoder { override fun decode(context: Context, uri: Uri): Bitmap { val options = RequestOptions() @@ -22,7 +23,7 @@ class MyGlideImageDecoder(val degrees: Int, val width: Int, val height: Int) : I .load(uri) .apply(options) .transform(RotateTransformation(-degrees)) - .into(width, height) + .into(Target.SIZE_ORIGINAL, Target.SIZE_ORIGINAL) return builder.get() }