Class: Riiif::ImageMagickInfoExtractor
- Inherits:
-
Object
- Object
- Riiif::ImageMagickInfoExtractor
- Defined in:
- app/services/riiif/image_magick_info_extractor.rb
Overview
Get height and width information using imagemagick to interrogate the file
Instance Method Summary collapse
- #extract ⇒ Object
-
#initialize(path) ⇒ ImageMagickInfoExtractor
constructor
A new instance of ImageMagickInfoExtractor.
Constructor Details
#initialize(path) ⇒ ImageMagickInfoExtractor
Returns a new instance of ImageMagickInfoExtractor.
8 9 10 |
# File 'app/services/riiif/image_magick_info_extractor.rb', line 8 def initialize(path) @path = path end |
Instance Method Details
#extract ⇒ Object
12 13 14 15 |
# File 'app/services/riiif/image_magick_info_extractor.rb', line 12 def extract height, width = Riiif::CommandRunner.execute("#{external_command} -format %hx%w #{@path}[0]").split('x') { height: Integer(height), width: Integer(width) } end |