Skip to content

A platform for community discussion. Free, open, simple.

FIX: call ImageSizer only if width/height are available

Penar Musaraj140d9c2910fd
diff --git a/app/models/upload.rb b/app/models/upload.rb
index bf3d4155154..802be437e74 100644
--- a/app/models/upload.rb
+++ b/app/models/upload.rb
@@ -128,7 +128,9 @@ class Upload < ActiveRecord::Base
end
self.width, self.height = size = FastImage.new(path).size
- self.thumbnail_width, self.thumbnail_height = ImageSizer.resize(*size)
+ if !size.blank?
+ self.thumbnail_width, self.thumbnail_height = ImageSizer.resize(*size)
+ end
nil
end