Albirew/tachiyomi
Archivé
1
0
Bifurcation 0
Cette révision appartient à :
len 2017-04-07 20:32:22 +02:00
Parent bc9417e16b
révision bb9e230b35

Voir le fichier

@ -16,8 +16,11 @@ import java.security.NoSuchAlgorithmException
object DiskUtil {
fun isImage(name: String, openStream: (() -> InputStream)? = null): Boolean {
val contentType = URLConnection.guessContentTypeFromName(name)
?: openStream?.let { findImageMime(it) }
val contentType = try {
URLConnection.guessContentTypeFromName(name)
} catch (e: Exception) {
null
} ?: openStream?.let { findImageMime(it) }
return contentType?.startsWith("image/") ?: false
}