mirror of
				https://github.com/discourse/discourse.git
				synced 2025-02-25 18:55:32 -06:00 
			
		
		
		
	DEV: Remove gifsicle dependency (#10357)
Dependency on gifsicle, allow_animated_avatars and allow_animated_thumbnails site settings were all removed. Animated GIF images are still allowed, but the generated optimized images are no longer animated for those (which were used for avatars and thumbnails). The added 'animated' is populated by extracting information using FastImage. This field was used to selectively reoptimize old animations. This process happens in the background.
This commit is contained in:
		@@ -78,7 +78,6 @@ class Upload < ActiveRecord::Base
 | 
			
		||||
  def create_thumbnail!(width, height, opts = nil)
 | 
			
		||||
    return unless SiteSetting.create_thumbnails?
 | 
			
		||||
    opts ||= {}
 | 
			
		||||
    opts[:allow_animation] = SiteSetting.allow_animated_thumbnails
 | 
			
		||||
 | 
			
		||||
    if get_optimized_image(width, height, opts)
 | 
			
		||||
      save(validate: false)
 | 
			
		||||
@@ -86,7 +85,9 @@ class Upload < ActiveRecord::Base
 | 
			
		||||
  end
 | 
			
		||||
 | 
			
		||||
  # this method attempts to correct old incorrect extensions
 | 
			
		||||
  def get_optimized_image(width, height, opts)
 | 
			
		||||
  def get_optimized_image(width, height, opts = nil)
 | 
			
		||||
    opts ||= {}
 | 
			
		||||
 | 
			
		||||
    if (!extension || extension.length == 0)
 | 
			
		||||
      fix_image_extension
 | 
			
		||||
    end
 | 
			
		||||
@@ -461,11 +462,12 @@ end
 | 
			
		||||
#  secure                 :boolean          default(FALSE), not null
 | 
			
		||||
#  access_control_post_id :bigint
 | 
			
		||||
#  original_sha1          :string
 | 
			
		||||
#  verified               :boolean
 | 
			
		||||
#  verification_status    :integer          default(1), not null
 | 
			
		||||
#  animated               :boolean
 | 
			
		||||
#
 | 
			
		||||
# Indexes
 | 
			
		||||
#
 | 
			
		||||
#  idx_uploads_on_verification_status       (verification_status)
 | 
			
		||||
#  index_uploads_on_access_control_post_id  (access_control_post_id)
 | 
			
		||||
#  index_uploads_on_etag                    (etag)
 | 
			
		||||
#  index_uploads_on_extension               (lower((extension)::text))
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user