use glide rotate transformation only when needed
This commit is contained in:
parent
d03729fbf5
commit
0af594ee0b
1 changed files with 4 additions and 1 deletions
|
@ -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)
|
||||
|
|
Loading…
Reference in a new issue