Class: BPL::Derivatives::Processors::Image
- Defined in:
- lib/bpl/derivatives/processors/image.rb
Direct Known Subclasses
Instance Attribute Summary
Attributes inherited from Processor
#directives, #object, #output_file_service, #source_path
Instance Method Summary collapse
Methods inherited from Processor
#finalize_derivative_output, #initialize, #output_file, #output_file_id, #output_filename_for
Constructor Details
This class inherits a constructor from BPL::Derivatives::Processors::Processor
Instance Method Details
#process ⇒ Object
7 8 9 |
# File 'lib/bpl/derivatives/processors/image.rb', line 7 def process timeout ? process_with_timeout : create_resized_image end |
#process_with_timeout ⇒ Object
11 12 13 14 15 |
# File 'lib/bpl/derivatives/processors/image.rb', line 11 def process_with_timeout Timeout.timeout(timeout) { create_resized_image } rescue Timeout::Error raise BPL::Derivatives::TimeoutError, "Unable to process image derivative\nThe command took longer than #{timeout} seconds to execute" end |