When avatar/header are GIF, generate static versions (#1428)
* When avatar/header are GIF, generate static versions. Account API returns "avatar"/"avatar_static", "header"/"header_static" Static version is the same as original for other cases Web UI de-animates avatars in toots, lists of users Fix #441, fix #596, prerequisite for #1064 * Fix JS test * Add rake task to generate static avatars/headers from GIF ones, add test
This commit is contained in:
parent
b57eed4584
commit
12f72e1740
15 changed files with 108 additions and 138 deletions
|
@ -421,4 +421,24 @@ RSpec.describe Account, type: :model do
|
|||
end
|
||||
end
|
||||
end
|
||||
|
||||
describe 'static avatars' do
|
||||
describe 'when GIF' do
|
||||
it 'creates a png static style' do
|
||||
subject.avatar = attachment_fixture('avatar.gif')
|
||||
subject.save
|
||||
|
||||
expect(subject.avatar_static_url).to_not eq subject.avatar_original_url
|
||||
end
|
||||
end
|
||||
|
||||
describe 'when non-GIF' do
|
||||
it 'does not create extra static style' do
|
||||
subject.avatar = attachment_fixture('attachment.jpg')
|
||||
subject.save
|
||||
|
||||
expect(subject.avatar_static_url).to eq subject.avatar_original_url
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue