module Exif::MakerNote

Public Class Methods

prove(data, tag_make=nil, tag_model=nil) click to toggle source
# File lib/exifparser/makernote/prove.rb, line 27
def prove(data, tag_make=nil, tag_model=nil)

  make = tag_make == nil ? '' : tag_make.to_s.upcase
  model = tag_model == nil ? '' : tag_model.to_s.upcase

  #
  # Identifier for OLYMPUS
  #
  if data[0..5] == "OLYMP\000"
    return Olympus
  #
  # Identifier for FUJIFILM
  #
  elsif data[0..7] == "FUJIFILM"
    return Fujifilm

  #
  # Identifier for Nikon
  #

  elsif make[0..4] == 'NIKON'
    if data[0..5] == "Nikon\000"
      if data[6] == 0x01 && data[7] == 0x00
        return Nikon
      end
    end
    return Nikon2

  #
  # Canon
  #
  elsif make[0..4] == 'CANON'
    return Canon

  #
  # Minolta
  #
  elsif make[0..6] == 'MINOLTA'
    return Minolta

  #
  # Sigma
  #
  elsif make[0..4] == 'SIGMA'
    return Sigma

  #
  # Sony
  #
  elsif make[0..3] == 'SONY'
    return Sony

  end

  #
  # If none above is applied, raises exception,
  # which will be caught by caller's rescue statement.
  #
  raise NotSupportedError
end

Private Instance Methods

prove(data, tag_make=nil, tag_model=nil) click to toggle source
# File lib/exifparser/makernote/prove.rb, line 27
def prove(data, tag_make=nil, tag_model=nil)

  make = tag_make == nil ? '' : tag_make.to_s.upcase
  model = tag_model == nil ? '' : tag_model.to_s.upcase

  #
  # Identifier for OLYMPUS
  #
  if data[0..5] == "OLYMP\000"
    return Olympus
  #
  # Identifier for FUJIFILM
  #
  elsif data[0..7] == "FUJIFILM"
    return Fujifilm

  #
  # Identifier for Nikon
  #

  elsif make[0..4] == 'NIKON'
    if data[0..5] == "Nikon\000"
      if data[6] == 0x01 && data[7] == 0x00
        return Nikon
      end
    end
    return Nikon2

  #
  # Canon
  #
  elsif make[0..4] == 'CANON'
    return Canon

  #
  # Minolta
  #
  elsif make[0..6] == 'MINOLTA'
    return Minolta

  #
  # Sigma
  #
  elsif make[0..4] == 'SIGMA'
    return Sigma

  #
  # Sony
  #
  elsif make[0..3] == 'SONY'
    return Sony

  end

  #
  # If none above is applied, raises exception,
  # which will be caught by caller's rescue statement.
  #
  raise NotSupportedError
end