Module: Imgproxy::OptionsCasters::JpegOptions

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

Overview

Casts jpeg_options 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



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

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

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