Class: Imagecache::Identify
- Inherits:
-
Object
- Object
- Imagecache::Identify
- Defined in:
- lib/imagecache/identify.rb
Instance Method Summary collapse
Instance Method Details
#identify(file) ⇒ Object
6 7 8 9 10 11 12 |
# File 'lib/imagecache/identify.rb', line 6 def identify(file) output = `identify -verbose #{file.path}` geometry = output.match(/Geometry: (\d*)x(\d*)\+(\d*)\+(\d*)$/) created = output.match(/date:create: (.*)$/) content_type = output.match(/Mime type: (.*)$/) OpenStruct.new(width: geometry[1].to_i, height: geometry[2].to_i, created: created[1], content_type: content_type[1]) end |