Sha256: 4a4cfe2f7219c26e76c6b7c3cf7935160f6e13aaee657d4f01bb28e9c0b66baa
Contents?: true
Size: 533 Bytes
Versions: 7
Compression:
Stored size: 533 Bytes
Contents
module Riiif # Get height and width information using imagemagick to interrogate the file class ImageMagickInfoExtractor # perhaps you want to use GraphicsMagick instead, set to "gm identify" class_attribute :external_command self.external_command = 'identify' def initialize(path) @path = path end def extract height, width = Riiif::CommandRunner.execute("#{external_command} -format %hx%w #{@path}[0]").split('x') { height: Integer(height), width: Integer(width) } end end end
Version data entries
7 entries across 7 versions & 1 rubygems