Page 1 of 1

How many pixels my image has like resolution?

Posted: 2007-09-18T15:56:37-07:00
by poincare999
Hi
I have an image: image.jpg.
I want know how many pixels it has.
What commad must I use?

For instance, If "image.jpg" has the resolution of 1536x2048 pixels, I want a command tells me that the resolution of "image.jpeg" is 1536x2048 pixels.

Thanks.

Re: How many pixels my image has like resolution?

Posted: 2007-09-18T16:04:30-07:00
by defied

Code: Select all

identify -format "%wx%h" picture.jpg
or in php

Code: Select all

exec('identify -format "%wx%h" picture.jpg', $a); print_r($a);

Re: How many pixels my image has like resolution?

Posted: 2007-09-18T16:12:36-07:00
by poincare999
Great!!

Thank you very much.

Re: How many pixels my image has like resolution?

Posted: 2007-09-23T20:27:56-07:00
by anthony
Note that is not however the images resolution, but it's size. Resolution is expressed as points or dots per real-world mesaure. For example dpi, Dots Pre Inch.