获取从库中选择的图像路径

时间:2017-05-17 20:46:52

标签: java android

我需要将正确的图像(我从图库中选择)路径传递给ExifInterface,但我似乎无法让它工作......

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

这将返回:

/document/image:489

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

1 个答案:

答案 0 :(得分:0)

  

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

对于感觉像3,734 th 时间,没有文件路径

使用the ExifInterface from the Android Support library。它提供了一个InputStream的构造函数。您可以InputStream致电Uri,为openInputStream()获得ContentResolver

相关问题