image_optim 0.28.0 → 0.29.0
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 +4 -4
- data/.appveyor.yml +2 -0
- data/.pre-commit-hooks.yaml +9 -0
- data/.rubocop.yml +3 -0
- data/.travis.yml +7 -7
- data/CHANGELOG.markdown +7 -0
- data/LICENSE.txt +1 -1
- data/README.markdown +2 -2
- data/image_optim.gemspec +4 -1
- data/lib/image_optim.rb +0 -6
- data/lib/image_optim/bin_resolver/bin.rb +1 -1
- data/lib/image_optim/config.rb +1 -3
- data/lib/image_optim/path.rb +1 -1
- data/lib/image_optim/worker.rb +6 -15
- data/script/worker_analysis +12 -14
- metadata +19 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9035f1f635ab728b4622dc5e99d2f5e9f96eab86ea35038c4037587fd3ca90d7
|
4
|
+
data.tar.gz: d24f6305c1461483d9a67a9338c4e9385ef9282070aecdc53cf0b79e7bffb5ed
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3501154596158ee61209215d7c3a4df1b82d7384d8b54248a16992e5897701eb1e1c10bca9bbbe92312f728e403544dfa6f0dd3c3dfc33918026497550f72ef4
|
7
|
+
data.tar.gz: 72ef8a7dacc6a7cc8850d996a716a5df2098cbe47e91f58a051e95664a83494346c0daa03f61384f4bd0c6674a65e4c383ac931863ef31ffed2cc6a8d57ef4a3
|
data/.appveyor.yml
CHANGED
data/.rubocop.yml
CHANGED
data/.travis.yml
CHANGED
@@ -1,5 +1,4 @@
|
|
1
|
-
|
2
|
-
dist: trusty
|
1
|
+
dist: xenial
|
3
2
|
language: ruby
|
4
3
|
cache:
|
5
4
|
bundler: true
|
@@ -13,10 +12,11 @@ rvm:
|
|
13
12
|
- '2.2.10'
|
14
13
|
- '2.3.8'
|
15
14
|
- '2.4.10'
|
16
|
-
- '2.5.
|
17
|
-
- '2.6.
|
18
|
-
- '2.7.
|
19
|
-
- '
|
15
|
+
- '2.5.9'
|
16
|
+
- '2.6.7'
|
17
|
+
- '2.7.3'
|
18
|
+
- '3.0.1'
|
19
|
+
- 'jruby-9.2.14.0'
|
20
20
|
script:
|
21
21
|
- bundle exec image_optim --info
|
22
22
|
- bundle exec rspec
|
@@ -26,8 +26,8 @@ before_install:
|
|
26
26
|
- update_rubygems
|
27
27
|
- gem install bundler || gem install bundler --version '< 2'
|
28
28
|
- nvm install stable
|
29
|
-
- mkdir -p ~/bin
|
30
29
|
- command -v svgo || npm install -g svgo
|
30
|
+
- mkdir -p ~/bin
|
31
31
|
- command -v pngout || curl -L "https://www.jonof.id.au/files/kenutils/pngout-20200115-linux.tar.gz" | tar -xz -C ~/bin --strip-components 2 --wildcards '*/amd64/pngout'
|
32
32
|
matrix:
|
33
33
|
include:
|
data/CHANGELOG.markdown
CHANGED
@@ -2,6 +2,13 @@
|
|
2
2
|
|
3
3
|
## unreleased
|
4
4
|
|
5
|
+
## v0.29.0 (2021-04-28)
|
6
|
+
|
7
|
+
* Require at least ruby 1.9.3 [@toy](https://github.com/toy)
|
8
|
+
* Add support for use as [pre-commit](https://pre-commit.com/) hook [#192](https://github.com/toy/image_optim/pull/192) [@proinsias](https://github.com/proinsias)
|
9
|
+
* Fix `Path#copy_metadata` by rescuing also `Errno::EACCES` as it is done in `fileutils` [#187](https://github.com/toy/image_optim/issues/187) [@toy](https://github.com/toy)
|
10
|
+
* More precise regular expression for capturing svgo version [@toy](https://github.com/toy)
|
11
|
+
|
5
12
|
## v0.28.0 (2020-12-18)
|
6
13
|
|
7
14
|
* Fix and update list of markers in jpegoptim worker: allow to pass `com` instead of incorrect `comments` and add missing `xmp` and `none` [#188](https://github.com/toy/image_optim/issues/188) [@toy](https://github.com/toy)
|
data/LICENSE.txt
CHANGED
data/README.markdown
CHANGED
@@ -60,7 +60,7 @@ With version:
|
|
60
60
|
|
61
61
|
<!---<update-version>-->
|
62
62
|
```ruby
|
63
|
-
gem 'image_optim', '~> 0.
|
63
|
+
gem 'image_optim', '~> 0.29'
|
64
64
|
```
|
65
65
|
<!---</update-version>-->
|
66
66
|
|
@@ -362,4 +362,4 @@ In separate file [CHANGELOG.markdown](CHANGELOG.markdown).
|
|
362
362
|
|
363
363
|
## Copyright
|
364
364
|
|
365
|
-
Copyright (c) 2012-
|
365
|
+
Copyright (c) 2012-2021 Ivan Kuchin. See [LICENSE.txt](LICENSE.txt) for details.
|
data/image_optim.gemspec
CHANGED
@@ -2,12 +2,14 @@
|
|
2
2
|
|
3
3
|
Gem::Specification.new do |s|
|
4
4
|
s.name = 'image_optim'
|
5
|
-
s.version = '0.
|
5
|
+
s.version = '0.29.0'
|
6
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 = "https://github.com/toy/#{s.name}"
|
8
8
|
s.authors = ['Ivan Kuchin']
|
9
9
|
s.license = 'MIT'
|
10
10
|
|
11
|
+
s.required_ruby_version = '>= 1.9.3'
|
12
|
+
|
11
13
|
s.metadata = {
|
12
14
|
'bug_tracker_uri' => "https://github.com/toy/#{s.name}/issues",
|
13
15
|
'changelog_uri' => "https://github.com/toy/#{s.name}/blob/master/CHANGELOG.markdown",
|
@@ -35,5 +37,6 @@ EOF
|
|
35
37
|
s.add_development_dependency 'rspec', '~> 3.0'
|
36
38
|
if RUBY_VERSION >= '2.4' && !Gem.win_platform? && !defined?(JRUBY_VERSION)
|
37
39
|
s.add_development_dependency 'rubocop', '~> 1.0'
|
40
|
+
s.add_development_dependency 'rubocop-rspec', '~> 2.0'
|
38
41
|
end
|
39
42
|
end
|
data/lib/image_optim.rb
CHANGED
@@ -188,12 +188,6 @@ class ImageOptim
|
|
188
188
|
optimize_image_method?(method) || super
|
189
189
|
end
|
190
190
|
|
191
|
-
if RUBY_VERSION < '1.9'
|
192
|
-
def respond_to?(method, include_private = false)
|
193
|
-
optimize_image_method?(method) || super
|
194
|
-
end
|
195
|
-
end
|
196
|
-
|
197
191
|
# Version of image_optim gem spec loaded
|
198
192
|
def version
|
199
193
|
Gem.loaded_specs['image_optim'].version.to_s
|
@@ -112,7 +112,7 @@ class ImageOptim
|
|
112
112
|
when :gifsicle, :jpegoptim, :optipng
|
113
113
|
capture("#{escaped_path} --version 2> #{Path::NULL}")[/\d+(\.\d+)+/]
|
114
114
|
when :svgo, :pngquant
|
115
|
-
capture("#{escaped_path} --version 2>&1")[/\d+(\.\d+)+/]
|
115
|
+
capture("#{escaped_path} --version 2>&1")[/\A\d+(\.\d+)+/]
|
116
116
|
when :jhead, :'jpeg-recompress'
|
117
117
|
capture("#{escaped_path} -V 2> #{Path::NULL}")[/\d+(\.\d+)+/]
|
118
118
|
when :jpegtran
|
data/lib/image_optim/config.rb
CHANGED
@@ -15,9 +15,7 @@ class ImageOptim
|
|
15
15
|
|
16
16
|
# Global config path at `$XDG_CONFIG_HOME/image_optim.yml` (by default
|
17
17
|
# `~/.config/image_optim.yml`)
|
18
|
-
GLOBAL_PATH =
|
19
|
-
File.join(ENV['XDG_CONFIG_HOME'] || '~/.config', 'image_optim.yml')
|
20
|
-
end
|
18
|
+
GLOBAL_PATH = File.join(ENV['XDG_CONFIG_HOME'] || '~/.config', 'image_optim.yml')
|
21
19
|
|
22
20
|
# Local config path at `./.image_optim.yml`
|
23
21
|
LOCAL_PATH = './.image_optim.yml'
|
data/lib/image_optim/path.rb
CHANGED
data/lib/image_optim/worker.rb
CHANGED
@@ -142,21 +142,12 @@ class ImageOptim
|
|
142
142
|
# Run command defining environment, setting nice level, removing output and
|
143
143
|
# reraising signal exception
|
144
144
|
def run_command(cmd_args)
|
145
|
-
args =
|
146
|
-
|
147
|
-
|
148
|
-
|
149
|
-
|
150
|
-
|
151
|
-
].join(' ')
|
152
|
-
else
|
153
|
-
[
|
154
|
-
{'PATH' => @image_optim.env_path},
|
155
|
-
%W[nice -n #{@image_optim.nice}],
|
156
|
-
cmd_args,
|
157
|
-
{:out => Path::NULL, :err => Path::NULL},
|
158
|
-
].flatten
|
159
|
-
end
|
145
|
+
args = [
|
146
|
+
{'PATH' => @image_optim.env_path},
|
147
|
+
*%W[nice -n #{@image_optim.nice}],
|
148
|
+
*cmd_args,
|
149
|
+
{:out => Path::NULL, :err => Path::NULL},
|
150
|
+
]
|
160
151
|
Cmd.run(*args)
|
161
152
|
end
|
162
153
|
end
|
data/script/worker_analysis
CHANGED
@@ -358,20 +358,18 @@ class Analyser
|
|
358
358
|
end
|
359
359
|
|
360
360
|
def flatten_animation(image)
|
361
|
-
run_cache[:flatten][image.digest] ||=
|
362
|
-
|
363
|
-
|
364
|
-
|
365
|
-
|
366
|
-
|
367
|
-
|
368
|
-
|
369
|
-
|
370
|
-
|
371
|
-
|
372
|
-
|
373
|
-
image
|
374
|
-
end
|
361
|
+
run_cache[:flatten][image.digest] ||= if image.image_format == :gif
|
362
|
+
flattened = image.temp_path
|
363
|
+
Cmd.run(*%W[
|
364
|
+
convert
|
365
|
+
#{image.image_format}:#{image}
|
366
|
+
-coalesce
|
367
|
+
-append
|
368
|
+
#{image.image_format}:#{flattened}
|
369
|
+
]) || fail("failed flattening of #{image}")
|
370
|
+
flattened
|
371
|
+
else
|
372
|
+
image
|
375
373
|
end
|
376
374
|
end
|
377
375
|
|
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.
|
4
|
+
version: 0.29.0
|
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: 2021-04-28 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: fspath
|
@@ -146,6 +146,20 @@ dependencies:
|
|
146
146
|
- - "~>"
|
147
147
|
- !ruby/object:Gem::Version
|
148
148
|
version: '1.0'
|
149
|
+
- !ruby/object:Gem::Dependency
|
150
|
+
name: rubocop-rspec
|
151
|
+
requirement: !ruby/object:Gem::Requirement
|
152
|
+
requirements:
|
153
|
+
- - "~>"
|
154
|
+
- !ruby/object:Gem::Version
|
155
|
+
version: '2.0'
|
156
|
+
type: :development
|
157
|
+
prerelease: false
|
158
|
+
version_requirements: !ruby/object:Gem::Requirement
|
159
|
+
requirements:
|
160
|
+
- - "~>"
|
161
|
+
- !ruby/object:Gem::Version
|
162
|
+
version: '2.0'
|
149
163
|
description:
|
150
164
|
email:
|
151
165
|
executables:
|
@@ -155,6 +169,7 @@ extra_rdoc_files: []
|
|
155
169
|
files:
|
156
170
|
- ".appveyor.yml"
|
157
171
|
- ".gitignore"
|
172
|
+
- ".pre-commit-hooks.yaml"
|
158
173
|
- ".rubocop.yml"
|
159
174
|
- ".travis.yml"
|
160
175
|
- CHANGELOG.markdown
|
@@ -264,7 +279,7 @@ licenses:
|
|
264
279
|
metadata:
|
265
280
|
bug_tracker_uri: https://github.com/toy/image_optim/issues
|
266
281
|
changelog_uri: https://github.com/toy/image_optim/blob/master/CHANGELOG.markdown
|
267
|
-
documentation_uri: https://www.rubydoc.info/gems/image_optim/0.
|
282
|
+
documentation_uri: https://www.rubydoc.info/gems/image_optim/0.29.0
|
268
283
|
source_code_uri: https://github.com/toy/image_optim
|
269
284
|
post_install_message: |
|
270
285
|
Rails image assets optimization is extracted into image_optim_rails gem
|
@@ -276,7 +291,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
276
291
|
requirements:
|
277
292
|
- - ">="
|
278
293
|
- !ruby/object:Gem::Version
|
279
|
-
version:
|
294
|
+
version: 1.9.3
|
280
295
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
281
296
|
requirements:
|
282
297
|
- - ">="
|