FIX: Ignore invalid images when shrinking uploads (#25346)

This commit is contained in:
Jarek Radosz
2024-01-22 12:10:29 +01:00
committed by GitHub
parent ae2d9de164
commit 5278734fe2
2 changed files with 20 additions and 1 deletions

View File

@ -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"