Fix broken optimize image command.

This commit is contained in:
Guo Xiang Tan 2017-03-20 15:07:38 +08:00
parent a1d04a7a9a
commit ddc8abf9d8
1 changed files with 5 additions and 1 deletions

View File

@ -215,7 +215,11 @@ class OptimizedImage < ActiveRecord::Base
end
def self.convert_with(instructions, to)
return false unless system(instructions.join(" "), '&> /dev/null')
begin
Discourse::Utils.execute_command(*instructions)
rescue
return false
end
ImageOptim.new.optimize_image!(to)
true