bteitelb-paperclip 2.3.1.1 → 2.3.1.2
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/lib/paperclip/attachment.rb +7 -1
- metadata +1 -1
data/lib/paperclip/attachment.rb
CHANGED
|
@@ -432,7 +432,13 @@ module Paperclip
|
|
|
432
432
|
return [nil,nil] unless image?
|
|
433
433
|
return @dimensions[style] unless @dimensions[style].nil?
|
|
434
434
|
w, h = instance_read(:width), instance_read(:height)
|
|
435
|
-
|
|
435
|
+
if w.nil? or h.nil?
|
|
436
|
+
geometry = Paperclip::Geometry.from_file(to_file(style))
|
|
437
|
+
instance_write(:width, geometry.width.to_i)
|
|
438
|
+
instance_write(:height, geometry.height.to_i)
|
|
439
|
+
instance.save
|
|
440
|
+
w, h = geometry.width.to_i, geometry.height.to_i
|
|
441
|
+
end
|
|
436
442
|
if @styles[style].nil? or @styles[style][:geometry].nil?
|
|
437
443
|
@dimensions[style] = [w,h]
|
|
438
444
|
else
|