image_optim_pack 0.8.0.20220131 → 0.9.1

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: 42ee74f56e5f6ebc0a7a0f0c91dd84829868bde9b095ce3c8baa5ad8e956581e
4
- data.tar.gz: b801ad92d69aa39ae20e4499483cf80a0851d906c07e7009c67332c7f406e7ee
3
+ metadata.gz: 5336b548f94c7dbfc592eba04905c20498c57e11707031b98687ca9200521044
4
+ data.tar.gz: 914ccdc01d012e114754edb2d9fcd8bc28ebfa434400d2a318038a09fe5ffe13
5
5
  SHA512:
6
- metadata.gz: 72583137f4bf0b13731ab31cb6525617ae74d8f27a244eca15ec3ca28cb832e5bf14103d89a59e54708dfce32328243f7301f6d2eb5537d776542d6d5b1136bb
7
- data.tar.gz: 70463b1471db64757ae024b7120269c626ea73d64e56910841f8556b7c9fd6df525d7b50b2049634014adaefbfb3b2e225c5e3751452c451d489fb4a6880925d
6
+ metadata.gz: b67b322a157e968edab7d72d2623c043c323726d0c9e97a542239b401f727ea210208e951e9d92ec034cdc8832b02bea254c720075f3d97130e53ce563767368
7
+ data.tar.gz: 042a729d0b4c3b68b9976359e8d6ddf5620a7ef04e4fd01df84d0c1b5a7457339a1b1cc210d2c3ec9fe2c069da7272914336e4e681a2da2093d0fb6e01277cdf
@@ -0,0 +1,16 @@
1
+ name: docker-build
2
+ on:
3
+ push:
4
+ tags:
5
+ - '*'
6
+ jobs:
7
+ docker-build:
8
+ runs-on: ubuntu-latest
9
+ steps:
10
+ - uses: actions/checkout@v2
11
+ - uses: docker/login-action@f054a8b539a109f9f41c372932f1ae047eff08c9
12
+ with:
13
+ registry: ghcr.io
14
+ username: ${{ github.actor }}
15
+ password: ${{ secrets.GITHUB_TOKEN }}
16
+ - run: make docker-push
@@ -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
@@ -64,6 +64,8 @@ Style/HashEachMethods:
64
64
  Enabled: true
65
65
 
66
66
  Style/HashSyntax:
67
+ Exclude:
68
+ - script/livecheck
67
69
  EnforcedStyle: hash_rockets
68
70
 
69
71
  Style/HashTransformKeys:
data/CHANGELOG.markdown CHANGED
@@ -2,6 +2,18 @@
2
2
 
3
3
  ## unreleased
4
4
 
5
+ ## v0.9.1 (2022-08-29)
6
+
7
+ * libmozjpeg 4.1.1 [@toy](https://github.com/toy)
8
+
9
+ ## v0.9.0 (2022-06-11)
10
+
11
+ * 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)
12
+
13
+ ## v0.8.0.20220418 (2022-04-18)
14
+
15
+ * advancecomp 2.3 and jpegoptim 1.4.7 [@toy](https://github.com/toy)
16
+
5
17
  ## v0.8.0.20220131 (2022-01-31)
6
18
 
7
19
  * liblcms 2.13 [@toy](https://github.com/toy)
data/Dockerfile CHANGED
@@ -1,4 +1,4 @@
1
- FROM alpine:3.12 as base
1
+ FROM alpine as base
2
2
  ENV LD_LIBRARY_PATH=/usr/local/lib
3
3
  WORKDIR /tmp
4
4
 
@@ -85,7 +85,7 @@ ARG JPEGARCHIVE_SHA256
85
85
  COPY download/jpegarchive-$JPEGARCHIVE_VER.tar.gz download/
86
86
  RUN ./extract jpegarchive && \
87
87
  cd build/jpegarchive && \
88
- make install
88
+ CFLAGS=-fcommon make install
89
89
 
90
90
  FROM libjpeg as jpegoptim
91
91
  ARG JPEGOPTIM_VER
@@ -105,7 +105,7 @@ RUN ./extract optipng && \
105
105
  ./configure && \
106
106
  make install
107
107
 
108
- FROM rust:1.55-alpine3.13 as oxipng
108
+ FROM rust:1-alpine as oxipng
109
109
  RUN apk add --no-cache build-base
110
110
  COPY script/extract ./
111
111
  ARG OXIPNG_VER
@@ -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
@@ -2,19 +2,23 @@ all :
2
2
 
3
3
  # ====== VERSIONS ======
4
4
 
5
- ADVANCECOMP_VER := 2.1
5
+ ADVANCECOMP_VER := 2.3
6
6
  GIFSICLE_VER := 1.93
7
7
  JHEAD_VER := 3.04
8
8
  JPEGARCHIVE_VER := 2.2.0
9
- JPEGOPTIM_VER := 1.4.6
9
+ JPEGOPTIM_VER := 1.4.7
10
10
  LIBJPEG_VER := 9e
11
11
  LIBLCMS_VER := 2.13
12
- LIBMOZJPEG_VER := 4.0.3
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
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,11 +78,13 @@ 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)
87
+ test -w $(DL_DIR)
81
88
  while ! mkdir $$@.lock 2> /dev/null; do sleep 1; done
82
89
  wget -q -O $$@.tmp $(subst [VER],$($1_VER),$(strip $2))
83
90
  mv $$@.tmp $$@
@@ -88,7 +95,7 @@ $(eval $(call archive-dl,ADVANCECOMP, https://github.com/amadvance/advancecomp/r
88
95
  $(eval $(call archive-dl,GIFSICLE, https://www.lcdf.org/gifsicle/gifsicle-[VER].tar.gz))
89
96
  $(eval $(call archive-dl,JHEAD, https://www.sentex.ca/~mwandel/jhead/jhead-[VER].tar.gz))
90
97
  $(eval $(call archive-dl,JPEGARCHIVE, https://github.com/danielgtaylor/jpeg-archive/archive/v[VER].tar.gz))
91
- $(eval $(call archive-dl,JPEGOPTIM, https://www.kokkonen.net/tjko/src/jpegoptim-[VER].tar.gz))
98
+ $(eval $(call archive-dl,JPEGOPTIM, https://github.com/tjko/jpegoptim/archive/v[VER].tar.gz))
92
99
  $(eval $(call archive-dl,LIBJPEG, https://www.ijg.org/files/jpegsrc.v[VER].tar.gz))
93
100
  $(eval $(call archive-dl,LIBLCMS, https://prdownloads.sourceforge.net/lcms/lcms2-[VER].tar.gz?download))
94
101
  $(eval $(call archive-dl,LIBMOZJPEG, https://github.com/mozilla/mozjpeg/archive/v[VER].tar.gz))
@@ -97,25 +104,28 @@ $(eval $(call archive-dl,LIBZ, https://prdownloads.sourceforge.net/libpng
97
104
  $(eval $(call archive-dl,OPTIPNG, https://prdownloads.sourceforge.net/optipng/optipng-[VER].tar.gz?download))
98
105
  $(eval $(call archive-dl,OXIPNG, https://github.com/shssoichiro/oxipng/archive/refs/tags/v[VER].tar.gz))
99
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))
100
110
  $(eval $(call archive-dl,PNGQUANT, https://pngquant.org/pngquant-[VER]-src.tar.gz))
101
111
 
102
- download : $(foreach archive,$(ARCHIVES),$($(archive)_TGZ))
112
+ download : $(foreach archive,$(ARCHIVES),$($(archive)_ARC))
103
113
  .PHONY : download
104
114
 
105
115
  download-tidy-up :
106
- 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)/*.*))
107
117
  .PHONY : download-tidy-up
108
118
 
109
119
  checksum : download
110
- @$(sha256sum) $(foreach archive,$(ARCHIVES),$($(archive)_TGZ))
120
+ @$(sha256sum) $(foreach archive,$(ARCHIVES),$($(archive)_ARC))
111
121
  .PHONY : checksum
112
122
 
113
123
  checksum-verify : download
114
- @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
115
125
  .PHONY : checksum-verify
116
126
 
117
127
  checksum-update : download
118
- @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
119
129
  .PHONY : checksum-update
120
130
 
121
131
  # ====== PRODUCTS ======
@@ -129,7 +139,7 @@ define target-build
129
139
  $1_PATH := $(or $3,$(call downcase,$1))
130
140
  $1_BASENAME := $$(notdir $$($1_PATH))
131
141
  $1_DIR := $($(or $2,$1)_DIR)
132
- $1_TGZ := $($(or $2,$1)_TGZ)
142
+ $1_ARC := $($(or $2,$1)_ARC)
133
143
  $1_EXTRACTED := $($(or $2,$1)_EXTRACTED)
134
144
  $1_TARGET := $$($1_DIR)/$$($1_PATH)
135
145
  $$($1_TARGET) : DIR := $$($1_DIR)
@@ -139,6 +149,7 @@ endef
139
149
  # $1 - product name
140
150
  # $2 - archive name ($1 if empty)
141
151
  # $3 - basename ($1 if empty)
152
+ # $4 - don't strip the target
142
153
  define target
143
154
  $(call target-build,$1,$2,$3)
144
155
  PRODUCTS += $1
@@ -147,7 +158,7 @@ $1_DESTINATION := $$(OUTPUT_DIR)/$$($1_BASENAME)
147
158
  $$($1_DESTINATION) : $$($1_TARGET)
148
159
  mkdir -p $(OUTPUT_DIR)
149
160
  temppath=`mktemp "$(BUILD_DIR)"/tmp.XXXXXXXXXX` && \
150
- strip $$< -Sx -o "$$$$temppath" && \
161
+ $(if $4,cp $$< "$$$$temppath",strip $$< -Sx -o "$$$$temppath") && \
151
162
  chmod 755 "$$$$temppath" && \
152
163
  mv "$$$$temppath" $$@
153
164
  # short name target
@@ -168,6 +179,11 @@ $(eval $(call target,LIBZ,,libz$(DLEXT)))
168
179
  $(eval $(call target,OPTIPNG,,src/optipng/optipng))
169
180
  $(eval $(call target,OXIPNG,,target/release/oxipng))
170
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
171
187
  $(eval $(call target,PNGQUANT))
172
188
 
173
189
  # ====== TARGETS ======
@@ -190,21 +206,21 @@ ldd-version :; $(ldd) --version
190
206
 
191
207
  define check_exists
192
208
  @test -f $(OUTPUT_DIR)/$1 || \
193
- { printf "$1: $(ANSI_RED)not found$(ANSI_RESET)\n"; exit 1; }
209
+ { printf "%s: $(ANSI_RED)not found$(ANSI_RESET)\n" "$1"; exit 1; }
194
210
  endef
195
211
 
196
212
  define check_version
197
- @$(OUTPUT_DIR)/$1 $2 | fgrep -q $3 || \
198
- { printf "$1: $(ANSI_RED)Expected $3, got $$($(OUTPUT_DIR)/$1 $2)$(ANSI_RESET)\n"; exit 1; }
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; }
199
215
  endef
200
216
 
201
217
  define check_arch
202
218
  @file -b $(OUTPUT_DIR)/$1 | fgrep -q '$(ARCH_STRING)' || \
203
- { printf "$1: $(ANSI_RED)Expected $(ARCH_STRING), got $$(file -b $(OUTPUT_DIR)/$1)$(ANSI_RESET)\n"; exit 1; }
219
+ { printf "%s: $(ANSI_RED)Expected %s, got %s$(ANSI_RESET)\n" "$1" "$(ARCH_STRING)" "$$(file -b $(OUTPUT_DIR)/$1)"; exit 1; }
204
220
  endef
205
221
 
206
222
  define check_output
207
- @printf "$1: $(ANSI_GREEN)$3$(ANSI_RESET) / $(ANSI_MAGENTA)$(ARCH_STRING)$(ANSI_RESET)\n"
223
+ @printf "%s: $(ANSI_GREEN)%s$(ANSI_RESET) / $(ANSI_MAGENTA)%s$(ANSI_RESET)\n" "$1" "$3" "$(ARCH_STRING)"
208
224
  endef
209
225
 
210
226
  define check_shlib
@@ -248,12 +264,10 @@ test :
248
264
  $(call check_bin,optipng,--version,$(OPTIPNG_VER))
249
265
  $(call check_bin,oxipng,--version,$(OXIPNG_VER))
250
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")'))
251
268
  $(call check_bin,pngquant,--help,$(PNGQUANT_VER))
252
269
  .PHONY : test
253
270
 
254
- livecheck :; @script/livecheck
255
- .PHONY : livecheck
256
-
257
271
  update-versions :
258
272
  script/livecheck --update
259
273
  make checksum-update
@@ -266,15 +280,25 @@ DOCKER_TAG := $(shell date +%Y%m%d)
266
280
 
267
281
  docker-build : download
268
282
  @docker build \
283
+ --pull \
269
284
  $(foreach archive,$(ARCHIVES),--build-arg $(archive)_VER=$($(archive)_VER) --build-arg $(archive)_SHA256=$($(archive)_SHA256)) \
270
- -t $(DOCKER_IMAGE):$(DOCKER_TAG) \
271
285
  -t $(DOCKER_IMAGE):latest \
272
286
  .
287
+ @docker tag \
288
+ $(DOCKER_IMAGE):latest \
289
+ $(DOCKER_IMAGE):$(DOCKER_TAG)
273
290
  .PHONY : docker-build
274
291
 
275
- docker-push : docker-build
276
- @docker push $(DOCKER_IMAGE):$(DOCKER_TAG)
292
+ docker-test : docker-build
293
+ @docker run \
294
+ --rm \
295
+ $(DOCKER_IMAGE):latest \
296
+ --info
297
+ .PHONY : docker-test
298
+
299
+ docker-push : docker-test
277
300
  @docker push $(DOCKER_IMAGE):latest
301
+ @docker push $(DOCKER_IMAGE):$(DOCKER_TAG)
278
302
  .PHONY : docker-push
279
303
 
280
304
  # ====== CLEAN ======
@@ -480,6 +504,13 @@ $(PNGCRUSH_TARGET) :
480
504
  LDFLAGS="$(XORIGIN) $(LDFLAGS)"
481
505
  $(call chrpath_origin,$@)
482
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
+
483
514
  ## pngquant
484
515
  $(eval $(call depend,PNGQUANT,LIBLCMS LIBPNG LIBZ))
485
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 heroku: https://iopack.herokuapp.com/.
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
- make livecheck # Check versions
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
@@ -46,6 +46,10 @@ Vagrant.configure('2') do |config|
46
46
 
47
47
  apt-get update
48
48
  apt-get -y dist-upgrade
49
+
50
+ if [ $(lsb_release -r | egrep -o '[0-9]+' | head -1) -lt 18 ]; then
51
+ do-release-upgrade -f DistUpgradeViewNonInteractive
52
+ fi
49
53
  else
50
54
  set -ex
51
55
 
@@ -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
@@ -1,14 +1,17 @@
1
- ADVANCECOMP_SHA256 := 3ac0875e86a8517011976f04107186d5c60d434954078bc502ee731480933eb8
1
+ ADVANCECOMP_SHA256 := 811f661dfbbdddefdcb5eaf133e403ca2af99328b850b22c1249f7bebe657578
2
2
  GIFSICLE_SHA256 := 92f67079732bf4c1da087e6ae0905205846e5ac777ba5caa66d12a73aa943447
3
3
  JHEAD_SHA256 := ef89bbcf4f6c25ed88088cf242a47a6aedfff4f08cc7dc205bf3e2c0f10a03c9
4
4
  JPEGARCHIVE_SHA256 := 3da16a5abbddd925dee0379aa51d9fe0cba33da0b5703be27c13a2dda3d7ed75
5
- JPEGOPTIM_SHA256 := 88b1eb64c2a33a2f013f068df8b0331f42c019267401ae3fa28e3277403a5ab7
5
+ JPEGOPTIM_SHA256 := c52616f2fb8d481315871680f9943b0f58c553d1e0c49a6bd4691a3e66d7e6de
6
6
  LIBJPEG_SHA256 := 4077d6a6a75aeb01884f708919d25934c93305e49f7e3f36db9129320e6f4f3d
7
7
  LIBLCMS_SHA256 := 0c67a5cc144029cfa34647a52809ec399aae488db4258a6a66fba318474a070f
8
- LIBMOZJPEG_SHA256 := 4f22731db2afa14531a5bf2633d8af79ca5cb697a550f678bf43f24e5e409ef0
8
+ LIBMOZJPEG_SHA256 := 66b1b8d6b55d263f35f27f55acaaa3234df2a401232de99b6d099e2bb0a9d196
9
9
  LIBPNG_SHA256 := daeb2620d829575513e35fecc83f0d3791a620b9b93d800b763542ece9390fb4
10
10
  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.20220131'
5
+ s.version = '0.9.1'
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['url'])
222
+ body = get(config[:url])
159
223
 
160
- version_regex = Regexp.new(config['regexp'])
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>
@@ -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
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
- [[ -n "$NO_UP" ]] || vagrant up "$vm"
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
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
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.20220131
4
+ version: 0.9.1
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-01-31 00:00:00.000000000 Z
11
+ date: 2022-08-29 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: image_optim
@@ -100,6 +100,8 @@ extra_rdoc_files: []
100
100
  files:
101
101
  - ".dockerignore"
102
102
  - ".github/workflows/check.yml"
103
+ - ".github/workflows/docker-build.yml"
104
+ - ".github/workflows/livecheck.yml"
103
105
  - ".github/workflows/rubocop.yml"
104
106
  - ".gitignore"
105
107
  - ".rubocop.yml"
@@ -130,6 +132,7 @@ files:
130
132
  - acknowledgements/optipng.txt
131
133
  - acknowledgements/oxipng.txt
132
134
  - acknowledgements/pngcrush.txt
135
+ - acknowledgements/pngout.txt
133
136
  - acknowledgements/pngquant.txt
134
137
  - acknowledgements/smallfry.txt
135
138
  - acknowledgements/zlib.txt
@@ -169,6 +172,7 @@ files:
169
172
  - vendor/darwin-x86_64/optipng
170
173
  - vendor/darwin-x86_64/oxipng
171
174
  - vendor/darwin-x86_64/pngcrush
175
+ - vendor/darwin-x86_64/pngout
172
176
  - vendor/darwin-x86_64/pngquant
173
177
  - vendor/linux-i686/advpng
174
178
  - vendor/linux-i686/gifsicle
@@ -183,6 +187,7 @@ files:
183
187
  - vendor/linux-i686/optipng
184
188
  - vendor/linux-i686/oxipng
185
189
  - vendor/linux-i686/pngcrush
190
+ - vendor/linux-i686/pngout
186
191
  - vendor/linux-i686/pngquant
187
192
  - vendor/linux-x86_64/advpng
188
193
  - vendor/linux-x86_64/gifsicle
@@ -197,6 +202,7 @@ files:
197
202
  - vendor/linux-x86_64/optipng
198
203
  - vendor/linux-x86_64/oxipng
199
204
  - vendor/linux-x86_64/pngcrush
205
+ - vendor/linux-x86_64/pngout
200
206
  - vendor/linux-x86_64/pngquant
201
207
  homepage: https://github.com/toy/image_optim_pack
202
208
  licenses:
@@ -204,7 +210,7 @@ licenses:
204
210
  metadata:
205
211
  bug_tracker_uri: https://github.com/toy/image_optim_pack/issues
206
212
  changelog_uri: https://github.com/toy/image_optim_pack/blob/master/CHANGELOG.markdown
207
- documentation_uri: https://www.rubydoc.info/gems/image_optim_pack/0.8.0.20220131
213
+ documentation_uri: https://www.rubydoc.info/gems/image_optim_pack/0.9.1
208
214
  source_code_uri: https://github.com/toy/image_optim_pack
209
215
  post_install_message:
210
216
  rdoc_options: []
@@ -221,7 +227,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
221
227
  - !ruby/object:Gem::Version
222
228
  version: '0'
223
229
  requirements: []
224
- rubygems_version: 3.3.5
230
+ rubygems_version: 3.3.11
225
231
  signing_key:
226
232
  specification_version: 4
227
233
  summary: 'Precompiled binaries for image_optim: advpng, gifsicle, jhead, jpeg-recompress,