Android: Is it possible to convert a TIFF image to JPG, PNG?

大兔子大兔子 提交于 2019-12-13 03:38:26

问题


I know android does not support TIFF format but I'm getting a Base64 image string from a web service and i need to display it.

   byte[] decodedString = Base64.decode(serverResponse, Base64.DEFAULT);
   Bitmap imgMap = BitmapFactory.decodeByteArray(decodedString, 0, decodedString.length);

I tried decoding it with BitmapFactory, but since it doesn't recognize it as a picture it returns null

Is there any external jar or something i can add to display/convert the picture?

Thanks in advance for your help!!


回答1:


If you are willing to add some C++ to your project via the Android NDK, then libtiff should do what you want.

see question Convert JPEG/PNG image to TIFF image format in android OS



来源:https://stackoverflow.com/questions/11035377/android-is-it-possible-to-convert-a-tiff-image-to-jpg-png

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!