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.
Files changed (2) hide show
  1. data/lib/paperclip/attachment.rb +7 -1
  2. metadata +1 -1
@@ -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
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.1
4
+ version: 2.3.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jon Yurek