FIX: Do not optimize uploaded custom emoji (#11203)

Animated emojis were converted to static images. This commit moves the
responsability on site admins to optimize their animated emojis before
uploading them (gifsicle is no longer used).
This commit is contained in:
Bianca Nenciu
2020-11-12 02:22:38 +02:00
committed by GitHub
parent 5d480257d4
commit 2910996feb
2 changed files with 17 additions and 0 deletions

View File

@ -443,6 +443,21 @@ RSpec.describe UploadCreator do
end
end
end
context 'custom emojis' do
let(:animated_filename) { "animated.gif" }
let(:animated_file) { file_from_fixtures(animated_filename) }
it 'should not be cropped if animated' do
upload = UploadCreator.new(animated_file, animated_filename,
force_optimize: true,
type: 'custom_emoji'
).create_for(user.id)
expect(upload.animated).to eq(true)
expect(FastImage.size(Discourse.store.path_for(upload))).to eq([320, 320])
end
end
end
describe '#clean_svg!' do