FIX: respect the allow_animated_avatars site setting
This commit is contained in:
parent
a797f7c664
commit
033c2e7140
|
@ -23,7 +23,7 @@ module Jobs
|
|||
PIXELS.each do |pixel|
|
||||
Discourse.avatar_sizes.each do |size|
|
||||
size *= pixel
|
||||
upload.create_thumbnail!(size, size)
|
||||
upload.create_thumbnail!(size, size, SiteSetting.allow_animated_avatars)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
@ -24,9 +24,9 @@ class Upload < ActiveRecord::Base
|
|||
thumbnail(width, height).present?
|
||||
end
|
||||
|
||||
def create_thumbnail!(width, height)
|
||||
def create_thumbnail!(width, height, allow_animation = SiteSetting.allow_animated_thumbnails)
|
||||
return unless SiteSetting.create_thumbnails?
|
||||
thumbnail = OptimizedImage.create_for(self, width, height, allow_animation: SiteSetting.allow_animated_thumbnails)
|
||||
thumbnail = OptimizedImage.create_for(self, width, height, allow_animation: allow_animation)
|
||||
if thumbnail
|
||||
optimized_images << thumbnail
|
||||
self.width = width
|
||||
|
|
Loading…
Reference in New Issue