Merge pull request #11032 from demarches-simplifiees/catch-minimagick-error

Technique : gestion d'une erreur de ImageProcessorJob
This commit is contained in:
Eric Leroy-Terquem 2024-11-08 13:19:37 +00:00 committed by GitHub
commit 00302b858c
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

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