mirror of
https://github.com/discourse/discourse.git
synced 2025-09-06 10:50:21 +08:00
Fix broken optimize image command.
This commit is contained in:
parent
a1d04a7a9a
commit
ddc8abf9d8
1 changed files with 5 additions and 1 deletions
|
@ -215,7 +215,11 @@ class OptimizedImage < ActiveRecord::Base
|
||||||
end
|
end
|
||||||
|
|
||||||
def self.convert_with(instructions, to)
|
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)
|
ImageOptim.new.optimize_image!(to)
|
||||||
true
|
true
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue