From 3d94c671dbb8eb9655cabb3a08df900d104d92e4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9gis=20Hanol?= Date: Fri, 4 Jul 2014 16:05:50 +0200 Subject: [PATCH] BUGFIX: explicit code is often better... --- app/models/optimized_image.rb | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/app/models/optimized_image.rb b/app/models/optimized_image.rb index 08f81730944..478d951c5f6 100644 --- a/app/models/optimized_image.rb +++ b/app/models/optimized_image.rb @@ -83,7 +83,12 @@ class OptimizedImage < ActiveRecord::Base `convert #{instructions}` - ImageOptim.new.optimize_image(to) rescue nil if $?.exitstatus == 0 + if $?.exitstatus == 0 + ImageOptim.new.optimize_image(to) rescue nil + true + else + false + end end end