[英]Android: Is it possible to convert a TIFF image to JPG, PNG?
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. 我知道android不支持TIFF格式,但我从Web服务获取Base64图像字符串,我需要显示它。
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 我尝试用BitmapFactory解码它,但由于它不能将它识别为图片,因此返回null
Is there any external jar or something i can add to display/convert the picture? 是否有任何外部jar或我可以添加的东西来显示/转换图片?
Thanks in advance for your help!! 在此先感谢您的帮助!!
If you are willing to add some C++ to your project via the Android NDK, then libtiff should do what you want. 如果您愿意通过Android NDK向项目添加一些C ++,那么libtiff应该按照您的意愿行事 。
see question Convert JPEG/PNG image to TIFF image format in android OS 请参阅问题在Android OS中将JPEG / PNG图像转换为TIFF图像格式
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.