A platform for community discussion. Free, open, simple.
PERF: Use `-ping` option to ImageMagick `identify` command (#25713)
Alan Guo Xiang Tancc9480b24af1
diff --git a/app/models/upload.rb b/app/models/upload.rbindex 5b02962a3a4..665ac847ed3 100644--- a/app/models/upload.rb+++ b/app/models/upload.rb@@ -414,6 +414,7 @@ class Upload < ActiveRecord::BasebeginDiscourse::Utils.execute_command("identify",+ "-ping","-format","%Q",local_path,diff --git a/spec/lib/upload_creator_spec.rb b/spec/lib/upload_creator_spec.rbindex a340c029aa6..e6f93f20fba 100644--- a/spec/lib/upload_creator_spec.rb+++ b/spec/lib/upload_creator_spec.rb@@ -147,7 +147,7 @@ RSpec.describe UploadCreator dodescribe "converting to jpeg" dodef image_quality(path)local_path = File.join(Rails.root, "public", path)- Discourse::Utils.execute_command("identify", "-format", "%Q", local_path).to_i+ Discourse::Utils.execute_command("identify", "-ping", "-format", "%Q", local_path).to_iendlet(:filename) { "should_be_jpeg.png" }