Merge pull request #5122 from consul/strip-metadata

Remove metadata from images
This commit is contained in:
Sebastia
2023-06-26 15:56:33 +02:00
committed by GitHub
3 changed files with 27 additions and 2 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.5 KiB

View File

@@ -0,0 +1,25 @@
require "rails_helper"
describe "Images" do
before { Setting["uploads.images.min_height"] = 0 }
describe "Metadata" do
let(:image) { create(:image, attachment: fixture_file_upload("logo_header_with_metadata.jpg")) }
scenario "download original images without metadata" do
visit polymorphic_path(image.variant(nil))
file = MiniMagick::Image.open(page.find("img")["src"])
expect(file.exif).to be_empty
end
scenario "download transformed images without metadata" do
visit polymorphic_path(image.variant(:large))
file = MiniMagick::Image.open(page.find("img")["src"])
expect(file.exif).to be_empty
end
end
end