Skip to content

Instantly share code, notes, and snippets.

@robink
Created June 20, 2013 19:51
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save robink/5826038 to your computer and use it in GitHub Desktop.
Save robink/5826038 to your computer and use it in GitHub Desktop.
Get an image file resolution from the command line. Requires Imagemagick. Protip: add it in your PATH with +x chmod.
#!/usr/bin/env ruby
out = IO.popen('identify ' + ARGV[0])
puts out.readlines.join().split(' ')[2]
@bobmaerten
Copy link

Nice!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment