From 0af594ee0bd44eb2d59a0ab0b2d0723576e8a7e0 Mon Sep 17 00:00:00 2001 From: tibbi Date: Thu, 14 Sep 2017 15:40:33 +0200 Subject: [PATCH] use glide rotate transformation only when needed --- .../com/simplemobiletools/gallery/helpers/GlideDecoder.kt | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/helpers/GlideDecoder.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/helpers/GlideDecoder.kt index fe7c7f9e5..08d7002b3 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/helpers/GlideDecoder.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/helpers/GlideDecoder.kt @@ -28,9 +28,12 @@ class GlideDecoder : ImageDecoder { .signature(uri.path.getFileSignature()) .format(DecodeFormat.PREFER_ARGB_8888) .diskCacheStrategy(DiskCacheStrategy.RESOURCE) - .transform(GlideRotateTransformation(context, getRotationDegrees(orientation))) .override(targetWidth, targetHeight) + val degrees = getRotationDegrees(orientation) + if (degrees != 0f) + options.transform(GlideRotateTransformation(context, getRotationDegrees(orientation))) + val drawable = Glide.with(context) .load(uri) .apply(options)