image_optimizer 1.3.0 → 1.4.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
2
  SHA1:
3
- metadata.gz: 970982e519567a730a3feb024bbed88cfbb837b6
4
- data.tar.gz: 92198c8d8fbaa3ce8caa6ef2e270f6872a7b1829
3
+ metadata.gz: 23e7028d2a2b7ffaf06d8e7a037d36f1a1a56639
4
+ data.tar.gz: 8935e10ded4c3ba40a8359c62fae65d7e67860ff
5
5
  SHA512:
6
- metadata.gz: cbe10141847ab85f09fc245f813db416448a9ca391b6c8e3f66b26489ce2df423228e8875fea6ff96475518dada29c597d448ce74a69c1e41a793f6b49436a9d
7
- data.tar.gz: 17432c5a63ea32496a5442f60e9a53f257d3f338e828558bdc31f4c7aef72c7213d95ea1bd7ec228ac193297586167ef8559365f303c4274ae7729d9ef9704b0
6
+ metadata.gz: 8df5ff183ebf0d94a4336849c25324acb8f97003b19fe251e61b72f1a1b6334087352c259dce59d35bc6aa6cbd7ac45ac9f329eb8ea4937ab896eee868d7e89a
7
+ data.tar.gz: 45707a1af19528cb811388ff9898d421b9f337ba641e084956a666e6a5398cc0dbfb964641292ac583faf8fd78bf2356b3d07efb4ccc110a49abe31be91a4b54
checksums.yaml.gz.sig CHANGED
Binary file
data/README.md CHANGED
@@ -84,6 +84,20 @@ optimization. PNGs will ignore the quality setting.
84
84
  ImageOptimizer.new('path/to/file.jpg', quality: 80).optimize
85
85
  ```
86
86
 
87
+ ##### Custom PNG optimization quality
88
+
89
+ By default, `optipng` is called with the `-o7` flag, which controls the level of
90
+ optimization. This default level generates the most optimized results, at the
91
+ expense of very high execution times, so you may want to lower it if your server
92
+ can't handle it.
93
+
94
+ You can pass an optional `level` parameter to change this value. the JPEG
95
+ optimizer will ignore the value.
96
+
97
+ ```ruby
98
+ ImageOptimizer.new('path/to/file.png', level: 3).optimize
99
+ ```
100
+
87
101
  ##### Use identify
88
102
 
89
103
  Pass an optional `identify` parameter to identify file types using Image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ttG3Dh9FzmXAoUwe3j0zj4WGls/5/
17
+ qL58FP+PJRWsa5Mr3v2cbR2621MnYFcYaWIukku099vtxtOnRiu5E3PWBeyPdgGq
18
+ uckiPw91vFR5CvN/OTm9ldC7QXTJ4uFjBiyn6FWXijTPFfSLCypTN6FQzxE6XCng
19
+ xHrbjektsf9F0uFBpO8hph+/E5rUHU3TPA2zniEdww0txJKm/GfyUL0U/ueMt0mb
20
+ LMAkft3CjmFzOtBGrqWUNehvx43pyTqg
21
+ -----END CERTIFICATE-----
@@ -0,0 +1 @@
1
+ 59beb9c4641cd45354bd12ea4a15320450f2fb8c0ad4538cdd298de7119bdd4dc88d8f918b0b3d73ab9d2394bc60f9f52d084c6911617ef1b4a3274650959e13
@@ -0,0 +1 @@
1
+ d262a6ec8536325d885a99abe83ea074a5f45563949243b3cad11b6b7d292eb414a8cac15950fb022cf9af1c732ce7206161faee6a4ac2598b7cc15138506cbc
@@ -0,0 +1 @@
1
+ 812fb9d4d6b889c2c6b76a923b693e8bf4c66a3a5fefb786d65a9d0374191962c5e28ecc293c410d8a92e4c2068f9aed3aff5067ebc4d74f055933ee2231d353
@@ -0,0 +1 @@
1
+ cc551e6b3b8d1c45329ea4f57fed4cf9e7cce67909f08cb10920e6f63f51e9db70ee710b03d03aad9501eb27c7c103a6404cba64826493a13059cbcd97233d7c
@@ -0,0 +1 @@
1
+ 0e61ce1b9a5a747446b4a36e352b97a4f2a6671dbdd285d9fd400c5323115b7e596b0d220a7b6246a152f48b391f1c0a5956935ca0f2158de4f297eb823eddc6
@@ -0,0 +1 @@
1
+ 3e08e9ee435aa7c096412631e22b98250e68f3b27862c137a7069303fe40ddc9d329e701c242631657d4798b26f3e4e382b20662a9d56203b9adc388e4e7c443
@@ -0,0 +1 @@
1
+ 65e0db1d92b8a1731e07814b85477df91551a3d72a9fda4b17040bc50e0061e7a1e05deefbe8c6a511d9516a7c0a1d59c555aefa4737577997cf2cd5b0d981ab
@@ -13,7 +13,7 @@ Gem::Specification.new do |gem|
13
13
  gem.homepage = "https://github.com/jtescher/image_optimizer"
14
14
  gem.license = 'MIT'
15
15
  gem.signing_key = File.expand_path('~/.ssh/gem-private_key.pem') if $0 =~ /gem\z/
16
- gem.cert_chain = ['certs/jtescher.pem']
16
+ gem.cert_chain = ['certs/gem-public_cert.pem']
17
17
 
18
18
  gem.files = `git ls-files`.split($/)
19
19
  gem.executables = gem.files.grep(%r{^bin/}).map{ |f| File.basename(f) }
@@ -4,11 +4,15 @@ class ImageOptimizer
4
4
  private
5
5
 
6
6
  def command_options
7
- flags = %w[-o7]
7
+ flags = %W[-o#{level}]
8
8
  flags << quiet if options[:quiet]
9
9
  flags << path
10
10
  end
11
11
 
12
+ def level
13
+ options[:level] || 7
14
+ end
15
+
12
16
  def quiet
13
17
  '-quiet'
14
18
  end
@@ -1,3 +1,3 @@
1
1
  class ImageOptimizer
2
- VERSION = '1.3.0'
2
+ VERSION = '1.4.0'
3
3
  end
@@ -39,8 +39,24 @@ describe ImageOptimizer::PNGOptimizer do
39
39
  subject
40
40
  end
41
41
  end
42
+
43
+ context 'without optimization parameter' do
44
+ it 'optimizes the png with level 7 optimization' do
45
+ expect(png_optimizer).to receive(:system).with('/usr/local/bin/optipng', '-o7', '/path/to/file.png')
46
+ subject
47
+ end
48
+ end
49
+
50
+ context 'with optimization parameter' do
51
+ let(:options) { { level: 3 } }
52
+ it 'optimizes the png with the requested optimization level' do
53
+ expect(png_optimizer).to receive(:system).with('/usr/local/bin/optipng', '-o3', '/path/to/file.png')
54
+ subject
55
+ end
56
+ end
42
57
  end
43
58
 
59
+
44
60
  context 'with png optimizing utility not installed' do
45
61
  before do
46
62
  allow(ImageOptimizer::PNGOptimizer).to receive(:which).and_return(nil)
data.tar.gz.sig CHANGED
Binary file
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: image_optimizer
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.3.0
4
+ version: 1.4.0
5
5
  platform: ru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r3v2cbR2621MnYFcYaWIukku099vtxtOnRiu5E3PWBeyPdgGq
29
+ uckiPw91vFR5CvN/OTm9ldC7QXTJ4uFjBiyn6FWXijTPFfSLCypTN6FQzxE6XCng
30
+ xHrbjektsf9F0uFBpO8hph+/E5rUHU3TPA2zniEdww0txJKm/GfyUL0U/ueMt0mb
31
+ LMAkft3CjmFzOtBGrqWUNehvx43pyTqg
32
32
  -----END CERTIFICATE-----
33
- date: 2014-09-29 00:00:00.000000000 Z
33
+ date: 2016-09-08 00:00:00.000000000 Z
34
34
  dependencies:
35
35
  - !ruby/object:Gem::Dependency
36
36
  name: rspec
@@ -115,7 +115,14 @@ files:
115
115
  - LICENSE.txt
116
116
  - README.md
117
117
  - Rakefile
118
- - certs/jtescher.pem
118
+ - certs/gem-public_cert.pem
119
+ - checksum/image_optimizer-0.0.1.gem.sha512
120
+ - checksum/image_optimizer-0.0.2.gem.sha512
121
+ - checksum/image_optimizer-1.0.0.gem.sha512
122
+ - checksum/image_optimizer-1.1.0.gem.sha512
123
+ - checksum/image_optimizer-1.2.0.gem.sha512
124
+ - checksum/image_optimizer-1.2.1.gem.sha512
125
+ - checksum/image_optimizer-1.3.0.gem.sha512
119
126
  - image_optimizer.gemspec
120
127
  - lib/image_optimizer.rb
121
128
  - lib/image_optimizer/image_optimizer_base.rb
@@ -149,7 +156,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
149
156
  version: '0'
150
157
  requirements: []
151
158
  rubyforge_project:
152
- rubygems_version: 2.2.1
159
+ rubygems_version: 2.4.6
153
160
  signing_key:
154
161
  specification_version: 4
155
162
  summary: Simply optimize images via jpegoptim or OptiPNG
metadata.gz.sig CHANGED
Binary file
data/certs/jtescher.pem DELETED
@@ -1,21 +0,0 @@
1
- -----BEGIN CERTIFICATE-----
2
- MIIDdDCCAlygAwIBAgIBATANBgkqhkiG9w0BAQUFADBAMRIwEAYDVQQDDAlqYXRl
3
- c2NoZXIxFTATBgoJkiaJk/IsZAEZFgVnbWFpbD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