List image attributes from a folder of JPEG images

for file in *.jpg; do identify -format '%f %b %Q %w %h' $file; done
Runs the identify command (from ImageMagick) on each jpg file in the current directory and returns image details according to the format parameter. The example here returns: Filename FileSize Compression Width Height More information about the available format options can be found here: http://www.imagemagick.org/script/escape.php I usually redirect the output to a text file using "> listofdetails.txt" at the end. Spreadsheet magic can then be applied.
Sample Output
402670154.jpg 20095B 80 600 400
402670164.jpg 47173B 80 600 600
402670174.jpg 88055B 95 800 800
402680421.jpg 45769B 80 586 388
402680424.jpg 45769B 80 586 388
402680442.jpg 160137B 99 600 600

0
By: phattmatt
2012-11-16 10:06:35

These Might Interest You

What Others Think

for file in *.jpg; do identify -format '%f %b %Q %G' $file; done will also work
chrismccoy · 291 weeks and 5 days ago

What do you think?

Any thoughts on this command? Does it work on your machine? Can you do the same thing with only 14 characters?

You must be signed in to comment.

What's this?

commandlinefu.com is the place to record those command-line gems that you return to again and again. That way others can gain from your CLI wisdom and you from theirs too. All commands can be commented on, discussed and voted up or down.

Share Your Commands



Stay in the loop…

Follow the Tweets.

Every new command is wrapped in a tweet and posted to Twitter. Following the stream is a great way of staying abreast of the latest commands. For the more discerning, there are Twitter accounts for commands that get a minimum of 3 and 10 votes - that way only the great commands get tweeted.

» http://twitter.com/commandlinefu
» http://twitter.com/commandlinefu3
» http://twitter.com/commandlinefu10

Subscribe to the feeds.

Use your favourite RSS aggregator to stay in touch with the latest commands. There are feeds mirroring the 3 Twitter streams as well as for virtually every other subset (users, tags, functions,…):

Subscribe to the feed for: