Skip to content

Commit

Permalink
remove app and other extensions from gif images
Browse files Browse the repository at this point in the history
--no-app-extensions is redundant
  • Loading branch information
toy committed Nov 3, 2014
1 parent 62fe874 commit e6104cb
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 0 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

## unreleased

* Remove app and other extensions from gif images [@toy](https://github.com/toy)
* Change gifsicle interlace option to deinterlace by default for better compression, pass `nil` to leave as is [@toy](https://github.com/toy)

## v0.18.0 (2014-11-01)
Expand Down
6 changes: 6 additions & 0 deletions lib/image_optim/bin_resolver/bin.rb
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,12 @@ def check!
when c = is < '2.1'
warn "WARN: #{self} (#{c}) may be lossy even with quality `100-`"
end
when :gifsicle
case version
when c = is < '1.85'
warn "WARN: #{self} (#{c}) doesn't support removing extension "\
'blocks'
end
end
end

Expand Down
4 changes: 4 additions & 0 deletions lib/image_optim/worker/gifsicle.rb
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,10 @@ def optimize(src, dst)
#{src}
]

if resolve_bin!(:gifsicle).version >= '1.85'
args.unshift('--no-extensions', '--no-app-extensions')
end

unless interlace.nil?
args.unshift(interlace ? '--interlace' : '--no-interlace')
end
Expand Down

0 comments on commit e6104cb

Please sign in to comment.