From 35fb696d30d0cdacd4c1d135097348d426db820c Mon Sep 17 00:00:00 2001 From: tibbi Date: Mon, 14 Nov 2016 23:10:57 +0100 Subject: [PATCH] set the default mimetype to image/jpeg --- .../gallery/activities/ViewPagerActivity.kt | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/activities/ViewPagerActivity.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/activities/ViewPagerActivity.kt index 5432a8013..22ecb4a8d 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/activities/ViewPagerActivity.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/activities/ViewPagerActivity.kt @@ -203,10 +203,11 @@ class ViewPagerActivity : SimpleActivity(), ViewPager.OnPageChangeListener, View private fun getMimeType(url: String): String? { val extension = MimeTypeMap.getFileExtensionFromUrl(url) - if (extension != null) { - return MimeTypeMap.getSingleton().getMimeTypeFromExtension(extension) + return if (extension != null) { + MimeTypeMap.getSingleton().getMimeTypeFromExtension(extension) + } else { + "image/jpeg" } - return null } private fun setAsWallpaper() {