Skip to content

Instantly share code, notes, and snippets.

@l4u
Created March 31, 2012 11:15
Show Gist options
  • Save l4u/2262299 to your computer and use it in GitHub Desktop.
Save l4u/2262299 to your computer and use it in GitHub Desktop.
guard with guard-shell, down size retina image, hd to sd with imagemagick
guard :shell do
watch(%r{-hd\.png$}) do |m|
input = m[0]
output = input.gsub(/-hd.png$/,'.png')
puts "Downsizing #{input} to #{output}"
`convert #{input} -resize 50% #{output}`
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment