Fix image viewer
This commit is contained in:
parent
1cab607fa1
commit
01a9c261f5
@ -150,8 +150,20 @@ class ImageViewer: FileViewerActivity() {
|
|||||||
|
|
||||||
private fun loadImage(){
|
private fun loadImage(){
|
||||||
loadWholeFile(filePath)?.let {
|
loadWholeFile(filePath)?.let {
|
||||||
bitmap = BitmapFactory.decodeByteArray(it, 0, it.size)
|
val displayWithGlide = if (it.size < 5_000_000) {
|
||||||
Glide.with(this).load(bitmap).into(binding.imageViewer)
|
true
|
||||||
|
} else {
|
||||||
|
val decodedBitmap = BitmapFactory.decodeByteArray(it, 0, it.size)
|
||||||
|
if (decodedBitmap == null) {
|
||||||
|
true
|
||||||
|
} else {
|
||||||
|
Glide.with(this).load(decodedBitmap).fitCenter().into(binding.imageViewer)
|
||||||
|
false
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (displayWithGlide) {
|
||||||
|
Glide.with(this).load(it).into(binding.imageViewer)
|
||||||
|
}
|
||||||
fileName = File(filePath).name
|
fileName = File(filePath).name
|
||||||
binding.textFilename.text = fileName
|
binding.textFilename.text = fileName
|
||||||
rotationAngle = 0F
|
rotationAngle = 0F
|
||||||
|
Loading…
Reference in New Issue
Block a user