load the fullscreen image in full resolution with Glide

This commit is contained in:
tibbi 2019-08-21 14:28:27 +02:00
parent ab30417171
commit 84110a0638
2 changed files with 4 additions and 3 deletions

View file

@ -464,7 +464,7 @@ class PhotoFragment : ViewPagerFragment() {
val minTileDpi = if (showHighestQuality) -1 else getMinTileDpi()
val bitmapDecoder = object : DecoderFactory<ImageDecoder> {
override fun make() = MyGlideImageDecoder(rotation, mScreenWidth, mScreenHeight)
override fun make() = MyGlideImageDecoder(rotation)
}
val regionDecoder = object : DecoderFactory<ImageRegionDecoder> {

View file

@ -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()
}