Convert HEIC uploads to JPG by default (#10395)

Convert HEIC uploads to JPG by default (#10395)

diff --git a/config/site_settings.yml b/config/site_settings.yml
index e4b8b3f..375834f 100644
--- a/config/site_settings.yml
+++ b/config/site_settings.yml
@@ -1181,7 +1181,7 @@ files:
     list_type: compact
   authorized_extensions:
     client: true
-    default: "jpg|jpeg|png|gif"
+    default: "jpg|jpeg|png|gif|heic|heif"
     refresh: true
     type: list
     list_type: compact
@@ -1326,8 +1326,6 @@ files:
   decompressed_backup_max_file_size_mb:
     default: 100000
     hidden: true
-  convert_heif_to_jpeg:
-    default: false
 
 trust:
   default_trust_level:
diff --git a/lib/upload_creator.rb b/lib/upload_creator.rb
index f3d76cb..b0e041a 100644
--- a/lib/upload_creator.rb
+++ b/lib/upload_creator.rb
@@ -218,7 +218,7 @@ class UploadCreator
   end
 
   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
 
   def convert_heif!
diff --git a/spec/lib/upload_creator_spec.rb b/spec/lib/upload_creator_spec.rb
index 6ca63b7..492bb44 100644
--- a/spec/lib/upload_creator_spec.rb
+++ b/spec/lib/upload_creator_spec.rb
@@ -174,11 +174,6 @@ RSpec.describe UploadCreator do
       let(:filename) { "should_be_jpeg.heic" }
       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
         expect do
           UploadCreator.new(file, filename).create_for(user.id)

GitHub sha: 86cb5803

1 Like

This commit appears in #10395 which was approved by eviltrout. It was merged by pmusaraj.