mirror of
https://github.com/discourse/discourse.git
synced 2025-06-05 14:07:30 +08:00
FIX: Ignore invalid images when shrinking uploads (#25346)
This commit is contained in:
@ -40,7 +40,11 @@ class ShrinkUploadedImage
|
||||
return false
|
||||
end
|
||||
|
||||
w, h = FastImage.size(path, timeout: 15, raise_on_failure: true)
|
||||
begin
|
||||
w, h = FastImage.size(path, timeout: 15, raise_on_failure: true)
|
||||
rescue FastImage::SizeNotFound
|
||||
return false
|
||||
end
|
||||
|
||||
if !w || !h
|
||||
log "Invalid image dimensions after resizing"
|
||||
|
Reference in New Issue
Block a user