mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
Convert HEIC uploads to JPG by default (#10395)
This commit is contained in:
parent
c5c5bb4fad
commit
86cb5803ba
@ -1181,7 +1181,7 @@ files:
|
|||||||
list_type: compact
|
list_type: compact
|
||||||
authorized_extensions:
|
authorized_extensions:
|
||||||
client: true
|
client: true
|
||||||
default: "jpg|jpeg|png|gif"
|
default: "jpg|jpeg|png|gif|heic|heif"
|
||||||
refresh: true
|
refresh: true
|
||||||
type: list
|
type: list
|
||||||
list_type: compact
|
list_type: compact
|
||||||
@ -1326,8 +1326,6 @@ files:
|
|||||||
decompressed_backup_max_file_size_mb:
|
decompressed_backup_max_file_size_mb:
|
||||||
default: 100000
|
default: 100000
|
||||||
hidden: true
|
hidden: true
|
||||||
convert_heif_to_jpeg:
|
|
||||||
default: false
|
|
||||||
|
|
||||||
trust:
|
trust:
|
||||||
default_trust_level:
|
default_trust_level:
|
||||||
|
@ -218,7 +218,7 @@ class UploadCreator
|
|||||||
end
|
end
|
||||||
|
|
||||||
def convert_heif_to_jpeg?
|
def convert_heif_to_jpeg?
|
||||||
SiteSetting.convert_heif_to_jpeg && File.extname(@filename).downcase.match?(/\.hei(f|c)$/)
|
File.extname(@filename).downcase.match?(/\.hei(f|c)$/)
|
||||||
end
|
end
|
||||||
|
|
||||||
def convert_heif!
|
def convert_heif!
|
||||||
|
@ -174,11 +174,6 @@ RSpec.describe UploadCreator do
|
|||||||
let(:filename) { "should_be_jpeg.heic" }
|
let(:filename) { "should_be_jpeg.heic" }
|
||||||
let(:file) { file_from_fixtures(filename, "images") }
|
let(:file) { file_from_fixtures(filename, "images") }
|
||||||
|
|
||||||
before do
|
|
||||||
SiteSetting.convert_heif_to_jpeg = true
|
|
||||||
SiteSetting.authorized_extensions = 'jpg|heic'
|
|
||||||
end
|
|
||||||
|
|
||||||
it 'should store the upload with the right extension' do
|
it 'should store the upload with the right extension' do
|
||||||
expect do
|
expect do
|
||||||
UploadCreator.new(file, filename).create_for(user.id)
|
UploadCreator.new(file, filename).create_for(user.id)
|
||||||
|
Loading…
Reference in New Issue
Block a user