image_optim_pack 0.8.0.20220418-x86_64-darwin → 0.9.1.20220907-x86_64-darwin
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/workflows/livecheck.yml +38 -0
- data/.rubocop.yml +2 -0
- data/CHANGELOG.markdown +12 -0
- data/Dockerfile +13 -1
- data/Makefile +51 -27
- data/README.markdown +8 -2
- data/Vagrantfile +4 -0
- data/acknowledgements/pngout.txt +9 -0
- data/checksums.mk +5 -2
- data/image_optim_pack.gemspec +1 -1
- data/script/livecheck +71 -51
- data/script/platform_downloads +2 -2
- data/script/run +3 -1
- data/vendor/darwin-x86_64/jpeg-recompress +0 -0
- data/vendor/darwin-x86_64/oxipng +0 -0
- data/vendor/darwin-x86_64/pngout +0 -0
- metadata +6 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: '02088ef777ea2af30b660c2f76e97d54406305cfc34e4b9b6708262f1eeb03c0'
|
4
|
+
data.tar.gz: 7839d215764d9fe6442a76444961b7ac2d08e685c0f58140e6f127e0eb0a9e90
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f90353c9b45c09fefffc90991cead80f1ba256055b402dc595aea5d894fd738043e6c3b5169279925c6b78461bb8f5208f8a8b209775aa8cca3782e8b3ec4c4f
|
7
|
+
data.tar.gz: c09998d95abdf6ed978c64938ebb295ba00bdd7e09683274d4c7e9235e64f0df12f661f18959ff85bd3efbf04d2ee40e08bc3a2a6a42ab709b57eb72213a1d30
|
@@ -0,0 +1,38 @@
|
|
1
|
+
name: livecheck
|
2
|
+
on:
|
3
|
+
schedule:
|
4
|
+
- cron: 34 5 * * *
|
5
|
+
workflow_dispatch:
|
6
|
+
inputs:
|
7
|
+
retry:
|
8
|
+
description: 'Retry attempt'
|
9
|
+
required: true
|
10
|
+
type: number
|
11
|
+
jobs:
|
12
|
+
livecheck:
|
13
|
+
runs-on: ubuntu-latest
|
14
|
+
steps:
|
15
|
+
- uses: actions/checkout@v2
|
16
|
+
- uses: ruby/setup-ruby@v1
|
17
|
+
with:
|
18
|
+
ruby-version: '3.1'
|
19
|
+
bundler-cache: true
|
20
|
+
- run: |
|
21
|
+
bundle exec script/livecheck || if (( $? == 1 )); then
|
22
|
+
exit 1
|
23
|
+
else
|
24
|
+
echo '::set-output name=RETRY::1'
|
25
|
+
fi
|
26
|
+
id: livecheck
|
27
|
+
- if: ${{ steps.livecheck.outputs.RETRY }}
|
28
|
+
env:
|
29
|
+
RETRY: ${{ inputs.retry }}
|
30
|
+
RETRIES: 10
|
31
|
+
GITHUB_TOKEN: ${{ secrets.RETRY_TOKEN }}
|
32
|
+
run: |
|
33
|
+
if (( ${RETRY:-0} < $RETRIES )); then
|
34
|
+
sleep 300
|
35
|
+
gh workflow run livecheck --repo $GITHUB_REPOSITORY --ref $GITHUB_REF_NAME -f retry=$(( $RETRY + 1 ))
|
36
|
+
else
|
37
|
+
exit 1
|
38
|
+
fi
|
data/.rubocop.yml
CHANGED
data/CHANGELOG.markdown
CHANGED
@@ -2,6 +2,18 @@
|
|
2
2
|
|
3
3
|
## unreleased
|
4
4
|
|
5
|
+
## v0.9.1.20220907 (2022-09-07)
|
6
|
+
|
7
|
+
* oxipng 6.0.0 [@toy](https://github.com/toy)
|
8
|
+
|
9
|
+
## v0.9.1 (2022-08-29)
|
10
|
+
|
11
|
+
* libmozjpeg 4.1.1, updrade 32 bit ubuntu to bionic [@toy](https://github.com/toy)
|
12
|
+
|
13
|
+
## v0.9.0 (2022-06-11)
|
14
|
+
|
15
|
+
* 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)
|
16
|
+
|
5
17
|
## v0.8.0.20220418 (2022-04-18)
|
6
18
|
|
7
19
|
* 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"
|
178
|
+
ENTRYPOINT ["dumb-init", "image_optim"]
|
167
179
|
CMD ["--help"]
|
data/Makefile
CHANGED
@@ -9,12 +9,16 @@ JPEGARCHIVE_VER := 2.2.0
|
|
9
9
|
JPEGOPTIM_VER := 1.4.7
|
10
10
|
LIBJPEG_VER := 9e
|
11
11
|
LIBLCMS_VER := 2.13
|
12
|
-
LIBMOZJPEG_VER := 4.
|
12
|
+
LIBMOZJPEG_VER := 4.1.1
|
13
13
|
LIBPNG_VER := 1.6.37
|
14
14
|
LIBZ_VER := 1.2.11
|
15
15
|
OPTIPNG_VER := 0.7.7
|
16
|
-
OXIPNG_VER :=
|
16
|
+
OXIPNG_VER := 6.0.0
|
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
|
-
$
|
64
|
-
$1_EXTRACTED := $$($1_DIR)/__$$(notdir $$($
|
65
|
-
$$($1_EXTRACTED) : $$($
|
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
|
-
$$($
|
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)
|
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)
|
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)
|
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)
|
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)
|
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
|
-
$
|
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 ======
|
@@ -191,21 +206,21 @@ ldd-version :; $(ldd) --version
|
|
191
206
|
|
192
207
|
define check_exists
|
193
208
|
@test -f $(OUTPUT_DIR)/$1 || \
|
194
|
-
{ printf "
|
209
|
+
{ printf "%s: $(ANSI_RED)not found$(ANSI_RESET)\n" "$1"; exit 1; }
|
195
210
|
endef
|
196
211
|
|
197
212
|
define check_version
|
198
|
-
@$(OUTPUT_DIR)/$1 $2 | fgrep -q $3 || \
|
199
|
-
{ printf "
|
213
|
+
@$(OUTPUT_DIR)/$1 $2 | fgrep -q "$3" || \
|
214
|
+
{ printf "%s: $(ANSI_RED)Expected %s, got %s$(ANSI_RESET)\n" "$1" "$3" "$$($(OUTPUT_DIR)/$1 $2)"; exit 1; }
|
200
215
|
endef
|
201
216
|
|
202
217
|
define check_arch
|
203
218
|
@file -b $(OUTPUT_DIR)/$1 | fgrep -q '$(ARCH_STRING)' || \
|
204
|
-
{ printf "
|
219
|
+
{ printf "%s: $(ANSI_RED)Expected %s, got %s$(ANSI_RESET)\n" "$1" "$(ARCH_STRING)" "$$(file -b $(OUTPUT_DIR)/$1)"; exit 1; }
|
205
220
|
endef
|
206
221
|
|
207
222
|
define check_output
|
208
|
-
@printf "
|
223
|
+
@printf "%s: $(ANSI_GREEN)%s$(ANSI_RESET) / $(ANSI_MAGENTA)%s$(ANSI_RESET)\n" "$1" "$3" "$(ARCH_STRING)"
|
209
224
|
endef
|
210
225
|
|
211
226
|
define check_shlib
|
@@ -249,12 +264,10 @@ 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 | head -n 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
|
|
255
|
-
livecheck :; @script/livecheck
|
256
|
-
.PHONY : livecheck
|
257
|
-
|
258
271
|
update-versions :
|
259
272
|
script/livecheck --update
|
260
273
|
make checksum-update
|
@@ -271,15 +284,19 @@ docker-build : download
|
|
271
284
|
$(foreach archive,$(ARCHIVES),--build-arg $(archive)_VER=$($(archive)_VER) --build-arg $(archive)_SHA256=$($(archive)_SHA256)) \
|
272
285
|
-t $(DOCKER_IMAGE):latest \
|
273
286
|
.
|
274
|
-
.PHONY : docker-build
|
275
|
-
|
276
|
-
docker-tag : docker-build
|
277
287
|
@docker tag \
|
278
288
|
$(DOCKER_IMAGE):latest \
|
279
289
|
$(DOCKER_IMAGE):$(DOCKER_TAG)
|
280
|
-
.PHONY : docker-
|
290
|
+
.PHONY : docker-build
|
291
|
+
|
292
|
+
docker-test : docker-build
|
293
|
+
@docker run \
|
294
|
+
--rm \
|
295
|
+
$(DOCKER_IMAGE):latest \
|
296
|
+
--info
|
297
|
+
.PHONY : docker-test
|
281
298
|
|
282
|
-
docker-push : docker-
|
299
|
+
docker-push : docker-test
|
283
300
|
@docker push $(DOCKER_IMAGE):latest
|
284
301
|
@docker push $(DOCKER_IMAGE):$(DOCKER_TAG)
|
285
302
|
.PHONY : docker-push
|
@@ -487,6 +504,13 @@ $(PNGCRUSH_TARGET) :
|
|
487
504
|
LDFLAGS="$(XORIGIN) $(LDFLAGS)"
|
488
505
|
$(call chrpath_origin,$@)
|
489
506
|
|
507
|
+
## pngout
|
508
|
+
$(PNGOUT_TARGET) :
|
509
|
+
ifdef IS_LINUX
|
510
|
+
cd $(DIR) && ln -sf $(ARCH:x86_64=amd64)/pngout .
|
511
|
+
endif
|
512
|
+
cd $(DIR) && touch pngout
|
513
|
+
|
490
514
|
## pngquant
|
491
515
|
$(eval $(call depend,PNGQUANT,LIBLCMS LIBPNG LIBZ))
|
492
516
|
$(PNGQUANT_TARGET) :
|
data/README.markdown
CHANGED
@@ -1,5 +1,8 @@
|
|
1
1
|
[![Gem Version](https://img.shields.io/gem/v/image_optim_pack?logo=rubygems)](https://rubygems.org/gems/image_optim_pack)
|
2
2
|
[![Build Status](https://img.shields.io/github/workflow/status/toy/image_optim_pack/check/master?logo=github)](https://github.com/toy/image_optim_pack/actions/workflows/check.yml)
|
3
|
+
[![Rubocop](https://img.shields.io/github/workflow/status/toy/image_optim_pack/rubocop/master?label=rubocop&logo=rubocop)](https://github.com/toy/image_optim_pack/actions/workflows/rubocop.yml)
|
4
|
+
[![Docker build](https://img.shields.io/github/workflow/status/toy/image_optim_pack/docker-build?label=docker+build&logo=docker)](https://github.com/toy/image_optim_pack/actions/workflows/docker-build.yml)
|
5
|
+
[![Livecheck](https://img.shields.io/github/workflow/status/toy/image_optim_pack/livecheck/master?label=livecheck&logo=github)](https://github.com/toy/image_optim_pack/actions/workflows/livecheck.yml)
|
3
6
|
[![Code Climate](https://img.shields.io/codeclimate/maintainability/toy/image_optim_pack?logo=codeclimate)](https://codeclimate.com/github/toy/image_optim_pack)
|
4
7
|
[![Depfu](https://img.shields.io/depfu/toy/image_optim_pack)](https://depfu.com/github/toy/image_optim_pack)
|
5
8
|
[![Inch CI](https://inch-ci.org/github/toy/image_optim_pack.svg?branch=master)](https://inch-ci.org/github/toy/image_optim_pack)
|
@@ -10,7 +13,7 @@ Precompiled binaries for [`image_optim`](https://github.com/toy/image_optim).
|
|
10
13
|
|
11
14
|
Contains binaries for Mac OS X (>= 10.9, x86\_64) and Linux (i686 and x86\_64).
|
12
15
|
|
13
|
-
A test application with latest `image_optim` and `image_optim_pack` is available on
|
16
|
+
A test application with latest `image_optim` and `image_optim_pack` is available on render: https://iopack.onrender.com/.
|
14
17
|
|
15
18
|
## Binaries and libraries
|
16
19
|
|
@@ -38,6 +41,9 @@ A test application with latest `image_optim` and `image_optim_pack` is available
|
|
38
41
|
* [oxipng](https://github.com/shssoichiro/oxipng) by Joshua Holmer ([license](acknowledgements/oxipng.txt))
|
39
42
|
* [pngcrush](https://pmt.sourceforge.io/pngcrush/) by Glenn Randers-Pehrson, portions by Greg Roelofs ([license](acknowledgements/pngcrush.txt))
|
40
43
|
* contains [cexcept](http://www.nicemice.net/cexcept/) interface by Adam M. Costello and Cosmin Truta ([license](acknowledgements/cexcept.txt))
|
44
|
+
* [pngout](http://advsys.net/ken/utils.htm) by Ken Silverman ([license](acknowledgements/pngout.txt))
|
45
|
+
* Linux and BSD ports by Jonathon Fowler (http://www.jonof.id.au/pngout)
|
46
|
+
* Mac OS X port by Ken Silverman, with assistance by Jonathon Fowler
|
41
47
|
* [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
48
|
* [zlib](https://zlib.net/) by Jean-Loup Gailly and Mark Adler ([license](acknowledgements/zlib.txt))
|
43
49
|
|
@@ -77,7 +83,7 @@ script/run darwin 64 # Build only platforms matching darwin or 64
|
|
77
83
|
make # Build all tools and copy them to vendor/OS-ARCH for current OS and ARCH, then test
|
78
84
|
make all # same
|
79
85
|
|
80
|
-
|
86
|
+
script/livecheck # Check versions
|
81
87
|
make update-versions # Update versions in Makefile
|
82
88
|
|
83
89
|
make download # Download archives
|
data/Vagrantfile
CHANGED
@@ -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
@@ -5,10 +5,13 @@ JPEGARCHIVE_SHA256 := 3da16a5abbddd925dee0379aa51d9fe0cba33da0b5703be27c13a2dda3
|
|
5
5
|
JPEGOPTIM_SHA256 := c52616f2fb8d481315871680f9943b0f58c553d1e0c49a6bd4691a3e66d7e6de
|
6
6
|
LIBJPEG_SHA256 := 4077d6a6a75aeb01884f708919d25934c93305e49f7e3f36db9129320e6f4f3d
|
7
7
|
LIBLCMS_SHA256 := 0c67a5cc144029cfa34647a52809ec399aae488db4258a6a66fba318474a070f
|
8
|
-
LIBMOZJPEG_SHA256 :=
|
8
|
+
LIBMOZJPEG_SHA256 := 66b1b8d6b55d263f35f27f55acaaa3234df2a401232de99b6d099e2bb0a9d196
|
9
9
|
LIBPNG_SHA256 := daeb2620d829575513e35fecc83f0d3791a620b9b93d800b763542ece9390fb4
|
10
10
|
LIBZ_SHA256 := c3e5e9fdd5004dcb542feda5ee4f0ff0744628baf8ed2dd5d66f8ca1197cb1a1
|
11
11
|
OPTIPNG_SHA256 := 4f32f233cef870b3f95d3ad6428bfe4224ef34908f1b42b0badf858216654452
|
12
|
-
OXIPNG_SHA256 :=
|
12
|
+
OXIPNG_SHA256 := 4e75dd57519ba3a00eaf1fab56a5ee57dd17cf22d704f6ad7d3c5f08f483e7bf
|
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
|
data/image_optim_pack.gemspec
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
|
3
3
|
Gem::Specification.new do |s|
|
4
4
|
s.name = 'image_optim_pack'
|
5
|
-
s.version = '0.
|
5
|
+
s.version = '0.9.1.20220907'
|
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
@@ -1,7 +1,6 @@
|
|
1
1
|
#!/usr/bin/env ruby
|
2
2
|
# frozen_string_literal: true
|
3
3
|
|
4
|
-
require 'yaml'
|
5
4
|
require 'uri'
|
6
5
|
require 'net/http'
|
7
6
|
require 'openssl'
|
@@ -10,6 +9,69 @@ require 'fspath'
|
|
10
9
|
|
11
10
|
# Fetch and compare latest tool/library versions
|
12
11
|
class Livecheck
|
12
|
+
CONFIG = {
|
13
|
+
advancecomp: {
|
14
|
+
url: 'https://github.com/amadvance/advancecomp/releases.atom',
|
15
|
+
regexp: %r{<id>tag:github.com,2008:Repository/\d+/\D+?(\d+(?:\.\d+)*)</id>},
|
16
|
+
},
|
17
|
+
gifsicle: {
|
18
|
+
url: 'https://www.lcdf.org/gifsicle/',
|
19
|
+
regexp: /gifsicle-(\d+(?:\.\d+)*)\.tar\.gz/,
|
20
|
+
},
|
21
|
+
jhead: {
|
22
|
+
url: 'https://www.sentex.ca/~mwandel/jhead/',
|
23
|
+
regexp: /jhead-(\d+(?:\.\d+)*)/,
|
24
|
+
},
|
25
|
+
jpegoptim: {
|
26
|
+
url: 'https://github.com/tjko/jpegoptim/tags.atom',
|
27
|
+
regexp: %r{<id>tag:github.com,2008:Repository/\d+/\D+?(\d+(?:\.\d+)*)</id>},
|
28
|
+
},
|
29
|
+
jpegarchive: {
|
30
|
+
url: 'https://github.com/danielgtaylor/jpeg-archive/releases.atom',
|
31
|
+
regexp: %r{<id>tag:github.com,2008:Repository/\d+/\D+?(\d+(?:\.\d+)*)</id>},
|
32
|
+
},
|
33
|
+
libjpeg: {
|
34
|
+
url: 'https://www.ijg.org/files/',
|
35
|
+
regexp: /jpegsrc.v(.*?).tar.gz/,
|
36
|
+
},
|
37
|
+
liblcms: {
|
38
|
+
url: 'https://sourceforge.net/projects/lcms/rss?path=/lcms',
|
39
|
+
regexp: %r{/lcms/(\d+(?:\.\d+)*)/},
|
40
|
+
},
|
41
|
+
libmozjpeg: {
|
42
|
+
url: 'https://github.com/mozilla/mozjpeg/releases.atom',
|
43
|
+
regexp: %r{<id>tag:github.com,2008:Repository/\d+/\D+?(\d+(?:\.\d+)*)</id>},
|
44
|
+
},
|
45
|
+
libpng: {
|
46
|
+
url: 'https://sourceforge.net/projects/libpng/rss?path=/libpng16',
|
47
|
+
regexp: %r{/libpng\d*/(\d+(?:\.\d+)*)/},
|
48
|
+
},
|
49
|
+
libz: {
|
50
|
+
url: 'https://sourceforge.net/projects/libpng/rss?path=/zlib',
|
51
|
+
regexp: %r{/zlib/(\d+(?:\.\d+)*)/},
|
52
|
+
},
|
53
|
+
optipng: {
|
54
|
+
url: 'https://sourceforge.net/projects/optipng/rss',
|
55
|
+
regexp: %r{/OptiPNG/optipng-(\d+(?:\.\d+)*)/},
|
56
|
+
},
|
57
|
+
oxipng: {
|
58
|
+
url: 'https://github.com/shssoichiro/oxipng/releases.atom',
|
59
|
+
regexp: %r{<id>tag:github.com,2008:Repository/\d+/v(\d+(?:\.\d+)*)</id>},
|
60
|
+
},
|
61
|
+
pngcrush: {
|
62
|
+
url: 'https://sourceforge.net/projects/pmt/rss?path=/pngcrush',
|
63
|
+
regexp: %r{/pngcrush/(\d+(?:\.\d+)*)/},
|
64
|
+
},
|
65
|
+
pngout: {
|
66
|
+
url: 'http://www.jonof.id.au/kenutils.html',
|
67
|
+
regexp: %r{/files/kenutils/pngout-(\d{8})-linux.tar.gz},
|
68
|
+
},
|
69
|
+
pngquant: {
|
70
|
+
url: 'https://pngquant.org/releases.html',
|
71
|
+
regexp: %r{<span itemprop='version'>(\d+(?:\.\d+)*)</span>},
|
72
|
+
},
|
73
|
+
}.freeze
|
74
|
+
|
13
75
|
# Commands
|
14
76
|
class Cli
|
15
77
|
VERSION_REGEXP = /^([A-Z]+)_VER *:= *(.*)$/.freeze
|
@@ -22,11 +84,15 @@ class Livecheck
|
|
22
84
|
def run
|
23
85
|
dump_changes
|
24
86
|
|
25
|
-
return unless @update
|
26
87
|
return unless livechecks.any?(&:changed?)
|
27
88
|
|
89
|
+
exit 1 unless @update
|
90
|
+
|
28
91
|
update_changelog
|
29
92
|
update_makefile
|
93
|
+
rescue StandardError => e
|
94
|
+
warn e
|
95
|
+
exit 2
|
30
96
|
end
|
31
97
|
|
32
98
|
private
|
@@ -119,8 +185,6 @@ class Livecheck
|
|
119
185
|
end
|
120
186
|
end
|
121
187
|
|
122
|
-
CONFIG = YAML.load(DATA).freeze
|
123
|
-
|
124
188
|
attr_reader :name, :current_version
|
125
189
|
|
126
190
|
def initialize(name, current_version)
|
@@ -144,7 +208,7 @@ class Livecheck
|
|
144
208
|
private
|
145
209
|
|
146
210
|
def config
|
147
|
-
CONFIG[name] || fail(ArgumentError, "Livecheck for #{name} not defined")
|
211
|
+
CONFIG[name.to_sym] || fail(ArgumentError, "Livecheck for #{name} not defined")
|
148
212
|
end
|
149
213
|
|
150
214
|
def get(url)
|
@@ -155,9 +219,9 @@ private
|
|
155
219
|
end
|
156
220
|
|
157
221
|
def fetch_versions
|
158
|
-
body = get(config[
|
222
|
+
body = get(config[:url])
|
159
223
|
|
160
|
-
version_regex =
|
224
|
+
version_regex = config[:regexp]
|
161
225
|
|
162
226
|
versions = body.scan(version_regex).map{ |match| Version.new(*match) }.sort
|
163
227
|
fail "No versions found for #{name} in body:\n#{body}" if versions.empty?
|
@@ -167,47 +231,3 @@ private
|
|
167
231
|
end
|
168
232
|
|
169
233
|
Livecheck::Cli.new(ARGV).run
|
170
|
-
|
171
|
-
__END__
|
172
|
-
advancecomp:
|
173
|
-
url: https://github.com/amadvance/advancecomp/releases.atom
|
174
|
-
regexp: <id>tag:github.com,2008:Repository/\d+/\D+?(\d+(?:\.\d+)*)</id>
|
175
|
-
gifsicle:
|
176
|
-
url: https://www.lcdf.org/gifsicle/
|
177
|
-
regexp: gifsicle-(\d+(?:\.\d+)*)\.tar\.gz
|
178
|
-
jhead:
|
179
|
-
url: https://www.sentex.ca/~mwandel/jhead/
|
180
|
-
regexp: jhead-(\d+(?:\.\d+)*)
|
181
|
-
jpegoptim:
|
182
|
-
url: https://github.com/tjko/jpegoptim/tags.atom
|
183
|
-
regexp: <id>tag:github.com,2008:Repository/\d+/\D+?(\d+(?:\.\d+)*)</id>
|
184
|
-
jpegarchive:
|
185
|
-
url: https://github.com/danielgtaylor/jpeg-archive/releases.atom
|
186
|
-
regexp: <id>tag:github.com,2008:Repository/\d+/\D+?(\d+(?:\.\d+)*)</id>
|
187
|
-
libjpeg:
|
188
|
-
url: https://www.ijg.org/files/
|
189
|
-
regexp: jpegsrc.v(.*?).tar.gz
|
190
|
-
liblcms:
|
191
|
-
url: https://sourceforge.net/projects/lcms/rss?path=/lcms
|
192
|
-
regexp: /lcms/(\d+(?:\.\d+)*)/
|
193
|
-
libmozjpeg:
|
194
|
-
url: https://github.com/mozilla/mozjpeg/releases.atom
|
195
|
-
regexp: <id>tag:github.com,2008:Repository/\d+/\D+?(\d+(?:\.\d+)*)</id>
|
196
|
-
libpng:
|
197
|
-
url: https://sourceforge.net/projects/libpng/rss?path=/libpng16
|
198
|
-
regexp: /libpng\d*/(\d+(?:\.\d+)*)/
|
199
|
-
libz:
|
200
|
-
url: https://sourceforge.net/projects/libpng/rss?path=/zlib
|
201
|
-
regexp: /zlib/(\d+(?:\.\d+)*)/
|
202
|
-
optipng:
|
203
|
-
url: https://sourceforge.net/projects/optipng/rss
|
204
|
-
regexp: /OptiPNG/optipng-(\d+(?:\.\d+)*)/
|
205
|
-
oxipng:
|
206
|
-
url: https://github.com/shssoichiro/oxipng/releases.atom
|
207
|
-
regexp: <id>tag:github.com,2008:Repository/\d+/v(\d+(?:\.\d+)*)</id>
|
208
|
-
pngcrush:
|
209
|
-
url: https://sourceforge.net/projects/pmt/rss?path=/pngcrush
|
210
|
-
regexp: /pngcrush/(\d+(?:\.\d+)*)/
|
211
|
-
pngquant:
|
212
|
-
url: https://pngquant.org/releases.html
|
213
|
-
regexp: <span itemprop='version'>(\d+(?:\.\d+)*)</span>
|
data/script/platform_downloads
CHANGED
@@ -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).
|
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
|
41
|
+
end
|
42
42
|
end
|
43
43
|
|
44
44
|
table = Terminal::Table.new
|
data/script/run
CHANGED
@@ -57,7 +57,9 @@ for vm in $(perl -pe "s/.*?'(.+?-.+?)'\s+=>\s+'.+?\/.+?'.*|.*/\$1/" Vagrantfile
|
|
57
57
|
passes-filter "$vm" || continue
|
58
58
|
header "$vm"
|
59
59
|
|
60
|
-
[[ -
|
60
|
+
if [[ -z "$NO_UP" ]]; then
|
61
|
+
vagrant status "$vm" | grep -q running || vagrant up "$vm"
|
62
|
+
fi
|
61
63
|
|
62
64
|
# create ssh config
|
63
65
|
ssh_config=".vagrant/ssh_config.$vm"
|
Binary file
|
data/vendor/darwin-x86_64/oxipng
CHANGED
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.
|
4
|
+
version: 0.9.1.20220907
|
5
5
|
platform: x86_64-darwin
|
6
6
|
authors:
|
7
7
|
- Ivan Kuchin
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2022-
|
11
|
+
date: 2022-09-06 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: image_optim
|
@@ -101,6 +101,7 @@ files:
|
|
101
101
|
- ".dockerignore"
|
102
102
|
- ".github/workflows/check.yml"
|
103
103
|
- ".github/workflows/docker-build.yml"
|
104
|
+
- ".github/workflows/livecheck.yml"
|
104
105
|
- ".github/workflows/rubocop.yml"
|
105
106
|
- ".gitignore"
|
106
107
|
- ".rubocop.yml"
|
@@ -131,6 +132,7 @@ files:
|
|
131
132
|
- acknowledgements/optipng.txt
|
132
133
|
- acknowledgements/oxipng.txt
|
133
134
|
- acknowledgements/pngcrush.txt
|
135
|
+
- acknowledgements/pngout.txt
|
134
136
|
- acknowledgements/pngquant.txt
|
135
137
|
- acknowledgements/smallfry.txt
|
136
138
|
- acknowledgements/zlib.txt
|
@@ -170,6 +172,7 @@ files:
|
|
170
172
|
- vendor/darwin-x86_64/optipng
|
171
173
|
- vendor/darwin-x86_64/oxipng
|
172
174
|
- vendor/darwin-x86_64/pngcrush
|
175
|
+
- vendor/darwin-x86_64/pngout
|
173
176
|
- vendor/darwin-x86_64/pngquant
|
174
177
|
homepage: https://github.com/toy/image_optim_pack
|
175
178
|
licenses:
|
@@ -177,7 +180,7 @@ licenses:
|
|
177
180
|
metadata:
|
178
181
|
bug_tracker_uri: https://github.com/toy/image_optim_pack/issues
|
179
182
|
changelog_uri: https://github.com/toy/image_optim_pack/blob/master/CHANGELOG.markdown
|
180
|
-
documentation_uri: https://www.rubydoc.info/gems/image_optim_pack/0.
|
183
|
+
documentation_uri: https://www.rubydoc.info/gems/image_optim_pack/0.9.1.20220907
|
181
184
|
source_code_uri: https://github.com/toy/image_optim_pack
|
182
185
|
post_install_message:
|
183
186
|
rdoc_options: []
|