FIX: Do not downsize or crop GIF images (#10989)

It was a problem because during this operation only the first frame
is kept. This commit removes the alternative solution to check if a GIF
image is animated.
This commit is contained in:
Bianca Nenciu
2021-01-12 17:07:07 +02:00
committed by GitHub
parent 0e8e3f4813
commit 499a594754
3 changed files with 22 additions and 26 deletions

View File

@@ -497,4 +497,20 @@ RSpec.describe UploadCreator do
end
end
end
describe '#should_downsize?' do
context "GIF image" do
let(:gif_file) { file_from_fixtures("animated.gif") }
before do
SiteSetting.max_image_size_kb = 1
end
it "is not downsized" do
creator = UploadCreator.new(gif_file, "animated.gif")
creator.extract_image_info!
expect(creator.should_downsize?).to eq(false)
end
end
end
end