image_optimizer 1.8.0 → 1.9.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- checksums.yaml.gz.sig +0 -0
- data/CHANGELOG.md +4 -1
- data/README.md +8 -0
- data/certs/jtescher.pem +23 -19
- data/checksum/image_optimizer-1.9.0.gem.sha512 +1 -0
- data/lib/image_optimizer/image_optimizer_base.rb +8 -0
- data/lib/image_optimizer/version.rb +1 -1
- data/spec/image_optimizer/gif_optimizer_spec.rb +8 -0
- data/spec/image_optimizer/jpeg_optimizer_spec.rb +8 -0
- data/spec/image_optimizer/png_optimizer_spec.rb +8 -0
- data/spec/image_optimizer/pngquant_optimizer_spec.rb +8 -0
- data.tar.gz.sig +0 -0
- metadata +30 -26
- metadata.gz.sig +0 -0
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 52ece0fb51c602d22fb7c82b8c14a1a47ad2972d6e925226994b8c656484e6cb
|
4
|
+
data.tar.gz: 368aca1eb6b81221e1d130ca0d10490eab127a00a3b991bac4d2fc3bc75d32b7
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6022872379386db2a408e448a87f1679c2aef82ec40485791da1128cfdac177ea2558c70c12f27537e45c5bb53e94ba067cd99aa4a5f993a6a1782ed6707fd9f
|
7
|
+
data.tar.gz: 9683e4dc3de5849e0240ae0d81c0791cfb466ee5e1e40fc9c748b28789b71b22c3445e8d5c0129810064c212f1c148e77769546787a49ccd6c79c4964e54d728
|
checksums.yaml.gz.sig
CHANGED
Binary file
|
data/CHANGELOG.md
CHANGED
@@ -1,4 +1,7 @@
|
|
1
|
-
## [1.
|
1
|
+
## [1.9.0](https://github.com/jtescher/image_optimizer/releases/tag/v1.9.0) 2022-01-10
|
2
|
+
* add ignore option for compression methods (#23)
|
3
|
+
|
4
|
+
## [1.8.0](https://github.com/jtescher/image_optimizer/releases/tag/v1.8.0) 2018-07-30
|
2
5
|
* Fix: space in file name will break PNGQuantOptimizer - https://github.com/jtescher/image_optimizer/pull/21
|
3
6
|
|
4
7
|
## [1.7.2](https://github.com/jtescher/image_optimizer/releases/tag/v1.7.2) 2018-01-10
|
data/README.md
CHANGED
@@ -155,6 +155,14 @@ instead of the filename extension, default is false.
|
|
155
155
|
ImageOptimizer.new('path/to/file.jpg', identify: true).optimize
|
156
156
|
```
|
157
157
|
|
158
|
+
##### Ignore compression methods
|
159
|
+
|
160
|
+
You can ignore optimization methods by passing an optional `ignore` parameter with the method name(s). For example, to compress a png ignoring the lossless compression method `optipng`:
|
161
|
+
|
162
|
+
```ruby
|
163
|
+
ImageOptimizer.new('path/to/file.png', ignore: :optipng).optimize
|
164
|
+
```
|
165
|
+
|
158
166
|
## Set bin directories
|
159
167
|
|
160
168
|
Optionally set binary directories with the `OPTIPNG_BIN`, `JPEGOPTIM_BIN` and `IDENTIFY_BIN` environment variables.
|
data/certs/jtescher.pem
CHANGED
@@ -1,21 +1,25 @@
|
|
1
1
|
-----BEGIN CERTIFICATE-----
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
2
|
+
MIIENDCCApygAwIBAgIBATANBgkqhkiG9w0BAQsFADAiMSAwHgYDVQQDDBdqdWxp
|
3
|
+
YW4vREM9dGVzY2hlci9EQz1tZTAeFw0yMjAxMTAxNTMyMzFaFw0yMzAxMTAxNTMy
|
4
|
+
MzFaMCIxIDAeBgNVBAMMF2p1bGlhbi9EQz10ZXNjaGVyL0RDPW1lMIIBojANBgkq
|
5
|
+
hkiG9w0BAQEFAAOCAY8AMIIBigKCAYEA2NIqnCAvdqMziQRxhBrjOOEy/bpjVakN
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DjJ5jPkSeepYdlNe2ogEeGcWEFmyDJfr0vK3
|
21
|
+
VokEpOHGpz1/CiJnJ08xTGCLOZ13dtclzhILRsP7tTh8+c9XB4SkmuX37dazBUu0
|
22
|
+
pdTkZA65Y5/zNsW4BLHc8h6TyXqpmv6giWKOm6gHdWVrhuVM9GGR4gIJyI5UFISg
|
23
|
+
HgI9vJ9QNRAdHzkP6ToW7r3j6nuszBAcnvJHU+MnONH9mGe7EWado06XjFAgrcA/
|
24
|
+
47H47vSiiTIz55uAos1d8U8682yHT1SQ
|
21
25
|
-----END CERTIFICATE-----
|
@@ -0,0 +1 @@
|
|
1
|
+
848760a4bcbf80d14abfa5ac4c752e8f8bc9019bff3f6f3240fbed4ac8c899bac1720a6bbd13bdba021adf5641d6e9e1d17c67d7d472a82ee0d9d85e8bcea22d
|
@@ -9,6 +9,7 @@ class ImageOptimizer
|
|
9
9
|
end
|
10
10
|
|
11
11
|
def optimize
|
12
|
+
return if ignore?
|
12
13
|
return unless correct_format?
|
13
14
|
|
14
15
|
if optimizer_bin?
|
@@ -44,5 +45,12 @@ class ImageOptimizer
|
|
44
45
|
options[:quiet] || ImageOptimizer.quiet
|
45
46
|
end
|
46
47
|
|
48
|
+
def ignore?
|
49
|
+
ignore.include? bin_name
|
50
|
+
end
|
51
|
+
|
52
|
+
def ignore
|
53
|
+
options[:ignore] ? [options[:ignore]].flatten.map(&:to_s) : []
|
54
|
+
end
|
47
55
|
end
|
48
56
|
end
|
@@ -46,6 +46,14 @@ describe ImageOptimizer::GIFOptimizer do
|
|
46
46
|
subject
|
47
47
|
end
|
48
48
|
end
|
49
|
+
|
50
|
+
context 'with ignore parameter' do
|
51
|
+
let(:options) { { :ignore => :gifsicle } }
|
52
|
+
it 'does not optimize the gif' do
|
53
|
+
expect(gif_optimizer).not_to receive(:system)
|
54
|
+
subject
|
55
|
+
end
|
56
|
+
end
|
49
57
|
end
|
50
58
|
|
51
59
|
|
@@ -64,6 +64,14 @@ describe ImageOptimizer::JPEGOptimizer do
|
|
64
64
|
subject
|
65
65
|
end
|
66
66
|
end
|
67
|
+
|
68
|
+
context 'with ignore parameter' do
|
69
|
+
let(:options) { { :ignore => :jpegoptim } }
|
70
|
+
it 'does not optimize the jpeg' do
|
71
|
+
expect(jpeg_optimizer).not_to receive(:system)
|
72
|
+
subject
|
73
|
+
end
|
74
|
+
end
|
67
75
|
end
|
68
76
|
|
69
77
|
context 'optimizing utility is not installed' do
|
@@ -72,6 +72,14 @@ describe ImageOptimizer::PNGOptimizer do
|
|
72
72
|
subject
|
73
73
|
end
|
74
74
|
end
|
75
|
+
|
76
|
+
context 'with ignore parameter' do
|
77
|
+
let(:options) { { :ignore => :optipng } }
|
78
|
+
it 'does not optimize the png' do
|
79
|
+
expect(png_optimizer).not_to receive(:system)
|
80
|
+
subject
|
81
|
+
end
|
82
|
+
end
|
75
83
|
end
|
76
84
|
|
77
85
|
|
@@ -55,6 +55,14 @@ describe ImageOptimizer::PNGQuantOptimizer do
|
|
55
55
|
end
|
56
56
|
end
|
57
57
|
|
58
|
+
context 'with ignore parameter' do
|
59
|
+
let(:options) { { :ignore => :pngquant } }
|
60
|
+
it 'does not optimize the png' do
|
61
|
+
expect(pngquant_optimizer).not_to receive(:system)
|
62
|
+
subject
|
63
|
+
end
|
64
|
+
end
|
65
|
+
|
58
66
|
context 'with space in file name' do
|
59
67
|
let(:path) { '/path/to/file 2.png' }
|
60
68
|
|
data.tar.gz.sig
CHANGED
Binary file
|
metadata
CHANGED
@@ -1,36 +1,40 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: image_optimizer
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.9.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Julian Tescher
|
8
|
-
autorequire:
|
8
|
+
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain:
|
11
11
|
- |
|
12
12
|
-----BEGIN CERTIFICATE-----
|
13
|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BSjYnqpiURz0CR8srSqAJbZhlIx3TAcBgNVHREE
|
26
|
+
FTATgRFqdWxpYW5AdGVzY2hlci5tZTAcBgNVHRIEFTATgRFqdWxpYW5AdGVzY2hl
|
27
|
+
ci5tZTANBgkqhkiG9w0BAQsFAAOCAYEANc6i+QIto8zFj+y2rHpz197Dg8nYtHnr
|
28
|
+
LjEeNCm3JPyTZNDXbs/W+GArMiukQ3GkIdDgx+e+Q3h8FMdO5L5ObRNeGmBDyEyG
|
29
|
+
M8ubpHxacemSZkfmVyNkDBWOFYQYMJaC2TgmnUnRe5IAuOuWRgvC4kvb1blTsqbP
|
30
|
+
jNDn4Z2FofVroUQsPD8lVw27cUsoA2SmFnS+8ThqVsn/CIEoLkIkOWElAaKqa4z9
|
31
|
+
xU/u+8Mi2o2ndq1k5/WvYn2AAEm+DjJ5jPkSeepYdlNe2ogEeGcWEFmyDJfr0vK3
|
32
|
+
VokEpOHGpz1/CiJnJ08xTGCLOZ13dtclzhILRsP7tTh8+c9XB4SkmuX37dazBUu0
|
33
|
+
pdTkZA65Y5/zNsW4BLHc8h6TyXqpmv6giWKOm6gHdWVrhuVM9GGR4gIJyI5UFISg
|
34
|
+
HgI9vJ9QNRAdHzkP6ToW7r3j6nuszBAcnvJHU+MnONH9mGe7EWado06XjFAgrcA/
|
35
|
+
47H47vSiiTIz55uAos1d8U8682yHT1SQ
|
32
36
|
-----END CERTIFICATE-----
|
33
|
-
date:
|
37
|
+
date: 2022-01-10 00:00:00.000000000 Z
|
34
38
|
dependencies:
|
35
39
|
- !ruby/object:Gem::Dependency
|
36
40
|
name: rspec
|
@@ -132,6 +136,7 @@ files:
|
|
132
136
|
- checksum/image_optimizer-1.7.1.gem.sha512
|
133
137
|
- checksum/image_optimizer-1.7.2.gem.sha512
|
134
138
|
- checksum/image_optimizer-1.8.0.gem.sha512
|
139
|
+
- checksum/image_optimizer-1.9.0.gem.sha512
|
135
140
|
- image_optimizer.gemspec
|
136
141
|
- lib/image_optimizer.rb
|
137
142
|
- lib/image_optimizer/gif_optimizer.rb
|
@@ -153,7 +158,7 @@ homepage: https://github.com/jtescher/image_optimizer
|
|
153
158
|
licenses:
|
154
159
|
- MIT
|
155
160
|
metadata: {}
|
156
|
-
post_install_message:
|
161
|
+
post_install_message:
|
157
162
|
rdoc_options: []
|
158
163
|
require_paths:
|
159
164
|
- lib
|
@@ -168,9 +173,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
168
173
|
- !ruby/object:Gem::Version
|
169
174
|
version: '0'
|
170
175
|
requirements: []
|
171
|
-
|
172
|
-
|
173
|
-
signing_key:
|
176
|
+
rubygems_version: 3.2.3
|
177
|
+
signing_key:
|
174
178
|
specification_version: 4
|
175
179
|
summary: Simply optimize images via jpegoptim or OptiPNG or Gifsicle
|
176
180
|
test_files:
|
metadata.gz.sig
CHANGED
Binary file
|