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