class Filmrolls::Negative

Public Class Methods

new(path) click to toggle source
  # File lib/filmrolls/negative.rb
5 def initialize(path)
6   @file = Exiftool.new(path)
7 end

Public Instance Methods

aperture=(val) click to toggle source
   # File lib/filmrolls/negative.rb
29 def aperture=(val)
30   @file[:ApertureValue] = val
31   @file[:FNumber] = val
32 end
author=(val) click to toggle source
   # File lib/filmrolls/negative.rb
81 def author=(val)
82   @file[:Artist] = val
83   @file['By-Line'] = val
84   @file[:Author] = val
85   @file[:Creator] = val
86   @file['By-lineTitle'] = 'Photographer'
87   @file[:AttributionName] = val if @file[:License]
88 end
author_url=(val) click to toggle source
    # File lib/filmrolls/negative.rb
 99 def author_url=(val)
100   @file[:AttributionURL] = val
101 end
camera=(val) click to toggle source
   # File lib/filmrolls/negative.rb
73 def camera=(val)
74   make = val.strip.split(/\s+/)[0]
75   model = val.strip[(make.length)..-1]
76   @file[:LocalizedCameraModel] = val.strip
77   @file[:Make] = make.strip
78   @file[:Model] = model.strip
79 end
changed?() click to toggle source
   # File lib/filmrolls/negative.rb
21 def changed?
22   @file.changed?
23 end
compensation=(val) click to toggle source
   # File lib/filmrolls/negative.rb
45 def compensation=(val)
46   @file[:ExposureCompensation] = val
47 end
date=(val) click to toggle source
   # File lib/filmrolls/negative.rb
60 def date=(val)
61   @file[:DateTimeOriginal] = val
62 end
film=(val) click to toggle source
   # File lib/filmrolls/negative.rb
56 def film=(val)
57   @file[:UserComment] = val
58 end
lens=(val) click to toggle source
   # File lib/filmrolls/negative.rb
64 def lens=(val)
65   # TODO: this is hacky as f
66   make = val.strip.split(/\s+/)[0]
67   model = val.strip[(make.length)..-1]
68   @file[:Lens] = val.strip
69   @file[:LensMake] = make.strip
70   @file[:LensModel] = model.strip
71 end
license_url=(val) click to toggle source
    # File lib/filmrolls/negative.rb
103 def license_url=(val)
104   @file[:License] = val
105   @file[:AttributionName] = @file[:Artist] if @file[:Artist]
106 end
marked=(val) click to toggle source
    # File lib/filmrolls/negative.rb
108 def marked=(val)
109   @file[:Marked] = val
110 end
merge(args) click to toggle source
   # File lib/filmrolls/negative.rb
 9 def merge(args)
10   args.each do |key, value|
11     method = "#{key}="
12     public_send(method, value) if respond_to? method
13   end
14 end
position=(val) click to toggle source
   # File lib/filmrolls/negative.rb
49 def position=(val)
50   @file[:GPSLatitude] = "#{val.lat} degrees"
51   @file[:GPSLatitudeRef] = 'North'
52   @file[:GPSLongitude] = "#{val.lng} degrees"
53   @file[:GPSLongitudeRef] = 'East'
54 end
save!() click to toggle source
   # File lib/filmrolls/negative.rb
25 def save!
26   @file.save!
27 end
shutter_speed=(val) click to toggle source
   # File lib/filmrolls/negative.rb
40 def shutter_speed=(val)
41   @file[:ExposureTime] = val
42   @file[:ShutterSpeedValue] = val.to_f
43 end
speed=(val) click to toggle source
   # File lib/filmrolls/negative.rb
34 def speed=(val)
35   @file[:ISO] = val
36   @file[:ISOSpeed] = val
37   @file[:SensitivityType] = 'ISO Speed'
38 end
to_s() click to toggle source
   # File lib/filmrolls/negative.rb
16 def to_s
17   require 'yaml'
18   @file.to_yaml
19 end
usage_terms=(val) click to toggle source
    # File lib/filmrolls/negative.rb
112 def usage_terms=(val)
113   @file[:UsageTerms] = val
114 end