推 givemepass: 你可能要先解URI 轉換成路徑在做副檔名判斷即可 02/21 22:09
目前使用這個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)
這樣我可以怎麼處理@@?
--
※ 發信站: 批踢踢實業坊(ptt.cc), 來自: 1.160.166.6
※ 文章網址: https://www.ptt.cc/bbs/AndroidDev/M.1487165894.A.49C.html
※ 編輯: linlin76 (1.160.166.6), 02/15/2017 21:46:59