Class: XMP::Handler::ExifrJPEG

Inherits:
Object
  • Object
show all
Defined in:
lib/xmp/handler/exifr_jpeg.rb

Instance Method Summary collapse

Instance Method Details

#call(object) ⇒ Object



9
10
11
12
13
# File 'lib/xmp/handler/exifr_jpeg.rb', line 9

def call(object)
  return unless defined?(EXIFR::JPEG) && object.is_a?(EXIFR::JPEG)
  xmp_chunk = object.app1s.find { |a| a =~ %r|\Ahttp://ns.adobe.com/xap/1.0/| }
  xmp_chunk ? xmp_chunk.split("\000")[1] : XMP::Document.new
end