Class: ExifExtractor

Inherits:
Object
  • Object
show all
Defined in:
lib/filentory/exifextractor.rb

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.handles?(file_extension) ⇒ Boolean

Returns:

  • (Boolean)


20
21
22
# File 'lib/filentory/exifextractor.rb', line 20

def self.handles?(file_extension)
  [".jpg", ".jpeg", ".tiff"].include? file_extension
end

Instance Method Details

#metadata_for_file(file_path) ⇒ Object



6
7
8
9
10
11
12
13
14
15
16
17
18
# File 'lib/filentory/exifextractor.rb', line 6

def (file_path)
  img = EXIFR::JPEG.new(file_path)

  xmpValues = Hash.new

  (img, xmpValues)
  (img, xmpValues)       
  extract_gps_infos(img, xmpValues)

  xmpValues.delete_if { |k, v| v.nil? || v.to_s.empty?}
rescue => error
  Hash.new
end