Thursday 28 February 2013

Get image dimensions from an URL


This is one of the simplest method to find the dimensions of image.
URL url=new URL("Any web image url");
BufferedImage image = ImageIO.read(url);
int height = image.getHeight();
int width = image.getWidth();
System.out.println("Height : "+ height);
System.out.println("Width : "+ width);

No comments:

Post a Comment