In c#, we can use Image.HorizontalResolution and Image.VerticalResolution.
But in java, how to get it?
I found ImageInfo.java
, but it only supp
It is working for me.
try {
final ImageInfo imageInfo = Sanselan.getImageInfo(new File("C:/Users/AngryMan/Desktop/abc.png"));
final int physicalWidthDpi = imageInfo.getPhysicalWidthDpi();
final int physicalHeightDpi = imageInfo.getPhysicalHeightDpi();
System.out.println("physicalWidthDpi :"+physicalWidthDpi );
System.out.println("physicalHeightDpi : "+physicalHeightDpi);
} catch (Exception e) {
e.printStackTrace();
}
Maven Depndency
org.apache.sanselan
sanselan
0.97-incubator