geordi 0.15.2 → 0.15.3
Sign up to get free protection for your applications and to get access to all the features.
- data/bin/optimize-png +13 -6
- data/lib/geordi/version.rb +1 -1
- metadata +3 -3
data/bin/optimize-png
CHANGED
@@ -1,5 +1,4 @@
|
|
1
1
|
#!/usr/bin/env ruby
|
2
|
-
require "ruby-debug"
|
3
2
|
require 'fileutils'
|
4
3
|
|
5
4
|
# pngcrush -rem allb -reduce -brute original.png optimized.png
|
@@ -38,9 +37,12 @@ def print_manual
|
|
38
37
|
indented_puts "- Eliminates unused colors and reduce bit-depth (If possible)"
|
39
38
|
indented_puts "- May reduce PNG file size lossless"
|
40
39
|
indented_puts
|
41
|
-
indented_puts "Batch
|
40
|
+
indented_puts "Batch-optimize all *.png in a directory:"
|
42
41
|
indented_puts " #{script_name} directory"
|
43
42
|
indented_puts
|
43
|
+
indented_puts "Batch-optimize the current directory:"
|
44
|
+
indented_puts " #{script_name} ."
|
45
|
+
indented_puts
|
44
46
|
indented_puts "Optimize single file:"
|
45
47
|
indented_puts " #{script_name} input.png"
|
46
48
|
indented_puts
|
@@ -91,16 +93,21 @@ def batch_optimize_inplace(path)
|
|
91
93
|
end
|
92
94
|
|
93
95
|
def main
|
94
|
-
if
|
96
|
+
if `which pngcrush`.strip == ""
|
97
|
+
indented_puts
|
98
|
+
indented_puts "You have to install pngcrush first: sudo apt-get install pngcrush"
|
99
|
+
indented_puts
|
100
|
+
elsif ARGV.size == 1
|
95
101
|
path = ARGV[0]
|
96
102
|
if File.directory?(path)
|
97
103
|
batch_optimize_inplace(path)
|
98
104
|
elsif File.file?(path)
|
99
105
|
optimize_inplace(path)
|
106
|
+
else
|
107
|
+
print_manual
|
108
|
+
indented_puts "*** Error: '#{path}' is neither a directory nor a file ***"
|
109
|
+
indented_puts
|
100
110
|
end
|
101
|
-
print_manual
|
102
|
-
indented_puts "*** Error: '#{path}' is neither a directory nor a file ***"
|
103
|
-
indented_puts
|
104
111
|
else
|
105
112
|
print_manual
|
106
113
|
end
|
data/lib/geordi/version.rb
CHANGED
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: geordi
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 37
|
5
5
|
prerelease:
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 15
|
9
|
-
-
|
10
|
-
version: 0.15.
|
9
|
+
- 3
|
10
|
+
version: 0.15.3
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Henning Koch
|