mirror of
https://github.com/discourse/discourse.git
synced 2025-04-19 16:29:05 +08:00
PERF: Use -ping
option to ImageMagick identify
command (#25713)
Why this change? This adds the `-ping` option to the spots we missed in cfdb461e9a4e791dfa604cfb14be503c0932481e.
This commit is contained in:
parent
d119ec617e
commit
cc9480b24a
@ -414,6 +414,7 @@ class Upload < ActiveRecord::Base
|
|||||||
begin
|
begin
|
||||||
Discourse::Utils.execute_command(
|
Discourse::Utils.execute_command(
|
||||||
"identify",
|
"identify",
|
||||||
|
"-ping",
|
||||||
"-format",
|
"-format",
|
||||||
"%Q",
|
"%Q",
|
||||||
local_path,
|
local_path,
|
||||||
|
@ -147,7 +147,7 @@ RSpec.describe UploadCreator do
|
|||||||
describe "converting to jpeg" do
|
describe "converting to jpeg" do
|
||||||
def image_quality(path)
|
def image_quality(path)
|
||||||
local_path = File.join(Rails.root, "public", 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
|
end
|
||||||
|
|
||||||
let(:filename) { "should_be_jpeg.png" }
|
let(:filename) { "should_be_jpeg.png" }
|
||||||
|
Loading…
x
Reference in New Issue
Block a user