mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
FIX: raise exception when getting dimensions of missing image
- follow-up on 0eacd45ab1
This commit is contained in:
@@ -127,8 +127,12 @@ class Upload < ActiveRecord::Base
|
||||
Discourse.store.download(self).path
|
||||
end
|
||||
|
||||
self.width, self.height = size = FastImage.new(path).size
|
||||
self.thumbnail_width, self.thumbnail_height = ImageSizer.resize(*size)
|
||||
begin
|
||||
self.width, self.height = size = FastImage.new(path, raise_on_failure: true).size
|
||||
self.thumbnail_width, self.thumbnail_height = ImageSizer.resize(*size)
|
||||
rescue => e
|
||||
Discourse.warn_exception(e, message: "Error getting image dimensions")
|
||||
end
|
||||
nil
|
||||
end
|
||||
|
||||
|
||||
Reference in New Issue
Block a user