From fe69c09915382bf1f86ad35f816e3dcf0a1264ca Mon Sep 17 00:00:00 2001 From: tibbi Date: Thu, 20 Sep 2018 14:15:12 +0200 Subject: [PATCH] fix displaying fullscreen images containing percentage sign or hashtag --- .../simplemobiletools/gallery/helpers/PicassoRegionDecoder.kt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/helpers/PicassoRegionDecoder.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/helpers/PicassoRegionDecoder.kt index 69c758009..b96ed9deb 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/helpers/PicassoRegionDecoder.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/helpers/PicassoRegionDecoder.kt @@ -10,7 +10,8 @@ class PicassoRegionDecoder : ImageRegionDecoder { private val decoderLock = Any() override fun init(context: Context, uri: Uri): Point { - val inputStream = context.contentResolver.openInputStream(uri) + val newUri = Uri.parse(uri.toString().replace("%", "%25").replace("#", "%23")) + val inputStream = context.contentResolver.openInputStream(newUri) decoder = BitmapRegionDecoder.newInstance(inputStream, false) return Point(decoder!!.width, decoder!!.height) }