image_optim_pack 0.8.0.20220418 → 0.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
2
  SHA256:
3
- metadata.gz: f74ad2edae9f66fb59f57323d6c7b2080451f2ee87cf79cc02976b8eea2482ae
4
- data.tar.gz: 5907e66255dc0b6ce1360d2ed694dd948e69066499b3b5287e9c87f45175ca86
3
+ metadata.gz: 485671ab97a671783e2c82e97e314d6357cdf876aed8a7204544a4b99b941027
4
+ data.tar.gz: 87ae97230127d09301cad73baa7321b21f553c9ed2b1a34642ad4715a6896bce
5
5
  SHA512:
6
- metadata.gz: 1e1f3de2553d0736e68dfd0e603d73d49023f58c7750f60b7f619216576a8f48849d5171a305cdcf6c83367129928b03edbd66dae7d71ceb7d81f0ca4f170066
7
- data.tar.gz: 613b15a5c0204c7a42413e2a4b2aae0aacb10fab146b85865d1edfe1e3bcb23d0735af00fe605bc3266b1c7001670139c2e2d7188302474141d1f7f2b0ced0aa
6
+ metadata.gz: 21083f41e2bb802f5664e55ee7a1c2d0ee47e449b9ca608efb1fe9873a23974eefb719d30429d2b200b0d221bd9d329999589ead24e16f9ef074c9cc7b52bbb1
7
+ data.tar.gz: 215fda23456e52270e8d1a89cd0715a858792f4ccd0b37ca630efa9ea36181b86c45c133b83ab3be6afaf8ddc9b2c05d25a5f88b0056dace727347ed970402b7
data/CHANGELOG.markdown CHANGED
@@ -2,6 +2,10 @@
2
2
 
3
3
  ## unreleased
4
4
 
5
+ ## v0.9.0 (2022-06-11)
6
+
7
+ * Add [pngout](http://advsys.net/ken/utils.htm) (since January 2021 license allows redistrubition for freely distributed non-commercial projects) [#24](https://github.com/toy/image_optim_pack/issues/24) [@toy](https://github.com/toy)
8
+
5
9
  ## v0.8.0.20220418 (2022-04-18)
6
10
 
7
11
  * advancecomp 2.3 and jpegoptim 1.4.7 [@toy](https://github.com/toy)
data/Dockerfile CHANGED
@@ -125,6 +125,14 @@ RUN ./extract pngcrush && \
125
125
  make && \
126
126
  install -c pngcrush /usr/local/bin
127
127
 
128
+ FROM build as pngout
129
+ ARG PNGOUT_LINUX_STATIC_VER
130
+ ARG PNGOUT_LINUX_STATIC_SHA256
131
+ COPY download/pngout_linux_static-$PNGOUT_LINUX_STATIC_VER.tar.gz download/
132
+ RUN ./extract pngout_linux_static && \
133
+ cd build/pngout_linux_static && \
134
+ cp amd64/pngout-static /usr/local/bin/pngout
135
+
128
136
  FROM liblcms as pngquant
129
137
  ARG PNGQUANT_VER
130
138
  ARG PNGQUANT_SHA256
@@ -145,6 +153,9 @@ RUN ./extract pngquant && \
145
153
  FROM base as image_optim
146
154
  RUN apk add --no-cache libstdc++ ruby npm perl dumb-init
147
155
 
156
+ COPY README.markdown /
157
+ COPY acknowledgements /acknowledgements
158
+
148
159
  COPY --from=advancecomp /usr/local/bin/advpng /usr/local/bin/
149
160
  COPY --from=gifsicle /usr/local/bin/gifsicle /usr/local/bin/
150
161
  COPY --from=jhead /usr/local/bin/jhead /usr/local/bin/
@@ -154,6 +165,7 @@ COPY --from=libjpeg /usr/local/bin/jpegtran /usr/local/bin/
154
165
  COPY --from=optipng /usr/local/bin/optipng /usr/local/bin/
155
166
  COPY --from=oxipng /usr/local/bin/oxipng /usr/local/bin/
156
167
  COPY --from=pngcrush /usr/local/bin/pngcrush /usr/local/bin/
168
+ COPY --from=pngout /usr/local/bin/pngout /usr/local/bin/
157
169
  COPY --from=pngquant /usr/local/bin/pngquant /usr/local/bin/
158
170
 
159
171
  COPY --from=libjpeg /usr/local/lib/libjpeg.so.9 /usr/local/lib/
@@ -163,5 +175,5 @@ COPY --from=liblcms /usr/local/lib/liblcms2.so.2 /usr/local/lib/
163
175
 
164
176
  RUN npm -g install svgo
165
177
  RUN gem install --no-document image_optim
166
- ENTRYPOINT ["dumb-init", "image_optim", "--skip-missing-workers"]
178
+ ENTRYPOINT ["dumb-init", "image_optim"]
167
179
  CMD ["--help"]
data/Makefile CHANGED
@@ -15,6 +15,10 @@ LIBZ_VER := 1.2.11
15
15
  OPTIPNG_VER := 0.7.7
16
16
  OXIPNG_VER := 5.0.1
17
17
  PNGCRUSH_VER := 1.8.13
18
+ PNGOUT_VER := 20200115
19
+ PNGOUT_LINUX_VER := $(PNGOUT_VER)
20
+ PNGOUT_LINUX_STATIC_VER := $(PNGOUT_VER)
21
+ PNGOUT_DARWIN_VER := $(PNGOUT_VER)
18
22
  PNGQUANT_VER := 2.17.0
19
23
 
20
24
  # ====== CHECKSUMS ======
@@ -57,12 +61,13 @@ sha256sum := $(shell if command -v sha256sum >/dev/null 2>&1; then echo sha256su
57
61
  ARCHIVES :=
58
62
 
59
63
  # $1 - name of archive
64
+ # $2 - extension to use (instead of default tar.gz)
60
65
  define archive
61
66
  ARCHIVES += $1
62
67
  $1_DIR := $(BUILD_DIR)/$(call downcase,$1)
63
- $1_TGZ := $(DL_DIR)/$(call downcase,$1)-$($1_VER).tar.gz
64
- $1_EXTRACTED := $$($1_DIR)/__$$(notdir $$($1_TGZ))__
65
- $$($1_EXTRACTED) : $$($1_TGZ)
68
+ $1_ARC := $(DL_DIR)/$(call downcase,$1)-$($1_VER).$(or $2,tar.gz)
69
+ $1_EXTRACTED := $$($1_DIR)/__$$(notdir $$($1_ARC))__
70
+ $$($1_EXTRACTED) : $$($1_ARC)
66
71
  mkdir -p $(BUILD_DIR)
67
72
  rm -rf $$(@D)
68
73
  echo "$$($1_SHA256) $$<" | $(sha256sum) -c
@@ -73,10 +78,11 @@ endef
73
78
 
74
79
  # $1 - name of archive
75
80
  # $2 - url of archive with [VER] for replace with version
81
+ # $3 - extension to use
76
82
  define archive-dl
77
- $(call archive,$1)
83
+ $(call archive,$1,$3)
78
84
  # download archive from url
79
- $$($1_TGZ) :
85
+ $$($1_ARC) :
80
86
  mkdir -p $(DL_DIR)
81
87
  test -w $(DL_DIR)
82
88
  while ! mkdir $$@.lock 2> /dev/null; do sleep 1; done
@@ -98,25 +104,28 @@ $(eval $(call archive-dl,LIBZ, https://prdownloads.sourceforge.net/libpng
98
104
  $(eval $(call archive-dl,OPTIPNG, https://prdownloads.sourceforge.net/optipng/optipng-[VER].tar.gz?download))
99
105
  $(eval $(call archive-dl,OXIPNG, https://github.com/shssoichiro/oxipng/archive/refs/tags/v[VER].tar.gz))
100
106
  $(eval $(call archive-dl,PNGCRUSH, https://prdownloads.sourceforge.net/pmt/pngcrush-[VER]-nolib.tar.gz?download))
107
+ $(eval $(call archive-dl,PNGOUT_LINUX,http://www.jonof.id.au/files/kenutils/pngout-[VER]-linux.tar.gz))
108
+ $(eval $(call archive-dl,PNGOUT_LINUX_STATIC,http://www.jonof.id.au/files/kenutils/pngout-[VER]-linux-static.tar.gz))
109
+ $(eval $(call archive-dl,PNGOUT_DARWIN,http://www.jonof.id.au/files/kenutils/pngout-[VER]-macos.zip,zip))
101
110
  $(eval $(call archive-dl,PNGQUANT, https://pngquant.org/pngquant-[VER]-src.tar.gz))
102
111
 
103
- download : $(foreach archive,$(ARCHIVES),$($(archive)_TGZ))
112
+ download : $(foreach archive,$(ARCHIVES),$($(archive)_ARC))
104
113
  .PHONY : download
105
114
 
106
115
  download-tidy-up :
107
- rm -f $(filter-out $(foreach archive,$(ARCHIVES),$($(archive)_TGZ)),$(wildcard $(DL_DIR)/*.*))
116
+ rm -f $(filter-out $(foreach archive,$(ARCHIVES),$($(archive)_ARC)),$(wildcard $(DL_DIR)/*.*))
108
117
  .PHONY : download-tidy-up
109
118
 
110
119
  checksum : download
111
- @$(sha256sum) $(foreach archive,$(ARCHIVES),$($(archive)_TGZ))
120
+ @$(sha256sum) $(foreach archive,$(ARCHIVES),$($(archive)_ARC))
112
121
  .PHONY : checksum
113
122
 
114
123
  checksum-verify : download
115
- @printf '%s %s\n' $(foreach archive,$(ARCHIVES),$($(archive)_SHA256) $($(archive)_TGZ)) | $(sha256sum) -c
124
+ @printf '%s %s\n' $(foreach archive,$(ARCHIVES),$($(archive)_SHA256) $($(archive)_ARC)) | $(sha256sum) -c
116
125
  .PHONY : checksum-verify
117
126
 
118
127
  checksum-update : download
119
- @printf '%s := %s\n' $(foreach archive,$(ARCHIVES),$(archive)_SHA256 $(shell $(sha256sum) $($(archive)_TGZ) | cut -d ' ' -f 1)) > checksums.mk
128
+ @printf '%s := %s\n' $(foreach archive,$(ARCHIVES),$(archive)_SHA256 $(shell $(sha256sum) $($(archive)_ARC) | cut -d ' ' -f 1)) > checksums.mk
120
129
  .PHONY : checksum-update
121
130
 
122
131
  # ====== PRODUCTS ======
@@ -130,7 +139,7 @@ define target-build
130
139
  $1_PATH := $(or $3,$(call downcase,$1))
131
140
  $1_BASENAME := $$(notdir $$($1_PATH))
132
141
  $1_DIR := $($(or $2,$1)_DIR)
133
- $1_TGZ := $($(or $2,$1)_TGZ)
142
+ $1_ARC := $($(or $2,$1)_ARC)
134
143
  $1_EXTRACTED := $($(or $2,$1)_EXTRACTED)
135
144
  $1_TARGET := $$($1_DIR)/$$($1_PATH)
136
145
  $$($1_TARGET) : DIR := $$($1_DIR)
@@ -140,6 +149,7 @@ endef
140
149
  # $1 - product name
141
150
  # $2 - archive name ($1 if empty)
142
151
  # $3 - basename ($1 if empty)
152
+ # $4 - don't strip the target
143
153
  define target
144
154
  $(call target-build,$1,$2,$3)
145
155
  PRODUCTS += $1
@@ -148,7 +158,7 @@ $1_DESTINATION := $$(OUTPUT_DIR)/$$($1_BASENAME)
148
158
  $$($1_DESTINATION) : $$($1_TARGET)
149
159
  mkdir -p $(OUTPUT_DIR)
150
160
  temppath=`mktemp "$(BUILD_DIR)"/tmp.XXXXXXXXXX` && \
151
- strip $$< -Sx -o "$$$$temppath" && \
161
+ $(if $4,cp $$< "$$$$temppath",strip $$< -Sx -o "$$$$temppath") && \
152
162
  chmod 755 "$$$$temppath" && \
153
163
  mv "$$$$temppath" $$@
154
164
  # short name target
@@ -169,6 +179,11 @@ $(eval $(call target,LIBZ,,libz$(DLEXT)))
169
179
  $(eval $(call target,OPTIPNG,,src/optipng/optipng))
170
180
  $(eval $(call target,OXIPNG,,target/release/oxipng))
171
181
  $(eval $(call target,PNGCRUSH))
182
+ ifdef IS_DARWIN
183
+ $(eval $(call target,PNGOUT,PNGOUT_DARWIN,,NOSTRIP))
184
+ else
185
+ $(eval $(call target,PNGOUT,PNGOUT_LINUX,,NOSTRIP))
186
+ endif
172
187
  $(eval $(call target,PNGQUANT))
173
188
 
174
189
  # ====== TARGETS ======
@@ -195,7 +210,7 @@ define check_exists
195
210
  endef
196
211
 
197
212
  define check_version
198
- @$(OUTPUT_DIR)/$1 $2 | fgrep -q $3 || \
213
+ @$(OUTPUT_DIR)/$1 $2 | fgrep -q "$3" || \
199
214
  { printf "$1: $(ANSI_RED)Expected $3, got $$($(OUTPUT_DIR)/$1 $2)$(ANSI_RESET)\n"; exit 1; }
200
215
  endef
201
216
 
@@ -249,6 +264,7 @@ test :
249
264
  $(call check_bin,optipng,--version,$(OPTIPNG_VER))
250
265
  $(call check_bin,oxipng,--version,$(OXIPNG_VER))
251
266
  $(call check_bin,pngcrush,-version 2>&1,$(PNGCRUSH_VER))
267
+ $(call check_bin,pngout,2>&1,$(shell perl -mTime::Piece -e 'print Time::Piece->strptime("$(PNGOUT_VER)", "%Y%m%d")->strftime("%b %e %Y")'))
252
268
  $(call check_bin,pngquant,--help,$(PNGQUANT_VER))
253
269
  .PHONY : test
254
270
 
@@ -271,15 +287,19 @@ docker-build : download
271
287
  $(foreach archive,$(ARCHIVES),--build-arg $(archive)_VER=$($(archive)_VER) --build-arg $(archive)_SHA256=$($(archive)_SHA256)) \
272
288
  -t $(DOCKER_IMAGE):latest \
273
289
  .
274
- .PHONY : docker-build
275
-
276
- docker-tag : docker-build
277
290
  @docker tag \
278
291
  $(DOCKER_IMAGE):latest \
279
292
  $(DOCKER_IMAGE):$(DOCKER_TAG)
280
- .PHONY : docker-tag
293
+ .PHONY : docker-build
281
294
 
282
- docker-push : docker-tag
295
+ docker-test : docker-build
296
+ @docker run \
297
+ --rm \
298
+ $(DOCKER_IMAGE):latest \
299
+ --info
300
+ .PHONY : docker-test
301
+
302
+ docker-push : docker-test
283
303
  @docker push $(DOCKER_IMAGE):latest
284
304
  @docker push $(DOCKER_IMAGE):$(DOCKER_TAG)
285
305
  .PHONY : docker-push
@@ -487,6 +507,13 @@ $(PNGCRUSH_TARGET) :
487
507
  LDFLAGS="$(XORIGIN) $(LDFLAGS)"
488
508
  $(call chrpath_origin,$@)
489
509
 
510
+ ## pngout
511
+ $(PNGOUT_TARGET) :
512
+ ifdef IS_LINUX
513
+ cd $(DIR) && ln -sf $(ARCH:x86_64=amd64)/pngout .
514
+ endif
515
+ cd $(DIR) && touch pngout
516
+
490
517
  ## pngquant
491
518
  $(eval $(call depend,PNGQUANT,LIBLCMS LIBPNG LIBZ))
492
519
  $(PNGQUANT_TARGET) :
data/README.markdown CHANGED
@@ -38,6 +38,9 @@ A test application with latest `image_optim` and `image_optim_pack` is available
38
38
  * [oxipng](https://github.com/shssoichiro/oxipng) by Joshua Holmer ([license](acknowledgements/oxipng.txt))
39
39
  * [pngcrush](https://pmt.sourceforge.io/pngcrush/) by Glenn Randers-Pehrson, portions by Greg Roelofs ([license](acknowledgements/pngcrush.txt))
40
40
  * contains [cexcept](http://www.nicemice.net/cexcept/) interface by Adam M. Costello and Cosmin Truta ([license](acknowledgements/cexcept.txt))
41
+ * [pngout](http://advsys.net/ken/utils.htm) by Ken Silverman ([license](acknowledgements/pngout.txt))
42
+ * Linux and BSD ports by Jonathon Fowler (http://www.jonof.id.au/pngout)
43
+ * Mac OS X port by Ken Silverman, with assistance by Jonathon Fowler
41
44
  * [pngquant](https://pngquant.org/) by Kornel Lesiński based on code by Greg Roelofs and Jef Poskanzer after an idea by Stefan Schneider ([license](acknowledgements/pngquant.txt))
42
45
  * [zlib](https://zlib.net/) by Jean-Loup Gailly and Mark Adler ([license](acknowledgements/zlib.txt))
43
46
 
@@ -0,0 +1,9 @@
1
+ PNGOUT / KZIP license:
2
+
3
+ I have gotten a lot of requests about bundling the command line executables, or releasing the source code to KZIP and PNGOUT. This is my license (updated 01/16/2021):
4
+
5
+ * The command line versions of PNGOUT.EXE and KZIP.EXE are free for use, as are the Mac and Linux ports.
6
+ * You may use PNGOUT- or KZIP-compressed content for non-commercial or commercial purposes.
7
+ * Redistributing, repackaging, or reusing the PNGOUT or KZIP executable is permitted for non-commercial projects that are distributed freely.
8
+ * For commercial requests (such as bundling with a commercial product), please write to my business partner, David Blake.
9
+ * When bundling, my credit (both my name and website) must be clearly displayed in some reasonable fashion that can be seen by an average user.
data/checksums.mk CHANGED
@@ -11,4 +11,7 @@ LIBZ_SHA256 := c3e5e9fdd5004dcb542feda5ee4f0ff0744628baf8ed2dd5d66f8ca1197cb1a1
11
11
  OPTIPNG_SHA256 := 4f32f233cef870b3f95d3ad6428bfe4224ef34908f1b42b0badf858216654452
12
12
  OXIPNG_SHA256 := aff72d2f627617f3f36d9796e65b83eb34f24d2c94f3a55612ade2df8ab8d946
13
13
  PNGCRUSH_SHA256 := fed0aaf5c098aa8c7f78c75365cd18d7341417326ecbdba547876b7b4f3df4be
14
+ PNGOUT_LINUX_SHA256 := ac38bba6f0de29033de866538c3afa64341319b695bbe388efbc5fd9e830e928
15
+ PNGOUT_LINUX_STATIC_SHA256 := 7a78ea475d65a00981bf418e5dfa3b34e42d6460fb992340802873bb14b08597
16
+ PNGOUT_DARWIN_SHA256 := 3272fa947eeafc1ac0086e1f14935f9efa21d090a555e6892255fe5c88f6686e
14
17
  PNGQUANT_SHA256 := a27cf0e64db499ccb3ddae9b36036e881f78293e46ec27a9e7a86a3802fcda66
@@ -2,7 +2,7 @@
2
2
 
3
3
  Gem::Specification.new do |s|
4
4
  s.name = 'image_optim_pack'
5
- s.version = '0.8.0.20220418'
5
+ s.version = '0.9.0'
6
6
  s.summary = %q{Precompiled binaries for image_optim: advpng, gifsicle, jhead, jpeg-recompress, jpegoptim, jpegtran, optipng, pngcrush, pngquant}
7
7
  s.homepage = "https://github.com/toy/#{s.name}"
8
8
  s.authors = ['Ivan Kuchin']
data/script/livecheck CHANGED
@@ -208,6 +208,9 @@ oxipng:
208
208
  pngcrush:
209
209
  url: https://sourceforge.net/projects/pmt/rss?path=/pngcrush
210
210
  regexp: /pngcrush/(\d+(?:\.\d+)*)/
211
+ pngout:
212
+ url: http://www.jonof.id.au/kenutils.html
213
+ regexp: /files/kenutils/pngout-(\d{8})-linux.tar.gz
211
214
  pngquant:
212
215
  url: https://pngquant.org/releases.html
213
216
  regexp: <span itemprop='version'>(\d+(?:\.\d+)*)</span>
@@ -36,9 +36,9 @@ version_time = begin
36
36
  end.sort
37
37
  time_pairs << [nil, Time.now]
38
38
 
39
- time_pairs.each_cons(2).map do |(version_n, created_at), (_, next_created_at)|
39
+ time_pairs.each_cons(2).to_h do |(version_n, created_at), (_, next_created_at)|
40
40
  [version_n, next_created_at - created_at]
41
- end.to_h
41
+ end
42
42
  end
43
43
 
44
44
  table = Terminal::Table.new
Binary file
Binary file
Binary file
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: image_optim_pack
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.8.0.20220418
4
+ version: 0.9.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: 2022-04-18 00:00:00.000000000 Z
11
+ date: 2022-06-11 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: image_optim
@@ -131,6 +131,7 @@ files:
131
131
  - acknowledgements/optipng.txt
132
132
  - acknowledgements/oxipng.txt
133
133
  - acknowledgements/pngcrush.txt
134
+ - acknowledgements/pngout.txt
134
135
  - acknowledgements/pngquant.txt
135
136
  - acknowledgements/smallfry.txt
136
137
  - acknowledgements/zlib.txt
@@ -170,6 +171,7 @@ files:
170
171
  - vendor/darwin-x86_64/optipng
171
172
  - vendor/darwin-x86_64/oxipng
172
173
  - vendor/darwin-x86_64/pngcrush
174
+ - vendor/darwin-x86_64/pngout
173
175
  - vendor/darwin-x86_64/pngquant
174
176
  - vendor/linux-i686/advpng
175
177
  - vendor/linux-i686/gifsicle
@@ -184,6 +186,7 @@ files:
184
186
  - vendor/linux-i686/optipng
185
187
  - vendor/linux-i686/oxipng
186
188
  - vendor/linux-i686/pngcrush
189
+ - vendor/linux-i686/pngout
187
190
  - vendor/linux-i686/pngquant
188
191
  - vendor/linux-x86_64/advpng
189
192
  - vendor/linux-x86_64/gifsicle
@@ -198,6 +201,7 @@ files:
198
201
  - vendor/linux-x86_64/optipng
199
202
  - vendor/linux-x86_64/oxipng
200
203
  - vendor/linux-x86_64/pngcrush
204
+ - vendor/linux-x86_64/pngout
201
205
  - vendor/linux-x86_64/pngquant
202
206
  homepage: https://github.com/toy/image_optim_pack
203
207
  licenses:
@@ -205,7 +209,7 @@ licenses:
205
209
  metadata:
206
210
  bug_tracker_uri: https://github.com/toy/image_optim_pack/issues
207
211
  changelog_uri: https://github.com/toy/image_optim_pack/blob/master/CHANGELOG.markdown
208
- documentation_uri: https://www.rubydoc.info/gems/image_optim_pack/0.8.0.20220418
212
+ documentation_uri: https://www.rubydoc.info/gems/image_optim_pack/0.9.0
209
213
  source_code_uri: https://github.com/toy/image_optim_pack
210
214
  post_install_message:
211
215
  rdoc_options: []