Skip to content

Instantly share code, notes, and snippets.

@igaiga
Created May 23, 2010 06:58
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 igaiga/410710 to your computer and use it in GitHub Desktop.
Save igaiga/410710 to your computer and use it in GitHub Desktop.
Dir.glob("./*") do |file|
next unless file =~ /\.png|\.jpg|\.gif/
basename = File.basename(file, ".*")
basename += '_' if file =~ /\.png$/
run_str = "convert -resize 240x320 -quality 90% #{file} #{basename}.png"
system run_str
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment