Retrieving image sizes in a file system

How can I get image sizes (usually jpeg, png, jpg and gif) in a local file system with Java?

+6
source share
2 answers

You can use a java image to get image attributes. Here is an example -

BufferedImage img = ImageIO.read(new File("imageFilePath")); int height = img.getHeight(); int width = img.getWidth(); 
+7
source

how about this: getting image metadata

+6
source

Source: https://habr.com/ru/post/897747/


All Articles