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 8766907da..62a4cef79 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 @@ -25,6 +25,7 @@ import com.bumptech.glide.load.DataSource import com.bumptech.glide.load.DecodeFormat import com.bumptech.glide.load.engine.DiskCacheStrategy import com.bumptech.glide.load.engine.GlideException +import com.bumptech.glide.load.resource.bitmap.Rotate import com.bumptech.glide.request.RequestListener import com.bumptech.glide.request.RequestOptions import com.bumptech.glide.request.target.Target @@ -38,7 +39,10 @@ import com.simplemobiletools.gallery.pro.R import com.simplemobiletools.gallery.pro.activities.PanoramaPhotoActivity import com.simplemobiletools.gallery.pro.activities.PhotoActivity import com.simplemobiletools.gallery.pro.extensions.* -import com.simplemobiletools.gallery.pro.helpers.* +import com.simplemobiletools.gallery.pro.helpers.MEDIUM +import com.simplemobiletools.gallery.pro.helpers.PATH +import com.simplemobiletools.gallery.pro.helpers.PicassoDecoder +import com.simplemobiletools.gallery.pro.helpers.PicassoRegionDecoder import com.simplemobiletools.gallery.pro.models.Medium import com.simplemobiletools.gallery.pro.svg.SvgSoftwareLayerSetter import com.squareup.picasso.Callback @@ -360,7 +364,7 @@ class PhotoFragment : ViewPagerFragment() { .fitCenter() if (mCurrentRotationDegrees != 0) { - options.transform(GlideRotateTransformation(mCurrentRotationDegrees)) + options.transform(Rotate(mCurrentRotationDegrees)) options.diskCacheStrategy(DiskCacheStrategy.NONE) } diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/pro/helpers/GlideRotateTransformation.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/pro/helpers/GlideRotateTransformation.kt deleted file mode 100644 index a0dabc09d..000000000 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/pro/helpers/GlideRotateTransformation.kt +++ /dev/null @@ -1,22 +0,0 @@ -package com.simplemobiletools.gallery.pro.helpers - -import android.graphics.Bitmap -import android.graphics.Matrix -import com.bumptech.glide.load.engine.bitmap_recycle.BitmapPool -import com.bumptech.glide.load.resource.bitmap.BitmapTransformation -import java.security.MessageDigest - -class GlideRotateTransformation(val rotateRotationAngle: Int) : BitmapTransformation() { - override fun transform(pool: BitmapPool, bitmap: Bitmap, outWidth: Int, outHeight: Int): Bitmap { - if (rotateRotationAngle % 360 == 0) { - return bitmap - } - - val matrix = Matrix() - matrix.postRotate(rotateRotationAngle.toFloat()) - return Bitmap.createBitmap(bitmap, 0, 0, bitmap.width, bitmap.height, matrix, true) - } - - override fun updateDiskCacheKey(messageDigest: MessageDigest) { - } -}