giftrim 0.0.3 → 0.0.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +8 -8
- data/.travis.yml +1 -0
- data/README.md +1 -1
- data/lib/giftrim.rb +17 -2
- data/lib/giftrim/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
---
|
2
2
|
!binary "U0hBMQ==":
|
3
3
|
metadata.gz: !binary |-
|
4
|
-
|
4
|
+
MjY2OTk0YzM2OTYzYjg2M2QxNjg5MjZlMTRmNTM1NzFkYzM0ODA0Ng==
|
5
5
|
data.tar.gz: !binary |-
|
6
|
-
|
6
|
+
YTlmMTA4MGU3YjkzNGMwMmE0YjZhZWZkMDJjNThkOTYxZThhN2VkOA==
|
7
7
|
!binary "U0hBNTEy":
|
8
8
|
metadata.gz: !binary |-
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
MjlkNmI3NmM5ZTQ4ZDNlMzM1NzkyNjQ1Mzc0ZjkyYmYwOWNhMjFmNTc0MzU0
|
10
|
+
ZDNkMDE3NjczZjBhM2U0Y2ZhMDI3Mjc0MTNiM2U2NWFlZjVmYzQzNTk0MjY4
|
11
|
+
NzQxZWQxNWJjZTlkN2EyMDQzMTU2NmQ1MDUwOGQ0MmM4ZjgyY2I=
|
12
12
|
data.tar.gz: !binary |-
|
13
|
-
|
14
|
-
|
15
|
-
|
13
|
+
MGRhZjAzZjBlMWQ0NGMwZDQzNGYwN2UwNzAzYjdlYjU3N2M2ZDgwMjYwNWEx
|
14
|
+
ZjYyMTE2NGVkNzJiODRmZTY3ZWU2ZTQzYThhYzQzMjg0Y2Q1MjAwODhlNDUz
|
15
|
+
YWNhMGE4NjE0MzFiZmE2MDdmMzdkYjBlYTIwNzY5OWFkYTNmMDA=
|
data/.travis.yml
CHANGED
data/README.md
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
|
3
3
|
Provide convenient methods for GIF optimizations using gifsicle
|
4
4
|
|
5
|
-
Tested on the following Rubies: MRI 1.9.3, 2.0.0, Rubinius.
|
5
|
+
Tested on the following Rubies: MRI 1.9.3, 2.0.0, Rubinius, JRuby (1.9 mode).
|
6
6
|
|
7
7
|
[](http://badge.fury.io/rb/giftrim)
|
8
8
|
[](http://travis-ci.org/l4u/giftrim)
|
data/lib/giftrim.rb
CHANGED
@@ -171,15 +171,30 @@ module Giftrim
|
|
171
171
|
end
|
172
172
|
|
173
173
|
def trim
|
174
|
-
|
174
|
+
@outfile = Tempfile.new('giftrim_')
|
175
|
+
@outfile.binmode
|
176
|
+
@outfile.close
|
177
|
+
|
175
178
|
frames = Giftrim::frame_number_wanted self.number_of_frames, 10
|
176
179
|
frames_formatted = frames.map{|frame| "\"##{frame}\""}.join " "
|
180
|
+
command = "#{Giftrim.processor} --unoptimize -O2 --no-comments --no-names --delay 20 --same-loopcount --no-warnings --resize-fit '300x300' #{@path} #{frames_formatted} > #{@outfile.path}"
|
181
|
+
trim_run_command command
|
182
|
+
end
|
177
183
|
|
184
|
+
def trim_with_target_frame_number frame_number
|
178
185
|
@outfile = Tempfile.new('giftrim_')
|
179
186
|
@outfile.binmode
|
180
187
|
@outfile.close
|
181
188
|
|
182
|
-
|
189
|
+
frames = Giftrim::frame_number_wanted self.number_of_frames, 10
|
190
|
+
frames_formatted = frames.map{|frame| "\"##{frame}\""}.join " "
|
191
|
+
command = "#{Giftrim.processor} --unoptimize -O2 --no-comments --no-names --delay 20 --same-loopcount --no-warnings #{@path} #{frames_formatted} > #{@outfile.path}"
|
192
|
+
trim_run_command command
|
193
|
+
end
|
194
|
+
|
195
|
+
private
|
196
|
+
def trim_run_command command
|
197
|
+
|
183
198
|
output = run_command command
|
184
199
|
if output
|
185
200
|
@tempfile = @outfile
|
data/lib/giftrim/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: giftrim
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Leo Lou
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2013-04-
|
11
|
+
date: 2013-04-11 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|