Skip to content

Instantly share code, notes, and snippets.

@chrise86
Created February 7, 2014 10:27
Show Gist options
  • Save chrise86/8860322 to your computer and use it in GitHub Desktop.
Save chrise86/8860322 to your computer and use it in GitHub Desktop.

This provides an .optim method for Dragonfly.

This requires you have the 'image_optim' gem in your Gemfile

Dragonfly.app.configure do
processor :optim do |content|
io = ImageOptim.new
optimized = io.optimize_image(content.path)
optimized.nil? ? content : optimized
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment