FIX: use correct command line attribute for `gifsicle` while scale down the gif.
This commit is contained in:
parent
3e10d4133d
commit
b57d4586d7
|
@ -236,11 +236,12 @@ class OptimizedImage < ActiveRecord::Base
|
|||
|
||||
def 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}
|
||||
|
|
|
@ -245,14 +245,16 @@ class UploadCreator
|
|||
|
||||
from = @file.path
|
||||
to = 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
|
||||
)
|
||||
|
||||
|
|
Loading…
Reference in New Issue