【发布时间】:2017-05-25 23:53:09
【问题描述】:
下面是我的代码-
try {
InputStream inputStream = getAssets().open("thumbnail.jpg");
exifInterface = new ExifInterface(inputStream);
exifInterface.setAttribute(ExifInterface.TAG_ARTIST,"TEST INPUT");
exifInterface.saveAttributes();
} catch (IOException e) {
e.printStackTrace();
}
在exifInterface.saveAttributes() 行我收到以下错误 -
java.io.IOException: ExifInterface 不支持保存属性 用于当前输入。
我不确定错误是由于图像文件还是由于属性。我正在努力挽救。我也在网上寻找可能的解决方案(例如 Sanselan),但不确定它是否能解决这个问题。
谁能解释一下如何解决这个问题?
谢谢!
【问题讨论】:
-
我遇到了同样的问题,我使用 DocumentFile 保存图像并使用 DocumentFile.getUri() 打开 InputStream 但是当我尝试使用 InputStream 将 EXIF 数据保存到图像时,我得到相同的异常消息.我尝试保存到设备内存和 SD 卡,但都导致异常。 ExifInterface(InputStream) 可以被窃听吗?
标签: android android-exifinterface