Module: Laze::Plugins::ImageOptimizer

Defined in:
lib/laze/plugins/image_optimizer.rb

Overview

This plugin tries to optimize the images in your website. You will need to have pngcrush and jpegtran installed on your system for this plugin to work. If not, it will fail silently.

This plugin is a decorator for Target and fires before Target#save.

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.applies_to?(kind) ⇒ Boolean

:nodoc:

Returns:

  • (Boolean)


9
10
11
# File 'lib/laze/plugins/image_optimizer.rb', line 9

def self.applies_to?(kind) #:nodoc:
  kind == :target
end

Instance Method Details

#saveObject



13
14
15
16
# File 'lib/laze/plugins/image_optimizer.rb', line 13

def save
  optimize_images
  super
end