Merge pull request #11032 from demarches-simplifiees/catch-minimagick-error
Technique : gestion d'une erreur de ImageProcessorJob
This commit is contained in:
commit
00302b858c
1 changed files with 5 additions and 1 deletions
|
@ -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?
|
||||||
png = MiniMagick::Image.open(png_path)
|
begin
|
||||||
|
png = MiniMagick::Image.open(png_path)
|
||||||
|
rescue MiniMagick::Invalid
|
||||||
|
return false
|
||||||
|
end
|
||||||
png.data["interlace"] != "None"
|
png.data["interlace"] != "None"
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in a new issue