Guest User

Untitled

a guest
Oct 20th, 2018
87
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.32 KB | None | 0 0
  1. require 'rmagick'
  2.  
  3. source = ARGV[0]
  4.  
  5. Dir.glob('images/' + source + '/*.*').each do |image_path|
  6.  
  7. GC.start
  8.  
  9. image = Magick::Image::read(image_path).first
  10. image.resize!(image.columns / 2, image.rows / 2, Magick::GaussianFilter, 0.2)
  11. new_path = image_path.sub(/retina/, 'normal')
  12. image.write new_path
  13.  
  14. image.destroy!
  15.  
  16. end
Add Comment
Please, Sign In to add comment