Jul 19th, 2011, 05:43 AM
How to get the image size (width and height)?
Hi, I am new to grails. I spent fare amount of time in search of finding the image size using grails but end up with nothing.
I want to find the image size (width and height) using grails by just giving path of the image. Is it possible using grails? if yes, how?
Please suggest me easy way to find the image size.
Thanks in advance,
Jul 20th, 2011, 02:13 AM
Any help is appreciated...
Jul 27th, 2011, 04:36 AM
What image size? Is this a static resource under web-app/images of the application? Or is it an image upload? Or is it an image elsewhere? Regardless, you should have a look at the Burning Image plugin, which I believe makes it pretty easy to access this information.
Jul 27th, 2011, 04:46 AM
thanks for your reply.
Ya it is a static resource under web-app/images of the application.
I found the solution as well, it is as shown below -
def img = ImageIO.read(new File("path/to/your/file/cherry.jpg"));
I think it is too late response from the forum.