mirror of
https://github.com/FossifyOrg/Gallery.git
synced 2024-11-30 00:17:58 +01:00
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())
|
.signature(uri.path.getFileSignature())
|
||||||
.format(DecodeFormat.PREFER_ARGB_8888)
|
.format(DecodeFormat.PREFER_ARGB_8888)
|
||||||
.diskCacheStrategy(DiskCacheStrategy.RESOURCE)
|
.diskCacheStrategy(DiskCacheStrategy.RESOURCE)
|
||||||
.transform(GlideRotateTransformation(context, getRotationDegrees(orientation)))
|
|
||||||
.override(targetWidth, targetHeight)
|
.override(targetWidth, targetHeight)
|
||||||
|
|
||||||
|
val degrees = getRotationDegrees(orientation)
|
||||||
|
if (degrees != 0f)
|
||||||
|
options.transform(GlideRotateTransformation(context, getRotationDegrees(orientation)))
|
||||||
|
|
||||||
val drawable = Glide.with(context)
|
val drawable = Glide.with(context)
|
||||||
.load(uri)
|
.load(uri)
|
||||||
.apply(options)
|
.apply(options)
|
||||||
|
|
Loading…
Reference in a new issue