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.
Files changed (2) hide show
  1. data/lib/paperclip/attachment.rb +6 -5
  2. metadata +1 -1
@@ -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(style))
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
- @dimensions[style] = [w,h]
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
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: bteitelb-paperclip
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.3.1.8
4
+ version: 2.3.1.9
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jon Yurek