0
0
Fork 0

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:
Eugen 2017-04-11 00:38:58 +02:00 committed by GitHub
parent b57eed4584
commit 12f72e1740
15 changed files with 108 additions and 138 deletions

View file

@ -92,5 +92,17 @@ namespace :mastodon do
Rails.logger.debug 'Done!'
end
desc 'Generate static versions of GIF avatars/headers'
task add_static_avatars: :environment do
Rails.logger.debug 'Generating static avatars/headers for GIF ones...'
Account.unscoped.where(avatar_content_type: 'image/gif').or(Account.unscoped.where(header_content_type: 'image/gif')).find_each do |account|
account.avatar.reprocess!
account.header.reprocess!
end
Rails.logger.debug 'Done!'
end
end
end