Created
November 5, 2018 07:28
-
-
Save Coro365/ab9d130fa780724db4a18527e64edfb0 to your computer and use it in GitHub Desktop.
Delete the lower 14 pixels of the image
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
path = ARGV[0] | |
Dir.glob("#{path}/*") do |file| | |
next unless file.index(/jpeg$|jpg$|png$/) | |
# get image pixel size | |
width, hight = `identify -format "%w %h" #{file}`.split(" ") | |
new_file = File.basename(file) + "-trimed" + File.extname(file) | |
# trim | |
puts "convert #{file} -crop #{width}x#{hight}+0-14 #{new_file}" | |
`convert #{file} -crop #{width}x#{hight}+0-14 #{new_file}` | |
end | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment