diff --git a/app/models/optimized_image.rb b/app/models/optimized_image.rb index 96da29e0554..5cdc0e1e63c 100644 --- a/app/models/optimized_image.rb +++ b/app/models/optimized_image.rb @@ -255,7 +255,15 @@ class OptimizedImage < ActiveRecord::Base if opts[:raise_on_error] raise e else - Discourse.warn("Failed to optimize image", location: to, error_message: e.message) + error = +"Failed to optimize image:" + + if e.message =~ /^convert:([^`]+)/ + error << $1 + else + error << " unknown reason" + end + + Discourse.warn(error, location: to, error_message: e.message) false end end