Module: Imgproxy::OptionsCasters::JpegOptions

Defined in:
lib/imgproxy/options_casters/jpeg_options.rb

Overview

Casts ‘jpeg_options` processing option

Constant Summary collapse

CASTER =
Imgproxy::OptionsCasters::Group.new(
  progressive: Imgproxy::OptionsCasters::Bool,
  no_subsample: Imgproxy::OptionsCasters::Bool,
  trellis_quant: Imgproxy::OptionsCasters::Bool,
  overshoot_deringing: Imgproxy::OptionsCasters::Bool,
  optimize_scans: Imgproxy::OptionsCasters::Bool,
  quant_table: Imgproxy::OptionsCasters::Integer,
).freeze

Class Method Summary collapse

Class Method Details

.cast(raw) ⇒ Object



20
21
22
23
24
25
# File 'lib/imgproxy/options_casters/jpeg_options.rb', line 20

def self.cast(raw)
  return raw unless raw.is_a?(Hash)

  values = CASTER.cast(raw)
  values.empty? ? nil : values
end