PTT
Submit
Submit
选择语言
正體中文
简体中文
PTT
AndroidDev
[问题] 读取图片GIF错误Image failed to decode
楼主:
linlin76
(linlin76)
2017-02-15 21:38:10
目前使用这个lib处理照片裁切
https://github.com/oginotihiro/cropview
可是选取照片时,如果选到GIF就会闪退
看一下程式码
主要是死在
InputStream is = context.getContentResolver().openInputStream(sourceUri);
BitmapRegionDecoder decoder = BitmapRegionDecoder.newInstance(is, false);
以上程式码sourceUri如果抓到图档是GIF就会跳
Image failed to decode using JPEG decoder
原本想说去判断Uri看是不是GIF再另外处理
可是我看Uri是乱码
(sourceUri = content://com.android.providers.media.documents/document/image%3A22486)
这样我可以怎么处理@@?
作者:
givemepass
(λ)
2017-02-21 22:09:00
你可能要先解URI 转换成路径在做副档名判断即可请参考
https://goo.gl/7bwTlX
里面有一段getPath
继续阅读
[问题] Android Studio不会检查错误 macOS(已解决)
asd56799001
[问题] REST API和MongoDB
fishlinghu
[问题] APK会被覆蓋 (改package无效)
gary771016
[问题] 关于学习顺序
gary771016
[问题] android下 shell script 抓关键字问题
jack58
[问题] Google play开发人员违反政策警告?
mogo
[问题] Serial Port 问题请教
joycece
Re: [问题] 照片缩放后,缩小的回缩功能
linlin76
[问题] BLE连线数据
dream2007
[问题] Android Annotations + Espresso
dwadefans
Links
booklink
Contact Us: admin [ a t ] ucptt.com