Java Android-Exifinterface E/JHEAD:Can';不要回信-没有';I don’我不全看
我正在尝试为解密图像添加一个用于方向的exif标记。不幸的是,它给了我 E/JHEAD:无法回写-没有全部阅读 Logcat上的通知,未写入exif标签。我读了stackoverflow上所有类似的帖子,但没有可能的答案 这是我的密码Java Android-Exifinterface E/JHEAD:Can';不要回信-没有';I don’我不全看,java,android,exif,Java,Android,Exif,我正在尝试为解密图像添加一个用于方向的exif标记。不幸的是,它给了我 E/JHEAD:无法回写-没有全部阅读 Logcat上的通知,未写入exif标签。我读了stackoverflow上所有类似的帖子,但没有可能的答案 这是我的密码 try { FileInputStream fileInputStream = new FileInputStream(f); InputStream inputStream = crypto.getCipherInputStream(fileI
try {
FileInputStream fileInputStream = new FileInputStream(f);
InputStream inputStream = crypto.getCipherInputStream(fileInputStream, new Entity("password"));
name = getFileName(f.getName());
extention = getExtention(name,albm);
File fl = new File(tmp.getPath() + "/" +getFileName(f.getName()) + "." + extention);
OutputStream outputStream = new BufferedOutputStream(new FileOutputStream(fl));
byte[] buff = new byte[1024];
int x = 0;
while ((x = inputStream.read(buff)) != -1) {
outputStream.write(buff);
}
inputStream.close();
inputStream=null;
outputStream.close();
outputStream=null;
fileInputStream.close();
fileInputStream=null;
ExifInterface exifInterface = new ExifInterface(fl.getPath());
exifInterface.setAttribute(ExifInterface.TAG_ORIENTATION, ExifInterface.ORIENTATION_ROTATE_90 + "");
exifInterface.saveAttributes();
Log.d("<>File exists?<>", fl.exists() ? "yes" : "noo");
ExifInterface exifInterface2 = new ExifInterface(fl.getPath());
String orientation =exifInterface2.getAttribute(ExifInterface.TAG_ORIENTATION);
Log.d("<>****<>",orientation +"");
System.gc();
} catch (FileNotFoundException e) {
e.printStackTrace();
} catch (KeyChainException e) {
e.printStackTrace();
} catch (CryptoInitializationException e) {
e.printStackTrace();
} catch (IOException e) {
e.printStackTrace();
}
试试看{
FileInputStream FileInputStream=新的FileInputStream(f);
InputStream InputStream=crypto.getCipherInputStream(fileInputStream,新实体(“密码”);
name=getFileName(f.getName());
extention=getExtention(名称,albm);
File fl=新文件(tmp.getPath()+“/”+getFileName(f.getName())+“+扩展名);
OutputStream OutputStream=新缓冲输出流(新文件输出流(fl));
字节[]buff=新字节[1024];
int x=0;
while((x=inputStream.read(buff))!=-1){
outputStream.write(buff);
}
inputStream.close();
inputStream=null;
outputStream.close();
outputStream=null;
fileInputStream.close();
fileInputStream=null;
ExifInterface ExifInterface=新的ExifInterface(fl.getPath());
setAttribute(exifInterface.TAG_方向,exifInterface.ORIENTATION_旋转_90+);
exifInterface.saveAttributes();
Log.d(“文件存在?”,fl.exists()?“是”:“noo”);
ExifInterface exifInterface2=新的ExifInterface(fl.getPath());
字符串方向=ExifInterface 2.getAttribute(ExifInterface.TAG_方向);
Log.d(“****”,方向+”);
gc();
}catch(filenotfounde异常){
e、 printStackTrace();
}捕获(keychaine异常){
e、 printStackTrace();
}捕获(加密初始化异常e){
e、 printStackTrace();
}捕获(IOE异常){
e、 printStackTrace();
}
如何解决此问题?