We’ve had quite a few reports on PNG’s failing image uploads on our install at v1.9.0.beta15 +27. It seems to only be certain PNG’s and not just based on size. It is particularly unfortunate for us because it now fails on the screenshots of a game the forum is based on, so many users are finding the issue. It has only recently started to happen (my guess would be around the Rails 5 or so update for 1.9, but not sure).
I’ve recreated a test case on try.discourse.com and will try to recreate here.
A test image can be found in here:
The error log we see seems to indicate it is related to the conversion to JPG:
/var/www/discourse/lib/discourse.rb:27:in `execute_command' /var/www/discourse/lib/upload_creator.rb:137:in `convert_to_jpeg!' /var/www/discourse/lib/upload_creator.rb:44:in `block in create_for' /var/www/discourse/lib/distributed_mutex.rb:21:in `synchronize' /var/www/discourse/lib/distributed_mutex.rb:5:in `synchronize' /var/www/discourse/lib/upload_creator.rb:36:in `create_for' /var/www/discourse/app/controllers/uploads_controller.rb:116:in `create_upload' /var/www/discourse/app/controllers/uploads_controller.rb:29:in `block in create' /var/www/discourse/lib/hijack.rb:43:in `instance_eval' /var/www/discourse/lib/hijack.rb:43:in `block in hijack' /var/www/discourse/lib/scheduler/defer.rb:74:in `block in do_work' /var/www/discourse/vendor/bundle/ruby/2.4.0/gems/rails_multisite-1.1.2/lib/rails_multisite/connection_management.rb:77:in `with_connection' /var/www/discourse/lib/scheduler/defer.rb:72:in `do_work' /var/www/discourse/lib/scheduler/defer.rb:61:in `block (2 levels) in start_thread'
Here is a working PNG:
Here is the non-working PNG (you should have the error now in your logs):
Thanks for any help, plus let us know if there is any more info I can provide.