i'm making some experiments with the relatively new webP image format , that is supported on android 4 (ICS) as shown here .
so far , in order to get the image size before loading it , i used the next code (similar to what google shows here) :
final BitmapFactory.Options options=new BitmapFactory.Options();
options.inJustDecodeBounds=true;
BitmapFactory.decodeStream(inputStream,null,options);
//image size is in options.outWidth,options.outHeight
however , when i use it on a webP image that has transparency , it seems that it can't get this info at all (returns -1 for both width and height) .
is it possible that google has a bug on decoding this image file type ?
is there a way to overcome this?
in order to test it , just convert a png file that has transparency (like this one that i've used and added some transparent pixels via paint.net app ) to a webP format (using google's tool ), and try to read the resolution of the file like the code i've used.