Module: Shrine::Plugins::StoreDimensions::InstanceMethods

Defined in:
lib/shrine/plugins/store_dimensions.rb

Instance Method Summary collapse

Instance Method Details

#extract_metadata(io, **options) ⇒ Object


74
75
76
77
78
79
80
81
# File 'lib/shrine/plugins/store_dimensions.rb', line 74

def (io, **options)
  return super unless opts[:store_dimensions][:auto_extraction]

  # We update the metadata with "width" and "height".
  width, height = self.class.extract_dimensions(io)

  super.merge!("width" => width, "height" => height)
end