Skip to content

Instantly share code, notes, and snippets.

@schacon
Created March 21, 2011 17:58
Show Gist options
  • Save schacon/879879 to your computer and use it in GitHub Desktop.
Save schacon/879879 to your computer and use it in GitHub Desktop.
pngcrush script to run in a directory of pngs
#! /usr/bin/env ruby
#
Dir.glob("*.png") do |file|
puts "crushing #{file}"
file2 = file + '.cr'
`pngcrush #{file} #{file2}`
save = File.stat(file).size - File.stat(file2).size
puts " save #{save}"
`mv #{file2} #{file}`
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment