From 4eba71fb26cd9b6bf373bd457dcede9a3b426879 Mon Sep 17 00:00:00 2001 From: Ivan Kuchin Date: Sun, 22 Jul 2018 15:04:43 +0200 Subject: [PATCH] ignore segmentation fault for pngout <= 20150920, resolves #158 --- lib/image_optim/worker/pngout.rb | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lib/image_optim/worker/pngout.rb b/lib/image_optim/worker/pngout.rb index 9823ab03..ffa69d04 100644 --- a/lib/image_optim/worker/pngout.rb +++ b/lib/image_optim/worker/pngout.rb @@ -32,6 +32,10 @@ def optimize(src, dst) #{dst} ] execute(:pngout, *args) && optimized?(src, dst) + rescue SignalException => e + raise unless Signal.list.key(e.signo) == 'SEGV' + raise unless resolve_bin!(:pngout).version <= '20150920' + warn "pngout caused Segmentation fault for #{src}" end end end