我在ExifInterface中缺少什么?

时间:2018-01-13 09:32:42

标签: android interface

我需要在Android中找到图库中的旋转速率。

所以我使用Exifinterface,但是我收到错误'FileNotFoundException'。

当我调试我的源代码时,

img_path值:storage / emulated / 0 / DCIM /나/20171222_160744.jpg

这是来源。

意图

    public void doTakeAlbumAction() {
    Intent intent = new Intent(Intent.ACTION_PICK);
    intent.setType(android.provider.MediaStore.Images.Media.CONTENT_TYPE);
    intent.setData(android.provider.MediaStore.Images.Media.EXTERNAL_CONTENT_URI);
    startActivityForResult(intent, REQ_CODE_SELECT_IMAGE);
}

然后

    public void onActivityResult(int requestCode, int resultCode, Intent data) {
    super.onActivityResult(requestCode, resultCode, data);

    if (resultCode != getActivity().RESULT_OK)
        return;

    if (requestCode == REQ_CODE_SELECT_IMAGE) {
        if (resultCode == Activity.RESULT_OK)
        {
            try {

                // 180113 - 1.5v 적용 필요.
                String img_path = getImagePathToUri(data.getData());

                try {
                    ExifInterface exif = new ExifInterface(img_path);
                } catch (IOException e) {
                    e.printStackTrace();
                }
         }
      }

0 个答案:

没有答案
相关问题