From 033c2e71409df70856c508f9de8ab6181a1bd60d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9gis=20Hanol?= Date: Tue, 26 May 2015 12:22:02 +0200 Subject: [PATCH] FIX: respect the allow_animated_avatars site setting --- app/jobs/regular/create_thumbnails.rb | 2 +- app/models/upload.rb | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/app/jobs/regular/create_thumbnails.rb b/app/jobs/regular/create_thumbnails.rb index a84c572149c..59d7d694cb4 100644 --- a/app/jobs/regular/create_thumbnails.rb +++ b/app/jobs/regular/create_thumbnails.rb @@ -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 diff --git a/app/models/upload.rb b/app/models/upload.rb index eb967cf9d79..8a979b11d52 100644 --- a/app/models/upload.rb +++ b/app/models/upload.rb @@ -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