Ask Ubuntu is a question and answer site for Ubuntu users and developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Is there a command that can read image attributes , I only need it's height / width.

share|improve this question
do you want metadata extraction – Ringtail Apr 9 '12 at 4:29
up vote 1 down vote accepted

you could try file or more advanced command identify from ImageMagic packet.

share|improve this answer
Good one , I never thought file can extract those info as well – warl0ck Apr 9 '12 at 4:30
@warl0ck I'd still use identify though, as it's much easier to get the data you want. read -r width height < <(identify -format "%w %h" "$imagefile") – geirha Apr 10 '12 at 6:41

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.