png_quantizator 0.2.0 → 0.2.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/png_quantizator.rb +10 -7
- data/lib/png_quantizator/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d0c8b1c83e7e6ac6423fff59fd463e39535b9101
|
4
|
+
data.tar.gz: 8a0b054aec8ebe971708df4991412add92a286b3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: db4c79816d49b0f60ecf74be8b1371aa014f33978c1530e424462a1e981d710fbd8b6d9ca8548336748bbe8f2fa838409397e617a18a942c98393a07121f4b4c
|
7
|
+
data.tar.gz: d8e1b8e042a1a48c11a23f621cf6416947f91a3f3f3db9a1a0c094703eb4a94cc21a82c85e2b7efc9ad1c0fd6cc9ee2d3534a6be3b905d7eb382f49eff78e349
|
data/lib/png_quantizator.rb
CHANGED
@@ -16,13 +16,12 @@ module PngQuantizator
|
|
16
16
|
end
|
17
17
|
|
18
18
|
def quantize!(colors = 256)
|
19
|
-
Tempfile.open([SecureRandom.hex(16), ".png"]) do |
|
20
|
-
|
21
|
-
FileUtils.cp(
|
19
|
+
Tempfile.open([SecureRandom.hex(16), ".png"]) do |file|
|
20
|
+
quantize_to(file.path, colors)
|
21
|
+
FileUtils.cp(file.path, @file_path)
|
22
22
|
|
23
|
-
|
24
|
-
|
25
|
-
res
|
23
|
+
file.close
|
24
|
+
true
|
26
25
|
end
|
27
26
|
end
|
28
27
|
|
@@ -38,7 +37,11 @@ module PngQuantizator
|
|
38
37
|
f.flush
|
39
38
|
end
|
40
39
|
|
41
|
-
|
40
|
+
stdout.close
|
41
|
+
error_message = stderr.gets(nil)
|
42
|
+
stderr.close
|
43
|
+
|
44
|
+
[wait_thr.value, error_message]
|
42
45
|
end
|
43
46
|
|
44
47
|
raise(PngQuantError, err_msg) if exit_code != 0
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: png_quantizator
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Roger Campos
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-
|
11
|
+
date: 2015-08-04 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rspec
|