Class: PaperclipCompression::Jpeg
- Defined in:
- lib/paperclip-compression/jpeg.rb
Constant Summary collapse
- KEY =
:jpeg
- JPEGTRAN_DEFAULT_OPTS =
'-copy none -optimize -perfect'
Instance Method Summary collapse
-
#initialize(file, first_processor, options = {}) ⇒ Jpeg
constructor
A new instance of Jpeg.
- #make ⇒ Object
Methods inherited from Base
Constructor Details
#initialize(file, first_processor, options = {}) ⇒ Jpeg
Returns a new instance of Jpeg.
7 8 9 10 |
# File 'lib/paperclip-compression/jpeg.rb', line 7 def initialize(file, first_processor, = {}) super(file, first_processor) @config = PaperclipCompression::Config.create_with_fallbacks(, KEY, gem_defaults) end |
Instance Method Details
#make ⇒ Object
12 13 14 15 16 17 18 19 20 |
# File 'lib/paperclip-compression/jpeg.rb', line 12 def make begin @config.process_file? ? process_file : unprocessed_tempfile rescue ExitStatusError raise Paperclip::Error, "JPEGTRAN : There was an error processing #{@basename}" if @config.whiny rescue CommandNotFoundError raise Paperclip::Errors::CommandNotFoundError.new("Could not run 'jpegtran'. Please install jpegtran.") end end |