FileNotFoundException when Using ExifInterface

眉间皱痕 提交于 2019-12-02 07:10:30

A Uri is not a File.

Step #1: Delete File file = new File(uri.toString());

Step #2: Make sure that you are using the Support Library edition of ExifInterface

Step #3: Call getContentResolver() on your Activity to get a ContentResolver

Step #4: Call openInputStream() on the ContentResolver, passing in the Uri, to get an InputStream on the content pointed to by that Uri

Step #5: Pass that InputStream to the ExifInterface constructor

Step #6: Use that ExifInterface as you are presently, to determine the image orientation

Step #7: Once you get things working, move all of this I/O to a background thread

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