I would like to convert images on SDcard to bitmap. I am using below code
String filepath = "/storage/emulated/0/Download/sample2.tif";
Bitmap bm = BitmapFactory.decodeFile(filepath);
This code is working fine for file with extension .jpg or .png but not for .tif or .tiff. For TIFF files bm
becomes null no exceptions nothing all file paths are valid.
Is there any limitation in Android BitmapFactory
with respect to decoding TIFF images?
Also tried decodeByteArray and decodeStream
, looks like limitation for me.
I am able to read TIFF image file as byte []
but conversion of byte[] or file input stream as bitmap is returning null
Please let me know any other way to convert TIFF Image file to Bitmap.