mmb-iphone_polaroid 0.0.2 → 0.0.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/README.textile +1 -1
- data/iphone_polaroid.gemspec +1 -1
- data/lib/iphone_polaroid.rb +16 -10
- metadata +1 -1
data/README.textile
CHANGED
data/iphone_polaroid.gemspec
CHANGED
data/lib/iphone_polaroid.rb
CHANGED
@@ -50,7 +50,7 @@ module IPhonePolaroid
|
|
50
50
|
@lon
|
51
51
|
end
|
52
52
|
|
53
|
-
def
|
53
|
+
def iphone_polaroid(options={})
|
54
54
|
o = {
|
55
55
|
:photo_width => 216,
|
56
56
|
:photo_height => 225,
|
@@ -83,21 +83,27 @@ module IPhonePolaroid
|
|
83
83
|
img = border.composite(img, Magick::NorthWestGravity, o[:border_width],
|
84
84
|
o[:border_width], Magick::OverCompositeOp)
|
85
85
|
|
86
|
-
|
86
|
+
unless exif.date_time.nil?
|
87
|
+
caption = exif.date_time.strftime('%m/%d/%Y').sub(/(^|\/)0/, '\1')
|
88
|
+
else
|
89
|
+
caption = ''
|
90
|
+
end
|
87
91
|
|
88
92
|
unless lat.nil? or lon.nil?
|
89
93
|
caption =
|
90
94
|
"#{caption} #{IPhonePolaroid.lat_lon_to_city_state(lat, lon)}"
|
91
95
|
end
|
92
96
|
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
97
|
+
unless caption.empty?
|
98
|
+
text = Magick::Draw.new
|
99
|
+
text.annotate(img, 0, 0, 0, o[:border_width], caption) {
|
100
|
+
self.fill = o[:text_fill]
|
101
|
+
self.font = o[:text_font]
|
102
|
+
self.gravity = o[:text_gravity]
|
103
|
+
self.pointsize = o[:text_size]
|
104
|
+
self.stroke = o[:text_stroke]
|
105
|
+
}
|
106
|
+
end
|
101
107
|
|
102
108
|
img.background_color = 'none'
|
103
109
|
amplitude = img.columns * o[:amplitude]
|