Android : Android ExifInterface.saveAttributes() JHEAD﹕ Could not open file for write

on Sunday, March 8, 2015


I write a App to see and change the Exif Data in pictures. I get all the data with no issues from the picture.


i load them in EditText fields to allow the user to change them. At the end of the View i have a button to save the data back to the image and add the image uri to an history file...


All permissions are set for writing and reading...


when i click on the button it saves the image uri to the textfile, but i get an error on the ExifInterface.saveAttributes(); the error in the log is:



E/JHEAD﹕ Could not open file for write



here is my save Button Method with only setting and saving the Tag_Aperture:



public void saveButton(View view) {
try {
exif.setAttribute(ExifInterface.TAG_APERTURE, editFields[0].getText().toString());

exif.saveAttributes();
String[] history = readFromFile().split(";");
for(String elem : history) {
System.out.println(elem);
}
writeToHistoryFile(selectedImageUri.toString());
Toast toast = Toast.makeText(this, "Exif Data saved succesfully!",
Toast.LENGTH_LONG);
toast.show();
finish();
} catch (IOException e) {
e.printStackTrace();
}
}


I need help fast please, its a Project for school, have to send it to my teacher next week and this is my last error... :( Very much thanks


0 comments:

Post a Comment