Skip to content

StoreDimensions plugin implemented

Compare
Choose a tag to compare
@igor-alexandrov igor-alexandrov released this 25 May 07:16
· 38 commits to master since this release

The StoreDimensions plugin extracts dimensions of uploaded images and stores them into the metadata.

class Uploader < Shrine
  load_plugin(Shrine::Plugins::StoreDimensions,
    analyzer: Shrine::Plugins::StoreDimensions::Tools::BuiltIn)

  finalize_plugins!
end
image.metadata["width"]
image.metadata["height"]