Don't fail on missing images when resizing

The changed code obtains the image dimensions when you first upload an
image. Unfortunately it's also triggered when thumbnails are refreshed.
That doesn't change the size of the original image though.
This commit is contained in:
Maikel Linke
2020-09-09 14:58:09 +10:00
parent edf9dd7921
commit e6c411684f

View File

@@ -34,6 +34,8 @@ module Spree
end
def find_dimensions
return if attachment.errors.present?
temporary = attachment.queued_for_write[:original]
filename = temporary.path unless temporary.nil?
filename = attachment.path if filename.blank?