Sha256: 923d87e00cf45cc400f84bced4da8b37d04541bfec2c00ba93d8f7082c49a15a

Contents?: true

Size: 366 Bytes

Versions: 9

Compression:

Stored size: 366 Bytes

Contents

module Riiif
  # Get height and width information using imagemagick to interrogate the file
  class ImageMagickInfoExtractor
    def initialize(path)
      @path = path
    end

    def extract
      height, width = Riiif::CommandRunner.execute("identify -format %hx%w #{@path}").split('x')
      { height: Integer(height), width: Integer(width) }
    end
  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
riiif-1.4.4 app/services/riiif/image_magick_info_extractor.rb
riiif-1.4.3 app/services/riiif/image_magick_info_extractor.rb
riiif-1.4.2 app/services/riiif/image_magick_info_extractor.rb
riiif-1.4.1 app/services/riiif/image_magick_info_extractor.rb
riiif-1.4.0 app/services/riiif/image_magick_info_extractor.rb
riiif-1.3.0 app/services/riiif/image_magick_info_extractor.rb
riiif-1.2.0 app/services/riiif/image_magick_info_extractor.rb
riiif-1.1.3 app/services/riiif/image_magick_info_extractor.rb
riiif-1.1.2 app/services/riiif/image_magick_info_extractor.rb