Skip to content

Instantly share code, notes, and snippets.

@waynegraham
Created September 22, 2010 14:00
Show Gist options
  • Save waynegraham/591721 to your computer and use it in GitHub Desktop.
Save waynegraham/591721 to your computer and use it in GitHub Desktop.
#!/usr/bin/env ruby
image_path = "archive/files"
thumbnail_path = "archive/thumbnails"
Dir["#{image_path}/*.jpg"].each do |image|
fname = File.basename(image)
puts "Converting #{fname}..."
`convert #{image_path}/#{fname} -thumbnail '300' -gravity Center +repage -strip #{thumbnail_path}/#{fname}`
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment