bteitelb-paperclip 2.3.1.8 → 2.3.1.9
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 +6 -5
- metadata +1 -1
data/lib/paperclip/attachment.rb
CHANGED
|
@@ -444,16 +444,17 @@ module Paperclip
|
|
|
444
444
|
return @dimensions[style] unless @dimensions[style].nil?
|
|
445
445
|
w, h = instance_read(:width), instance_read(:height)
|
|
446
446
|
if w.nil? or h.nil?
|
|
447
|
-
geometry = Paperclip::Geometry.from_file(to_file(
|
|
448
|
-
instance_write(:width, geometry.width.to_i)
|
|
449
|
-
instance_write(:height, geometry.height.to_i)
|
|
450
|
-
instance.save unless instance.readonly?
|
|
447
|
+
geometry = Paperclip::Geometry.from_file(to_file(:original))
|
|
451
448
|
w, h = geometry.width.to_i, geometry.height.to_i
|
|
449
|
+
instance_write(:width, w)
|
|
450
|
+
instance_write(:height, h)
|
|
451
|
+
instance.save unless instance.readonly?
|
|
452
452
|
end
|
|
453
453
|
if @styles[style].nil? or @styles[style][:geometry].nil?
|
|
454
|
-
|
|
454
|
+
return [nil, nil]
|
|
455
455
|
else
|
|
456
456
|
@dimensions[style] = Geometry.parse(@styles[style][:geometry]).new_dimensions_for(w, h)
|
|
457
|
+
return @dimensions[style]
|
|
457
458
|
end
|
|
458
459
|
end
|
|
459
460
|
|