How can I retrieve the dimensions of an image (typically jpeg, png, jpg and gif), in the local filesystem with Java?
You can use java's image class to get image attributes. Here is the sample -
BufferedImage img = ImageIO.read(new File("imageFilePath"));
int height = img.getHeight();
int width = img.getWidth();
how about this: getting image metadata
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With