If your Android app uses the device camera to take a picture and then resizes it (this is very, very common to reduce the size for upload), you might not realize that this r
Why not just modify the ExifInterface source and add your own implementation to support reading/writing in bulk so you don't have to specify tag by tag. Here is a snippet of what I would do.
Add new method to expose the internal attributes:
public HashMap[] getAllAttributes() {
return mAttributes;
}
Add new method to set all the attributes:
public void setAttributes(HashMap[] attributes) {
for (int i = 0 ; i < EXIF_TAGS.length; ++i) {
mAttributes[i] = attributes[i];
}
}
Then use it like this to preserve Exif and save to another File
// Grab all the original exif attributes from an image file and save to memory or wherever
let attributes = ExifInterface2(sourceImagePath).attributes
// Later on you can just copy those attributes to another image
ExifInterface2(destImagePath)
.setAttributes(attributes)
.saveAttributes();