Created
February 28, 2019 11:58
-
-
Save plashchynski/d7dabc51003deda3bc3543e835274ea7 to your computer and use it in GitHub Desktop.
Ruby script to convert images using magick
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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