FIX: call ImageSizer only if width/height are available

FIX: call ImageSizer only if width/height are available

From 140d9c2910fdfffbb27f1c8c439a3e9acc875e32 Mon Sep 17 00:00:00 2001
From: Penar Musaraj <pmusaraj@gmail.com>
Date: Thu, 29 Nov 2018 15:03:02 -0500
Subject: [PATCH] FIX: call ImageSizer only if width/height are available


diff --git a/app/models/upload.rb b/app/models/upload.rb
index bf3d415..802be43 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

GitHub

approving, followup is here :slight_smile: