fix(image processing): catch minimagick error caused by png path

This commit is contained in:
Eric Leroy-Terquem 2024-11-07 12:05:04 +01:00
parent ae7260829d
commit 523c56f60b
No known key found for this signature in database
GPG key ID: 53D8FAECEF207605

View file

@ -18,7 +18,11 @@ class UninterlaceService
def interlaced?(png_path)
return false if png_path.blank?
png = MiniMagick::Image.open(png_path)
begin
png = MiniMagick::Image.open(png_path)
rescue MiniMagick::Invalid
return false
end
png.data["interlace"] != "None"
end
end