Java – retrieves the size of the image in the file system
•
Java
How to use @ L_ 301_ The size of the image retrieved from the local file system of 0 @ (usually JPEG, PNG, JPG and GIF)?
Solution
You can use Java's image class to get image properties This is a sample –
BufferedImage img = ImageIO.read(new File("imageFilePath")); int height = img.getHeight(); int width = img.getWidth();
The content of this article comes from the network collection of netizens. It is used as a learning reference. The copyright belongs to the original author.
THE END
二维码