Class: Paperclip::GeometryDetector

Inherits:
Object
  • Object
show all
Defined in:
lib/paperclip/geometry_detector_factory.rb

Instance Method Summary collapse

Constructor Details

#initialize(file) ⇒ GeometryDetector

Returns a new instance of GeometryDetector.



3
4
5
6
# File 'lib/paperclip/geometry_detector_factory.rb', line 3

def initialize(file)
  @file = file
  raise_if_blank_file
end

Instance Method Details

#makeObject



8
9
10
11
# File 'lib/paperclip/geometry_detector_factory.rb', line 8

def make
  geometry = GeometryParser.new(geometry_string.strip).make
  geometry || raise(Errors::NotIdentifiedByImageMagickError.new("Could not identify image size"))
end