A platform for community discussion. Free, open, simple.
FIX: use correct command line attribute for `gifsicle` while scale down the gif.
Vinoth Kannanb57d4586d713
diff --git a/app/models/optimized_image.rb b/app/models/optimized_image.rbindex 3f5614a0840..e5783532c86 100644--- a/app/models/optimized_image.rb+++ b/app/models/optimized_image.rb@@ -236,11 +236,12 @@ class OptimizedImage < ActiveRecord::Basedef self.resize_instructions_animated(from, to, dimensions, opts = {})ensure_safe_paths!(from, to)+ resize_method = opts[:scale_image] ? "scale" : "resize-fit"%W{gifsicle--colors=#{opts[:colors] || 256}- --resize-fit #{dimensions}+ --#{resize_method} #{dimensions}--optimize=3--output #{to}#{from}diff --git a/lib/upload_creator.rb b/lib/upload_creator.rbindex d9c21f19202..b806e2fc523 100644--- a/lib/upload_creator.rb+++ b/lib/upload_creator.rb@@ -245,14 +245,16 @@ class UploadCreatorfrom = @file.pathto = down_tempfile.path+ scale = (from =~ /\.GIF$/i) ? "0.5" : "50%"OptimizedImage.ensure_safe_paths!(from, to)OptimizedImage.downsize(from,to,- "50%",+ scale,allow_animation: allow_animation,+ scale_image: true,raise_on_error: true)