PERF: Use `-ping` option to ImageMagick `identify` command (#25713)

Why this change?

This adds the `-ping` option to the spots we missed in
cfdb461e9a.
This commit is contained in:
Alan Guo Xiang Tan 2024-02-16 07:39:49 +08:00 committed by GitHub
parent d119ec617e
commit cc9480b24a
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 2 additions and 1 deletions

View File

@ -414,6 +414,7 @@ class Upload < ActiveRecord::Base
begin
Discourse::Utils.execute_command(
"identify",
"-ping",
"-format",
"%Q",
local_path,

View File

@ -147,7 +147,7 @@ RSpec.describe UploadCreator do
describe "converting to jpeg" do
def 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_i
end
let(:filename) { "should_be_jpeg.png" }