Class: PaperclipCompression::Png
- Defined in:
- lib/paperclip-compression/png.rb
Constant Summary collapse
- OPTIPNG_DEFAULT_OPTS =
'-o 5 -quiet'
Instance Method Summary collapse
-
#initialize(file, first_processor, options = {}) ⇒ Png
constructor
A new instance of Png.
- #make ⇒ Object
Methods inherited from Base
Constructor Details
#initialize(file, first_processor, options = {}) ⇒ Png
Returns a new instance of Png.
6 7 8 9 |
# File 'lib/paperclip-compression/png.rb', line 6 def initialize(file, first_processor, = {}) super(file, first_processor, ) @cli_opts = init_cli_opts(:png, default_opts) end |
Instance Method Details
#make ⇒ Object
11 12 13 14 15 16 17 18 19 |
# File 'lib/paperclip-compression/png.rb', line 11 def make begin process_file? ? process_file : unprocessed_tempfile rescue Cocaine::ExitStatusError => e raise Paperclip::Error, "OPTIPNG : There was an error processing #{@basename}" if @whiny rescue Cocaine::CommandNotFoundError => e raise Paperclip::Errors::CommandNotFoundError.new("Could not run 'optipng'. Please install optipng.") end end |