I want to get image dpi to convert pixels to cm, so I use ImageInfo.java to get this:
ImageInfo myMapInfo = new ImageInfo();
try {
File testFile = new File(fileNameString);
InputStream myMapStream = new FileInputStream(testFile);
myMapInfo.setInput(myMapStream);
myMapInfo.setDetermineImageNumber(true);
myMapInfo.setCollectComments(true);
} catch (FileNotFoundException e) {
e.printStackTrace();
}
x = myMapInfo.getPhysicalWidthInch();
y = myMapInfo.getPhysicalHeightInch();
but unfortunately I get -1 and -1 in (x, y)! I use this class: ImageInfo.java