image_optim 0.26.1 → 0.26.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +5 -5
- data/.appveyor.yml +1 -1
- data/.rubocop.yml +14 -4
- data/.travis.yml +11 -10
- data/CHANGELOG.markdown +7 -0
- data/LICENSE.txt +1 -1
- data/README.markdown +19 -5
- data/image_optim.gemspec +12 -5
- data/lib/image_optim.rb +2 -0
- data/lib/image_optim/hash_helpers.rb +2 -2
- data/lib/image_optim/true_false_nil.rb +2 -2
- data/lib/image_optim/worker/class_methods.rb +1 -1
- data/lib/image_optim/worker/pngout.rb +4 -0
- data/script/worker_analysis +1 -1
- metadata +22 -11
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
|
-
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
2
|
+
SHA256:
|
|
3
|
+
metadata.gz: 07b7d1d96cc0bc6f16e0a2b6a512c4ad06015eea55359dcc9c32c2b19714c786
|
|
4
|
+
data.tar.gz: be1136efd362c8f13f8a286728fc3c49f62af439cdea90d60c68e4093c1be72a
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 82ac7498fa95948f7e6a6380695be2da56436245d4fd595d704b4a8e78d59bb4c483690e8a8ac992ea5bf34fc0f37180ea1e103d76c8ac523975bd8a7690b1e5
|
|
7
|
+
data.tar.gz: cb3d17d491ec5accbf9d94caac4725b849e5e42f212b464b1a08b1f0545f0844193154c8c2c141377193a5234e45b70a207fb4a642f2625e0668e08e8821f046
|
data/.appveyor.yml
CHANGED
data/.rubocop.yml
CHANGED
|
@@ -15,6 +15,9 @@ Layout/CaseIndentation:
|
|
|
15
15
|
Layout/DotPosition:
|
|
16
16
|
EnforcedStyle: trailing
|
|
17
17
|
|
|
18
|
+
Layout/EndAlignment:
|
|
19
|
+
EnforcedStyleAlignWith: variable
|
|
20
|
+
|
|
18
21
|
Layout/IndentArray:
|
|
19
22
|
EnforcedStyle: consistent
|
|
20
23
|
|
|
@@ -29,6 +32,7 @@ Layout/IndentHeredoc:
|
|
|
29
32
|
|
|
30
33
|
Layout/SpaceBeforeBlockBraces:
|
|
31
34
|
EnforcedStyle: no_space
|
|
35
|
+
EnforcedStyleForEmptyBraces: no_space
|
|
32
36
|
|
|
33
37
|
Layout/SpaceInsideHashLiteralBraces:
|
|
34
38
|
EnforcedStyle: no_space
|
|
@@ -37,12 +41,12 @@ Lint/AmbiguousBlockAssociation:
|
|
|
37
41
|
Exclude:
|
|
38
42
|
- spec/**/*_spec.rb
|
|
39
43
|
|
|
40
|
-
Lint/EndAlignment:
|
|
41
|
-
EnforcedStyleAlignWith: variable
|
|
42
|
-
|
|
43
44
|
Lint/NestedPercentLiteral:
|
|
44
45
|
Enabled: false
|
|
45
46
|
|
|
47
|
+
Lint/UnneededRequireStatement:
|
|
48
|
+
Enabled: false
|
|
49
|
+
|
|
46
50
|
Lint/UnneededSplatExpansion:
|
|
47
51
|
Enabled: false
|
|
48
52
|
|
|
@@ -83,6 +87,9 @@ Style/EmptyCaseCondition:
|
|
|
83
87
|
Style/Encoding:
|
|
84
88
|
Enabled: false
|
|
85
89
|
|
|
90
|
+
Style/ExpandPathArguments:
|
|
91
|
+
Enabled: false
|
|
92
|
+
|
|
86
93
|
Style/FormatStringToken:
|
|
87
94
|
Enabled: false
|
|
88
95
|
|
|
@@ -110,5 +117,8 @@ Style/SymbolArray:
|
|
|
110
117
|
Style/TrailingCommaInArguments:
|
|
111
118
|
EnforcedStyleForMultiline: no_comma
|
|
112
119
|
|
|
113
|
-
Style/
|
|
120
|
+
Style/TrailingCommaInArrayLiteral:
|
|
121
|
+
EnforcedStyleForMultiline: comma
|
|
122
|
+
|
|
123
|
+
Style/TrailingCommaInHashLiteral:
|
|
114
124
|
EnforcedStyleForMultiline: comma
|
data/.travis.yml
CHANGED
|
@@ -10,9 +10,10 @@ rvm:
|
|
|
10
10
|
- '1.9.3-p551'
|
|
11
11
|
- '2.0.0-p648'
|
|
12
12
|
- '2.1.10'
|
|
13
|
-
- '2.2.
|
|
14
|
-
- '2.3.
|
|
15
|
-
- '2.4.
|
|
13
|
+
- '2.2.10'
|
|
14
|
+
- '2.3.7'
|
|
15
|
+
- '2.4.4'
|
|
16
|
+
- '2.5.1'
|
|
16
17
|
- 'jruby-9.0.5.0'
|
|
17
18
|
- 'jruby-9.1.9.0'
|
|
18
19
|
script:
|
|
@@ -20,24 +21,24 @@ script:
|
|
|
20
21
|
- bundle exec rspec
|
|
21
22
|
before_install:
|
|
22
23
|
- gem update --system
|
|
23
|
-
- gem
|
|
24
|
+
- gem install bundler
|
|
24
25
|
- nvm install stable
|
|
25
26
|
- mkdir -p ~/bin
|
|
26
27
|
- command -v svgo || npm install -g svgo
|
|
27
|
-
- command -v pngout || curl -L "http://static.jonof.id.au/dl/kenutils/pngout-
|
|
28
|
+
- command -v pngout || curl -L "http://static.jonof.id.au/dl/kenutils/pngout-20150319-linux.tar.gz" | tar -xz -C ~/bin --strip-components 2 --wildcards '*/x86_64/pngout'
|
|
28
29
|
matrix:
|
|
29
30
|
include:
|
|
30
31
|
- env: CODECLIMATE=✓
|
|
31
|
-
rvm: '2.4.
|
|
32
|
+
rvm: '2.4.4'
|
|
32
33
|
after_success: bundle exec codeclimate-test-reporter
|
|
33
34
|
- env: RUBOCOP=✓
|
|
34
|
-
rvm: '2.4.
|
|
35
|
+
rvm: '2.4.4'
|
|
35
36
|
script: bundle exec rubocop
|
|
36
|
-
before_install:
|
|
37
|
+
before_install: gem update --system && gem install bundler
|
|
37
38
|
- env: CHECK_RUBIES=✓
|
|
38
|
-
rvm: '2.4.
|
|
39
|
+
rvm: '2.4.4'
|
|
39
40
|
script: bundle exec travis_check_rubies
|
|
40
|
-
before_install:
|
|
41
|
+
before_install: gem update --system && gem install bundler
|
|
41
42
|
addons:
|
|
42
43
|
code_climate:
|
|
43
44
|
repo_token:
|
data/CHANGELOG.markdown
CHANGED
|
@@ -2,6 +2,13 @@
|
|
|
2
2
|
|
|
3
3
|
## unreleased
|
|
4
4
|
|
|
5
|
+
## v0.26.2 (2018-08-15)
|
|
6
|
+
|
|
7
|
+
* Ignore segmentation fault for `pngout` <= `20150920` [#158](https://github.com/toy/image_optim/issues/158) [@toy](https://github.com/toy)
|
|
8
|
+
* Allow `image_size` 2.x [@toy](https://github.com/toy)
|
|
9
|
+
* Add instructions for installing `svgo` in project folder [#156](https://github.com/toy/image_optim/issues/156) [@brian-kephart](https://github.com/brian-kephart)
|
|
10
|
+
* Show full bin search path in verbose output [@toy](https://github.com/toy)
|
|
11
|
+
|
|
5
12
|
## v0.26.1 (2017-12-14)
|
|
6
13
|
|
|
7
14
|
* Require `'date'` which is used in parsing pngout version [toy/image_optim_pack#14](https://github.com/toy/image_optim_pack/issues/14) [@toy](https://github.com/toy)
|
data/LICENSE.txt
CHANGED
data/README.markdown
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
[](https://rubygems.org/gems/image_optim)
|
|
2
2
|
[](https://travis-ci.org/toy/image_optim)
|
|
3
3
|
[](https://ci.appveyor.com/project/toy/image-optim)
|
|
4
|
-
[](https://codeclimate.com/github/toy/image_optim)
|
|
5
|
+
[](https://codeclimate.com/github/toy/image_optim)
|
|
6
6
|
[](https://gemnasium.com/toy/image_optim)
|
|
7
7
|
[](https://inch-ci.org/github/toy/image_optim)
|
|
8
8
|
|
|
9
9
|
# image_optim
|
|
10
10
|
|
|
11
|
-
|
|
11
|
+
Command line tool and ruby interface to optimize (lossless compress, optionally lossy) jpeg, png, gif and svg images using external utilities:
|
|
12
12
|
|
|
13
13
|
* [advpng](http://advancemame.sourceforge.net/doc-advpng.html) from [AdvanceCOMP](http://advancemame.sourceforge.net/comp-readme.html)
|
|
14
14
|
(will use [zopfli](https://code.google.com/p/zopfli/) on default/maximum level 4)
|
|
@@ -25,7 +25,7 @@ Optimize (lossless compress, optionally lossy) images (jpeg, png, gif, svg) usin
|
|
|
25
25
|
|
|
26
26
|
Based on [ImageOptim.app](http://imageoptim.com/).
|
|
27
27
|
|
|
28
|
-
Documentation for [latest version](http://rubydoc.info/gems/image_optim/frames) and [master](http://rubydoc.info/github/toy/image_optim/master/frames).
|
|
28
|
+
Documentation for [latest gem version](http://rubydoc.info/gems/image_optim/frames) and [master branch](http://rubydoc.info/github/toy/image_optim/master/frames).
|
|
29
29
|
|
|
30
30
|
## Gem installation
|
|
31
31
|
|
|
@@ -178,6 +178,20 @@ _Note: pngout is free to use even in commercial soft, but you can not redistribu
|
|
|
178
178
|
npm install -g svgo
|
|
179
179
|
```
|
|
180
180
|
|
|
181
|
+
If you prefer to install `svgo` to your project directory, use one of the following commands instead:
|
|
182
|
+
|
|
183
|
+
```bash
|
|
184
|
+
npm install svgo
|
|
185
|
+
|
|
186
|
+
yarn add svgo
|
|
187
|
+
```
|
|
188
|
+
|
|
189
|
+
When installing `svgo` to the project directory, you must add the following to your environment:
|
|
190
|
+
|
|
191
|
+
```
|
|
192
|
+
SVGO_BIN='node_modules/svgo/bin/svgo'
|
|
193
|
+
```
|
|
194
|
+
|
|
181
195
|
### jpeg-recompress installation (optional)
|
|
182
196
|
|
|
183
197
|
Download and install the `jpeg-recompress` binary from the [JPEG-Archive Releases](https://github.com/danielgtaylor/jpeg-archive/releases) page,
|
|
@@ -341,4 +355,4 @@ In separate file [CHANGELOG.markdown](CHANGELOG.markdown).
|
|
|
341
355
|
|
|
342
356
|
## Copyright
|
|
343
357
|
|
|
344
|
-
Copyright (c) 2012-
|
|
358
|
+
Copyright (c) 2012-2018 Ivan Kuchin. See [LICENSE.txt](LICENSE.txt) for details.
|
data/image_optim.gemspec
CHANGED
|
@@ -2,14 +2,21 @@
|
|
|
2
2
|
|
|
3
3
|
Gem::Specification.new do |s|
|
|
4
4
|
s.name = 'image_optim'
|
|
5
|
-
s.version = '0.26.
|
|
6
|
-
s.summary = %q{
|
|
5
|
+
s.version = '0.26.2'
|
|
6
|
+
s.summary = %q{Command line tool and ruby interface to optimize (lossless compress, optionally lossy) jpeg, png, gif and svg images using external utilities (advpng, gifsicle, jhead, jpeg-recompress, jpegoptim, jpegrescan, jpegtran, optipng, pngcrush, pngout, pngquant, svgo)}
|
|
7
7
|
s.homepage = "http://github.com/toy/#{s.name}"
|
|
8
8
|
s.authors = ['Ivan Kuchin']
|
|
9
9
|
s.license = 'MIT'
|
|
10
10
|
|
|
11
11
|
s.rubyforge_project = s.name
|
|
12
12
|
|
|
13
|
+
s.metadata = {
|
|
14
|
+
'bug_tracker_uri' => "https://github.com/toy/#{s.name}/issues",
|
|
15
|
+
'changelog_uri' => "https://github.com/toy/#{s.name}/CHANGELOG.markdown",
|
|
16
|
+
'documentation_uri' => "https://www.rubydoc.info/gems/#{s.name}/#{s.version}",
|
|
17
|
+
'source_code_uri' => "https://github.com/toy/#{s.name}",
|
|
18
|
+
}
|
|
19
|
+
|
|
13
20
|
s.files = `git ls-files`.split("\n")
|
|
14
21
|
s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
|
|
15
22
|
s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
|
|
@@ -21,14 +28,14 @@ You can safely remove `config.assets.image_optim = false` if you are not going t
|
|
|
21
28
|
EOF
|
|
22
29
|
|
|
23
30
|
s.add_dependency 'fspath', '~> 3.0'
|
|
24
|
-
s.add_dependency 'image_size', '
|
|
31
|
+
s.add_dependency 'image_size', '>= 1.5', '< 3'
|
|
25
32
|
s.add_dependency 'exifr', '~> 1.2', '>= 1.2.2'
|
|
26
33
|
s.add_dependency 'progress', '~> 3.0', '>= 3.0.1'
|
|
27
34
|
s.add_dependency 'in_threads', '~> 1.3'
|
|
28
35
|
|
|
29
36
|
s.add_development_dependency 'image_optim_pack', '~> 0.2', '>= 0.2.2'
|
|
30
37
|
s.add_development_dependency 'rspec', '~> 3.0'
|
|
31
|
-
if RUBY_VERSION >= '2.
|
|
32
|
-
s.add_development_dependency 'rubocop', '~> 0.
|
|
38
|
+
if RUBY_VERSION >= '2.2'
|
|
39
|
+
s.add_development_dependency 'rubocop', '~> 0.58'
|
|
33
40
|
end
|
|
34
41
|
end
|
data/lib/image_optim.rb
CHANGED
|
@@ -15,8 +15,8 @@ class ImageOptim
|
|
|
15
15
|
end
|
|
16
16
|
|
|
17
17
|
# Returns a new hash with recursive merge of all keys
|
|
18
|
-
def deep_merge(
|
|
19
|
-
|
|
18
|
+
def deep_merge(hash_a, hash_b)
|
|
19
|
+
hash_a.merge(hash_b) do |_key, value_a, value_b|
|
|
20
20
|
if value_a.is_a?(Hash) && value_b.is_a?(Hash)
|
|
21
21
|
deep_merge(value_a, value_b)
|
|
22
22
|
else
|
|
@@ -32,6 +32,10 @@ class ImageOptim
|
|
|
32
32
|
#{dst}
|
|
33
33
|
]
|
|
34
34
|
execute(:pngout, *args) && optimized?(src, dst)
|
|
35
|
+
rescue SignalException => e
|
|
36
|
+
raise unless Signal.list.key(e.signo) == 'SEGV'
|
|
37
|
+
raise unless resolve_bin!(:pngout).version <= '20150920'
|
|
38
|
+
warn "pngout caused Segmentation fault for #{src}"
|
|
35
39
|
end
|
|
36
40
|
end
|
|
37
41
|
end
|
data/script/worker_analysis
CHANGED
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: image_optim
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.26.
|
|
4
|
+
version: 0.26.2
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Ivan Kuchin
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date:
|
|
11
|
+
date: 2018-08-15 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: fspath
|
|
@@ -28,16 +28,22 @@ dependencies:
|
|
|
28
28
|
name: image_size
|
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
|
30
30
|
requirements:
|
|
31
|
-
- - "
|
|
31
|
+
- - ">="
|
|
32
32
|
- !ruby/object:Gem::Version
|
|
33
33
|
version: '1.5'
|
|
34
|
+
- - "<"
|
|
35
|
+
- !ruby/object:Gem::Version
|
|
36
|
+
version: '3'
|
|
34
37
|
type: :runtime
|
|
35
38
|
prerelease: false
|
|
36
39
|
version_requirements: !ruby/object:Gem::Requirement
|
|
37
40
|
requirements:
|
|
38
|
-
- - "
|
|
41
|
+
- - ">="
|
|
39
42
|
- !ruby/object:Gem::Version
|
|
40
43
|
version: '1.5'
|
|
44
|
+
- - "<"
|
|
45
|
+
- !ruby/object:Gem::Version
|
|
46
|
+
version: '3'
|
|
41
47
|
- !ruby/object:Gem::Dependency
|
|
42
48
|
name: exifr
|
|
43
49
|
requirement: !ruby/object:Gem::Requirement
|
|
@@ -132,14 +138,14 @@ dependencies:
|
|
|
132
138
|
requirements:
|
|
133
139
|
- - "~>"
|
|
134
140
|
- !ruby/object:Gem::Version
|
|
135
|
-
version: '0.
|
|
141
|
+
version: '0.58'
|
|
136
142
|
type: :development
|
|
137
143
|
prerelease: false
|
|
138
144
|
version_requirements: !ruby/object:Gem::Requirement
|
|
139
145
|
requirements:
|
|
140
146
|
- - "~>"
|
|
141
147
|
- !ruby/object:Gem::Version
|
|
142
|
-
version: '0.
|
|
148
|
+
version: '0.58'
|
|
143
149
|
description:
|
|
144
150
|
email:
|
|
145
151
|
executables:
|
|
@@ -254,7 +260,11 @@ files:
|
|
|
254
260
|
homepage: http://github.com/toy/image_optim
|
|
255
261
|
licenses:
|
|
256
262
|
- MIT
|
|
257
|
-
metadata:
|
|
263
|
+
metadata:
|
|
264
|
+
bug_tracker_uri: https://github.com/toy/image_optim/issues
|
|
265
|
+
changelog_uri: https://github.com/toy/image_optim/CHANGELOG.markdown
|
|
266
|
+
documentation_uri: https://www.rubydoc.info/gems/image_optim/0.26.2
|
|
267
|
+
source_code_uri: https://github.com/toy/image_optim
|
|
258
268
|
post_install_message: |
|
|
259
269
|
Rails image assets optimization is extracted into image_optim_rails gem
|
|
260
270
|
You can safely remove `config.assets.image_optim = false` if you are not going to use that gem
|
|
@@ -273,12 +283,13 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
273
283
|
version: '0'
|
|
274
284
|
requirements: []
|
|
275
285
|
rubyforge_project: image_optim
|
|
276
|
-
rubygems_version: 2.
|
|
286
|
+
rubygems_version: 2.7.7
|
|
277
287
|
signing_key:
|
|
278
288
|
specification_version: 4
|
|
279
|
-
summary:
|
|
280
|
-
using external utilities (advpng, gifsicle,
|
|
281
|
-
jpegtran, optipng, pngcrush, pngout,
|
|
289
|
+
summary: Command line tool and ruby interface to optimize (lossless compress, optionally
|
|
290
|
+
lossy) jpeg, png, gif and svg images using external utilities (advpng, gifsicle,
|
|
291
|
+
jhead, jpeg-recompress, jpegoptim, jpegrescan, jpegtran, optipng, pngcrush, pngout,
|
|
292
|
+
pngquant, svgo)
|
|
282
293
|
test_files:
|
|
283
294
|
- spec/image_optim/bin_resolver/comparable_condition_spec.rb
|
|
284
295
|
- spec/image_optim/bin_resolver/simple_version_spec.rb
|