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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
- SHA1:
3
- metadata.gz: 45e5f6d43275a961ce4361e16e74964a0997fb0f
4
- data.tar.gz: 20825e379182211fd1d91a3d3bdc7e770156a87f
2
+ SHA256:
3
+ metadata.gz: 52ece0fb51c602d22fb7c82b8c14a1a47ad2972d6e925226994b8c656484e6cb
4
+ data.tar.gz: 368aca1eb6b81221e1d130ca0d10490eab127a00a3b991bac4d2fc3bc75d32b7
5
5
  SHA512:
6
- metadata.gz: 58805ec57ebd31008f53900573f3bdb1e5486b068ba0f11295180aaf216ca88cb8bc6fcb2552c5cc8e4fd42c3dbf1e6b960441f8ef0ca491bea172158c790b47
7
- data.tar.gz: 99c6b7a0eb7661048a83462996ea59afda918b3116bc26a9225a8215ab538576faa0af7f8c5117573bc19b839973e329f4edfb210bd83c8e33133c2cff3714ad
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.8.0](https://github.com/jtescher/image_optimizer/releases/tag/v1.7.3) 2018-07-30
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
- MIIDdDCCAlygAwIBAgIBATANBgkqhkiG9w0BAQUFADBAMRIwEAYDVQQDDAlqYXRl
3
- c2NoZXIxFTATBgoJkiaJk/IsZAEZFgVnbWFpbDETMBEGCgmSJomT8ixkARkWA2Nv
4
- bTAeFw0xNzExMjkyMjEzNDJaFw0xODExMjkyMjEzNDJaMEAxEjAQBgNVBAMMCWph
5
- dGVzY2hlcjEVMBMGCgmSJomT8ixkARkWBWdtYWlsMRMwEQYKCZImiZPyLGQBGRYD
6
- Y29tMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA7ptCQvN739Rjos4e
7
- G2Y8uGCQxpBoXozU36PXLtR5ws7aly1QV0zRc1cy7nKnOSnXn7dEfbLGZS6/87pM
8
- rDFFszHsn/dizlXe3wejHePyG1EsYnIezISP9YSDcm7qpysrUAa2fKPqqZ6DNbIP
9
- 6wRF9Cun4hvmQPDrs0zKU6p43XHnJUg7YBYCOVACa7eFD1EOya+599hFMhnWChvT
10
- rKkVc/JRvmKYLIkB6Y6N3TFrVi9x0Qpo4fjG5rQ9xxNZhpFIOMJ0VJbuRSIMlLwr
11
- Ryd/QG0BcvkSHph/ZDlgfZ1V/lzWWq+mZOt/U+t6cVITSET5XDzHkeZ0B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d8U8682yHT1SQ
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
@@ -1,3 +1,3 @@
1
1
  class ImageOptimizer
2
- VERSION = '1.8.0'
2
+ VERSION = '1.9.0'
3
3
  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.8.0
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
- MIIDdDCCAlygAwIBAgIBATANBgkqhkiG9w0BAQUFADBAMRIwEAYDVQQDDAlqYXRl
14
- c2NoZXIxFTATBgoJkiaJk/IsZAEZFgVnbWFpbDETMBEGCgmSJomT8ixkARkWA2Nv
15
- bTAeFw0xNzExMjkyMjEzNDJaFw0xODExMjkyMjEzNDJaMEAxEjAQBgNVBAMMCWph
16
- dGVzY2hlcjEVMBMGCgmSJomT8ixkARkWBWdtYWlsMRMwEQYKCZImiZPyLGQBGRYD
17
- Y29tMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA7ptCQvN739Rjos4e
18
- G2Y8uGCQxpBoXozU36PXLtR5ws7aly1QV0zRc1cy7nKnOSnXn7dEfbLGZS6/87pM
19
- rDFFszHsn/dizlXe3wejHePyG1EsYnIezISP9YSDcm7qpysrUAa2fKPqqZ6DNbIP
20
- 6wRF9Cun4hvmQPDrs0zKU6p43XHnJUg7YBYCOVACa7eFD1EOya+599hFMhnWChvT
21
- rKkVc/JRvmKYLIkB6Y6N3TFrVi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VM9GGR4gIJyI5UFISg
34
+ HgI9vJ9QNRAdHzkP6ToW7r3j6nuszBAcnvJHU+MnONH9mGe7EWado06XjFAgrcA/
35
+ 47H47vSiiTIz55uAos1d8U8682yHT1SQ
32
36
  -----END CERTIFICATE-----
33
- date: 2018-07-30 00:00:00.000000000 Z
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
- rubyforge_project:
172
- rubygems_version: 2.6.14
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