From 140d9c2910fdfffbb27f1c8c439a3e9acc875e32 Mon Sep 17 00:00:00 2001 From: Penar Musaraj Date: Thu, 29 Nov 2018 15:03:02 -0500 Subject: [PATCH] FIX: call ImageSizer only if width/height are available --- app/models/upload.rb | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/app/models/upload.rb b/app/models/upload.rb index bf3d415515..802be437e7 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