load the fullscreen image in full resolution with Glide
This commit is contained in:
parent
ab30417171
commit
84110a0638
2 changed files with 4 additions and 3 deletions
|
@ -464,7 +464,7 @@ class PhotoFragment : ViewPagerFragment() {
|
||||||
val minTileDpi = if (showHighestQuality) -1 else getMinTileDpi()
|
val minTileDpi = if (showHighestQuality) -1 else getMinTileDpi()
|
||||||
|
|
||||||
val bitmapDecoder = object : DecoderFactory<ImageDecoder> {
|
val bitmapDecoder = object : DecoderFactory<ImageDecoder> {
|
||||||
override fun make() = MyGlideImageDecoder(rotation, mScreenWidth, mScreenHeight)
|
override fun make() = MyGlideImageDecoder(rotation)
|
||||||
}
|
}
|
||||||
|
|
||||||
val regionDecoder = object : DecoderFactory<ImageRegionDecoder> {
|
val regionDecoder = object : DecoderFactory<ImageRegionDecoder> {
|
||||||
|
|
|
@ -7,9 +7,10 @@ import com.bumptech.glide.Glide
|
||||||
import com.bumptech.glide.load.DecodeFormat
|
import com.bumptech.glide.load.DecodeFormat
|
||||||
import com.bumptech.glide.load.engine.DiskCacheStrategy
|
import com.bumptech.glide.load.engine.DiskCacheStrategy
|
||||||
import com.bumptech.glide.request.RequestOptions
|
import com.bumptech.glide.request.RequestOptions
|
||||||
|
import com.bumptech.glide.request.target.Target
|
||||||
import com.davemorrissey.labs.subscaleview.ImageDecoder
|
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 {
|
override fun decode(context: Context, uri: Uri): Bitmap {
|
||||||
val options = RequestOptions()
|
val options = RequestOptions()
|
||||||
|
@ -22,7 +23,7 @@ class MyGlideImageDecoder(val degrees: Int, val width: Int, val height: Int) : I
|
||||||
.load(uri)
|
.load(uri)
|
||||||
.apply(options)
|
.apply(options)
|
||||||
.transform(RotateTransformation(-degrees))
|
.transform(RotateTransformation(-degrees))
|
||||||
.into(width, height)
|
.into(Target.SIZE_ORIGINAL, Target.SIZE_ORIGINAL)
|
||||||
|
|
||||||
return builder.get()
|
return builder.get()
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue