2017-05-17 68 views
0

我需要通过适当的图像路径ExifInterface(这是我从图库中选择),选择图片的路径,但我似乎无法得到它的工作...获取从画廊

File myFile = new File(selectedImageUri.getPath()); 
String patch = myFile.getPath(); 

这将返回:

/document/image:489 

我想检测,如果图像是rotaded与否,但没有这个完整路径即../images/test.jpg将无法正常工作。我如何获得正确的图像路径?

回答

0

如何获得正确的图像路径?

为了什么感觉就像是3,734 时间,没有文件路径

使用the ExifInterface from the Android Support library。它提供了一个构造函数,它需要一个InputStream。您可以通过ContentResolver上的openInputStream()获取InputStreamUri