bteitelb-paperclip 2.3.1.9 → 2.3.1.10
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 +4 -9
- metadata +1 -1
data/lib/paperclip/attachment.rb
CHANGED
|
@@ -438,9 +438,6 @@ module Paperclip
|
|
|
438
438
|
|
|
439
439
|
def dimensions style = default_style
|
|
440
440
|
return [nil,nil] unless image?
|
|
441
|
-
if @styles[style]
|
|
442
|
-
return @styles[style][:geometry].match(/(\d*)x(\d*)/)[1,2].map {|s| s.to_i}
|
|
443
|
-
end
|
|
444
441
|
return @dimensions[style] unless @dimensions[style].nil?
|
|
445
442
|
w, h = instance_read(:width), instance_read(:height)
|
|
446
443
|
if w.nil? or h.nil?
|
|
@@ -450,12 +447,10 @@ module Paperclip
|
|
|
450
447
|
instance_write(:height, h)
|
|
451
448
|
instance.save unless instance.readonly?
|
|
452
449
|
end
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
return @dimensions[style]
|
|
458
|
-
end
|
|
450
|
+
return [w, h] if style == :original
|
|
451
|
+
return [nil, nil] if @styles[style].nil? or @styles[style][:geometry].nil?
|
|
452
|
+
@dimensions[style] = Geometry.parse(@styles[style][:geometry]).new_dimensions_for(w, h)
|
|
453
|
+
return @dimensions[style]
|
|
459
454
|
end
|
|
460
455
|
|
|
461
456
|
def queue_existing_for_delete #:nodoc:
|