Here is something very simple and handy.
BufferedImage bimg = ImageIO.read(new File(filename));
int width = bimg.getWidth();
int height = bimg.getHeight();
More Related Contents:
- Java – get pixel array from image
- Can’t read and write a TIFF image file using Java ImageIO standard library
- Setting jpg compression level with ImageIO in Java
- Unable to read JPEG image using ImageIO.read(File file)
- Java/ImageIO getting image dimensions without reading the entire file?
- Convert each animated GIF frame to a separate BufferedImage
- Including Images with an executable jar
- Creating animated GIF with ImageIO?
- java.lang.IllegalArgumentException: input == null! when using ImageIO.read to load image as bufferedImage
- ImageIO not able to write a JPEG file
- How to return a PNG image from Jersey REST service method to the browser
- Swing: link toggle buttons together with a button group, along with corresponding menu items
- How to group a 3×3 grid of radio buttons?
- How do you clone a BufferedImage
- How to get the caller class in Java [duplicate]
- Java’s L number (long) specification
- Android import java.nio.file.Files; cannot be resolved
- comparing arrays in java
- Initializing an array in Java using the ‘advanced’ for each loop [duplicate]
- How to add Access-Control-Allow-Origin to jetty server
- How do I do TLS with BouncyCastle?
- What Java 8 Stream.collect equivalents are available in the standard Kotlin library?
- How to get dates of a week (I know week number)?
- How do I unsign a jar?
- Return the index of clicked button?
- Java: bounded wildcards or bounded type parameter?
- Read directory inside JAR with InputStreamReader
- regarding leading zero in integer value
- How are the IV and authentication tag handled for “AES/GCM/NoPadding”?
- Java-R integration?