I know this question has been asked already, but none of the answers helped me. In my gallery app there are special jpg files that i can not decode. No matter where i copy those files, the method BitmapFactory.decodeFile() always return null
if(file.exists()) {
// val bitmap = BitmapFactory.decodeStream(file.inputStream())
val bitmap = BitmapFactory.decodeFile(file.absolutePath)
if (bitmap != null) {
return bitmap
}
}
createEmptyBitmap()
But it must be possible, because other gallery apps can show those jpg files. Is there any alternative for creating a Bitmap from a File in Android?