In an Android application that I am writing, I have a document image (jpeg) that is being uploaded to a server that recognizes the document and sends me back the relevant details. While all that is well and fine, the code in the server expects me to set the "Image DPI" meta-information as seen in mac like so,
The "Image DPI" that is shown in the above screenshot, isn't exactly its value. I have written a method that calculates the dpi-value. How do I set the thusly calculated dpi-value to the meta-information of my jpeg document? I have been able to set this particular meta-information in the application's iOS counterpart, but in Android, two days of relentless trying has left my errand futile.
I do know about ExifInterface
, and I have been unlucky in using its setAttribute(String key,String value)
method. (What should be the key? What should be the value? How do I set the unit? SHOULD I set the unit?).
I have also seen Java-related solutions to this that suggest the use of javax.imageio.*
package which is simply unavailable for Android.
Has anyone faced issues like this? How do I go on about this issue?