Skip to content

Instantly share code, notes, and snippets.

@plashchynski
Created February 28, 2019 11: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 plashchynski/d7dabc51003deda3bc3543e835274ea7 to your computer and use it in GitHub Desktop.
Save plashchynski/d7dabc51003deda3bc3543e835274ea7 to your computer and use it in GitHub Desktop.
Ruby script to convert images using magick
ARGV.each do |input_file|
basename = File.basename(input_file, ".*")
dirname = File.dirname(input_file)
output_file = "#{dirname}/#{basename}.jpg"
`/usr/local/bin/magick convert '#{input_file}' -quality 20 '#{output_file}'`
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment