image_optim_pack 0.12.0-arm64-darwin

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.
Files changed (74) hide show
  1. checksums.yaml +7 -0
  2. data/.dockerignore +10 -0
  3. data/.github/dependabot.yml +6 -0
  4. data/.github/workflows/build.yml +47 -0
  5. data/.github/workflows/check.yml +33 -0
  6. data/.github/workflows/docker-build.yml +29 -0
  7. data/.github/workflows/livecheck.yml +35 -0
  8. data/.github/workflows/rubocop.yml +16 -0
  9. data/.gitignore +7 -0
  10. data/.rubocop.yml +97 -0
  11. data/CHANGELOG.markdown +546 -0
  12. data/Dockerfile +184 -0
  13. data/Dockerfile.debian +184 -0
  14. data/Gemfile +10 -0
  15. data/LICENSE.txt +27 -0
  16. data/Makefile +543 -0
  17. data/README.markdown +121 -0
  18. data/acknowledgements/7z.txt +56 -0
  19. data/acknowledgements/advancecomp.txt +674 -0
  20. data/acknowledgements/bmp2png.txt +8 -0
  21. data/acknowledgements/cexcept.txt +8 -0
  22. data/acknowledgements/gifread.txt +14 -0
  23. data/acknowledgements/gifsicle.txt +343 -0
  24. data/acknowledgements/iqa.txt +30 -0
  25. data/acknowledgements/jhead.txt +12 -0
  26. data/acknowledgements/jpeg-archive.txt +20 -0
  27. data/acknowledgements/jpegoptim.txt +339 -0
  28. data/acknowledgements/libjpeg-turbo.txt +27 -0
  29. data/acknowledgements/libjpeg-x86-simd.txt +17 -0
  30. data/acknowledgements/libjpeg.txt +64 -0
  31. data/acknowledgements/liblcms2.txt +21 -0
  32. data/acknowledgements/libpng.txt +90 -0
  33. data/acknowledgements/mozjpeg.txt +7 -0
  34. data/acknowledgements/optipng-authors.txt +26 -0
  35. data/acknowledgements/optipng.txt +21 -0
  36. data/acknowledgements/oxipng.txt +20 -0
  37. data/acknowledgements/pngcrush.txt +35 -0
  38. data/acknowledgements/pngout.txt +9 -0
  39. data/acknowledgements/pngquant.txt +56 -0
  40. data/acknowledgements/smallfry.txt +13 -0
  41. data/acknowledgements/zlib.txt +34 -0
  42. data/acknowledgements/zopfli-contributors.txt +6 -0
  43. data/acknowledgements/zopfli.txt +201 -0
  44. data/checksums.mk +17 -0
  45. data/image_optim_pack-darwin-arm64.gemspec +3 -0
  46. data/image_optim_pack-darwin-x86_64.gemspec +3 -0
  47. data/image_optim_pack-linux-x86_64.gemspec +3 -0
  48. data/image_optim_pack.gemspec +62 -0
  49. data/lib/image_optim/pack.rb +119 -0
  50. data/lib/image_optim_pack.rb +3 -0
  51. data/patches/pngcrush.patch +15 -0
  52. data/script/extract +19 -0
  53. data/script/livecheck +263 -0
  54. data/script/platform_downloads +59 -0
  55. data/script/run +131 -0
  56. data/spec/image_optim/pack_spec.rb +116 -0
  57. data/spec/image_optim_spec.rb +42 -0
  58. data/spec/spec_helper.rb +10 -0
  59. data/vendor/darwin-arm64/advpng +0 -0
  60. data/vendor/darwin-arm64/gifsicle +0 -0
  61. data/vendor/darwin-arm64/jhead +0 -0
  62. data/vendor/darwin-arm64/jpeg-recompress +0 -0
  63. data/vendor/darwin-arm64/jpegoptim +0 -0
  64. data/vendor/darwin-arm64/jpegtran +0 -0
  65. data/vendor/darwin-arm64/libjpeg.dylib +0 -0
  66. data/vendor/darwin-arm64/liblcms2.dylib +0 -0
  67. data/vendor/darwin-arm64/libpng.dylib +0 -0
  68. data/vendor/darwin-arm64/libz.dylib +0 -0
  69. data/vendor/darwin-arm64/optipng +0 -0
  70. data/vendor/darwin-arm64/oxipng +0 -0
  71. data/vendor/darwin-arm64/pngcrush +0 -0
  72. data/vendor/darwin-arm64/pngout +0 -0
  73. data/vendor/darwin-arm64/pngquant +0 -0
  74. metadata +199 -0
data/Dockerfile ADDED
@@ -0,0 +1,184 @@
1
+ FROM alpine as base
2
+ ENV LD_LIBRARY_PATH=/usr/local/lib
3
+ WORKDIR /tmp
4
+
5
+ FROM base as build
6
+ RUN apk add --no-cache build-base cmake nasm bash findutils
7
+ COPY script/extract ./
8
+ ENV CPATH=/usr/local/include
9
+
10
+ FROM rust:1-alpine as cargo
11
+ RUN apk add --no-cache build-base
12
+ COPY script/extract ./
13
+
14
+ FROM cargo as libz
15
+ ARG LIBZ_VER
16
+ ARG LIBZ_SHA256
17
+ COPY download/libz-$LIBZ_VER.tar.gz download/
18
+ RUN ./extract libz && \
19
+ cd build/libz && \
20
+ ./configure && \
21
+ make install
22
+
23
+ FROM libz as libpng
24
+ ARG LIBPNG_VER
25
+ ARG LIBPNG_SHA256
26
+ COPY download/libpng-$LIBPNG_VER.tar.gz download/
27
+ RUN ./extract libpng && \
28
+ cd build/libpng && \
29
+ ./configure --with-zlib-prefix=/usr/local && \
30
+ make install
31
+
32
+ FROM libpng as liblcms
33
+ ARG LIBLCMS_VER
34
+ ARG LIBLCMS_SHA256
35
+ COPY download/liblcms-$LIBLCMS_VER.tar.gz download/
36
+ RUN ./extract liblcms && \
37
+ cd build/liblcms && \
38
+ ./configure && \
39
+ make install
40
+
41
+ FROM build as libjpeg
42
+ ARG LIBJPEG_VER
43
+ ARG LIBJPEG_SHA256
44
+ COPY download/libjpeg-$LIBJPEG_VER.tar.gz download/
45
+ RUN ./extract libjpeg && \
46
+ cd build/libjpeg && \
47
+ ./configure && \
48
+ make install
49
+
50
+ FROM build as libmozjpeg
51
+ ARG LIBMOZJPEG_VER
52
+ ARG LIBMOZJPEG_SHA256
53
+ COPY download/libmozjpeg-$LIBMOZJPEG_VER.tar.gz download/
54
+ RUN ./extract libmozjpeg && \
55
+ cd build/libmozjpeg && \
56
+ cmake -DPNG_SUPPORTED=0 . && \
57
+ make install
58
+
59
+ FROM libpng as advancecomp
60
+ ARG ADVANCECOMP_VER
61
+ ARG ADVANCECOMP_SHA256
62
+ COPY download/advancecomp-$ADVANCECOMP_VER.tar.gz download/
63
+ RUN ./extract advancecomp && \
64
+ cd build/advancecomp && \
65
+ ./configure && \
66
+ make install
67
+
68
+ FROM build as gifsicle
69
+ ARG GIFSICLE_VER
70
+ ARG GIFSICLE_SHA256
71
+ COPY download/gifsicle-$GIFSICLE_VER.tar.gz download/
72
+ RUN ./extract gifsicle && \
73
+ cd build/gifsicle && \
74
+ ./configure && \
75
+ make install
76
+
77
+ FROM build as jhead
78
+ ARG JHEAD_VER
79
+ ARG JHEAD_SHA256
80
+ COPY download/jhead-$JHEAD_VER.tar.gz download/
81
+ RUN ./extract jhead && \
82
+ cd build/jhead && \
83
+ make && \
84
+ install -c jhead /usr/local/bin
85
+
86
+ FROM libmozjpeg as jpegarchive
87
+ ARG JPEGARCHIVE_VER
88
+ ARG JPEGARCHIVE_SHA256
89
+ COPY download/jpegarchive-$JPEGARCHIVE_VER.tar.gz download/
90
+ RUN ./extract jpegarchive && \
91
+ cd build/jpegarchive && \
92
+ CFLAGS=-fcommon make install
93
+
94
+ FROM libjpeg as jpegoptim
95
+ ARG JPEGOPTIM_VER
96
+ ARG JPEGOPTIM_SHA256
97
+ COPY download/jpegoptim-$JPEGOPTIM_VER.tar.gz download/
98
+ RUN ./extract jpegoptim && \
99
+ cd build/jpegoptim && \
100
+ ./configure && \
101
+ make install
102
+
103
+ FROM libpng as optipng
104
+ ARG OPTIPNG_VER
105
+ ARG OPTIPNG_SHA256
106
+ COPY download/optipng-$OPTIPNG_VER.tar.gz download/
107
+ RUN ./extract optipng && \
108
+ cd build/optipng && \
109
+ ./configure && \
110
+ make install
111
+
112
+ FROM cargo as oxipng
113
+ ARG OXIPNG_VER
114
+ ARG OXIPNG_SHA256
115
+ COPY download/oxipng-$OXIPNG_VER.tar.gz download/
116
+ RUN ./extract oxipng && \
117
+ cd build/oxipng && \
118
+ cargo build --release && \
119
+ install -c target/release/oxipng /usr/local/bin
120
+
121
+ FROM libpng as pngcrush
122
+ ARG PNGCRUSH_VER
123
+ ARG PNGCRUSH_SHA256
124
+ COPY download/pngcrush-$PNGCRUSH_VER.tar.gz download/
125
+ COPY patches/pngcrush.patch patches/
126
+ RUN ./extract pngcrush && \
127
+ cd build/pngcrush && \
128
+ patch < ../../patches/pngcrush.patch && \
129
+ make && \
130
+ install -c pngcrush /usr/local/bin
131
+
132
+ FROM build as pngout
133
+ ARG PNGOUT_LINUX_STATIC_VER
134
+ ARG PNGOUT_LINUX_STATIC_SHA256
135
+ COPY download/pngout_linux_static-$PNGOUT_LINUX_STATIC_VER.tar.gz download/
136
+ RUN ./extract pngout_linux_static && \
137
+ cd build/pngout_linux_static && \
138
+ cp amd64/pngout-static /usr/local/bin/pngout
139
+
140
+ FROM liblcms as pngquant
141
+ ARG PNGQUANT_VER
142
+ ARG PNGQUANT_SHA256
143
+ COPY download/pngquant-$PNGQUANT_VER.tar.gz download/
144
+ RUN ./extract pngquant && \
145
+ cd build/pngquant && \
146
+ cargo build --release && \
147
+ install -c target/release/pngquant /usr/local/bin
148
+
149
+ # FROM build as [name]
150
+ # ARG [NAME]_VER
151
+ # ARG [NAME]_SHA256
152
+ # COPY download/[name]-$[NAME]_VER.tar.gz download/
153
+ # RUN ./extract [name] && \
154
+ # cd build/[name] && \
155
+ # ./configure && \
156
+ # make install
157
+
158
+ FROM base as image_optim
159
+ RUN apk add --no-cache libstdc++ ruby npm perl dumb-init
160
+
161
+ COPY README.markdown /
162
+ COPY acknowledgements /acknowledgements
163
+
164
+ COPY --from=advancecomp /usr/local/bin/advpng /usr/local/bin/
165
+ COPY --from=gifsicle /usr/local/bin/gifsicle /usr/local/bin/
166
+ COPY --from=jhead /usr/local/bin/jhead /usr/local/bin/
167
+ COPY --from=jpegarchive /usr/local/bin/jpeg-recompress /usr/local/bin/
168
+ COPY --from=jpegoptim /usr/local/bin/jpegoptim /usr/local/bin/
169
+ COPY --from=libjpeg /usr/local/bin/jpegtran /usr/local/bin/
170
+ COPY --from=optipng /usr/local/bin/optipng /usr/local/bin/
171
+ COPY --from=oxipng /usr/local/bin/oxipng /usr/local/bin/
172
+ COPY --from=pngcrush /usr/local/bin/pngcrush /usr/local/bin/
173
+ COPY --from=pngout /usr/local/bin/pngout /usr/local/bin/
174
+ COPY --from=pngquant /usr/local/bin/pngquant /usr/local/bin/
175
+
176
+ COPY --from=libjpeg /usr/local/lib/libjpeg.so.9 /usr/local/lib/
177
+ COPY --from=libpng /usr/local/lib/libpng16.so.16 /usr/local/lib/
178
+ COPY --from=libz /usr/local/lib/libz.so.1 /usr/local/lib/
179
+ COPY --from=liblcms /usr/local/lib/liblcms2.so.2 /usr/local/lib/
180
+
181
+ RUN npm -g install svgo
182
+ RUN gem install --no-document image_optim
183
+ ENTRYPOINT ["dumb-init", "image_optim"]
184
+ CMD ["--help"]
data/Dockerfile.debian ADDED
@@ -0,0 +1,184 @@
1
+ FROM debian as base
2
+ ENV LD_LIBRARY_PATH=/usr/local/lib
3
+ WORKDIR /tmp
4
+
5
+ FROM base as build
6
+ RUN apt-get update && apt-get install -y build-essential cmake nasm bash findutils
7
+ COPY script/extract ./
8
+ ENV CPATH=/usr/local/include
9
+
10
+ FROM rust:1 as cargo
11
+ RUN apt-get update && apt-get install -y build-essential
12
+ COPY script/extract ./
13
+
14
+ FROM cargo as libz
15
+ ARG LIBZ_VER
16
+ ARG LIBZ_SHA256
17
+ COPY download/libz-$LIBZ_VER.tar.gz download/
18
+ RUN ./extract libz && \
19
+ cd build/libz && \
20
+ ./configure && \
21
+ make install
22
+
23
+ FROM libz as libpng
24
+ ARG LIBPNG_VER
25
+ ARG LIBPNG_SHA256
26
+ COPY download/libpng-$LIBPNG_VER.tar.gz download/
27
+ RUN ./extract libpng && \
28
+ cd build/libpng && \
29
+ ./configure --with-zlib-prefix=/usr/local && \
30
+ make install
31
+
32
+ FROM libpng as liblcms
33
+ ARG LIBLCMS_VER
34
+ ARG LIBLCMS_SHA256
35
+ COPY download/liblcms-$LIBLCMS_VER.tar.gz download/
36
+ RUN ./extract liblcms && \
37
+ cd build/liblcms && \
38
+ ./configure && \
39
+ make install
40
+
41
+ FROM build as libjpeg
42
+ ARG LIBJPEG_VER
43
+ ARG LIBJPEG_SHA256
44
+ COPY download/libjpeg-$LIBJPEG_VER.tar.gz download/
45
+ RUN ./extract libjpeg && \
46
+ cd build/libjpeg && \
47
+ ./configure && \
48
+ make install
49
+
50
+ FROM build as libmozjpeg
51
+ ARG LIBMOZJPEG_VER
52
+ ARG LIBMOZJPEG_SHA256
53
+ COPY download/libmozjpeg-$LIBMOZJPEG_VER.tar.gz download/
54
+ RUN ./extract libmozjpeg && \
55
+ cd build/libmozjpeg && \
56
+ cmake -DPNG_SUPPORTED=0 . && \
57
+ make install
58
+
59
+ FROM libpng as advancecomp
60
+ ARG ADVANCECOMP_VER
61
+ ARG ADVANCECOMP_SHA256
62
+ COPY download/advancecomp-$ADVANCECOMP_VER.tar.gz download/
63
+ RUN ./extract advancecomp && \
64
+ cd build/advancecomp && \
65
+ ./configure && \
66
+ make install
67
+
68
+ FROM build as gifsicle
69
+ ARG GIFSICLE_VER
70
+ ARG GIFSICLE_SHA256
71
+ COPY download/gifsicle-$GIFSICLE_VER.tar.gz download/
72
+ RUN ./extract gifsicle && \
73
+ cd build/gifsicle && \
74
+ ./configure && \
75
+ make install
76
+
77
+ FROM build as jhead
78
+ ARG JHEAD_VER
79
+ ARG JHEAD_SHA256
80
+ COPY download/jhead-$JHEAD_VER.tar.gz download/
81
+ RUN ./extract jhead && \
82
+ cd build/jhead && \
83
+ make && \
84
+ install -c jhead /usr/local/bin
85
+
86
+ FROM libmozjpeg as jpegarchive
87
+ ARG JPEGARCHIVE_VER
88
+ ARG JPEGARCHIVE_SHA256
89
+ COPY download/jpegarchive-$JPEGARCHIVE_VER.tar.gz download/
90
+ RUN ./extract jpegarchive && \
91
+ cd build/jpegarchive && \
92
+ CFLAGS=-fcommon make install
93
+
94
+ FROM libjpeg as jpegoptim
95
+ ARG JPEGOPTIM_VER
96
+ ARG JPEGOPTIM_SHA256
97
+ COPY download/jpegoptim-$JPEGOPTIM_VER.tar.gz download/
98
+ RUN ./extract jpegoptim && \
99
+ cd build/jpegoptim && \
100
+ ./configure && \
101
+ make install
102
+
103
+ FROM libpng as optipng
104
+ ARG OPTIPNG_VER
105
+ ARG OPTIPNG_SHA256
106
+ COPY download/optipng-$OPTIPNG_VER.tar.gz download/
107
+ RUN ./extract optipng && \
108
+ cd build/optipng && \
109
+ ./configure && \
110
+ make install
111
+
112
+ FROM cargo as oxipng
113
+ ARG OXIPNG_VER
114
+ ARG OXIPNG_SHA256
115
+ COPY download/oxipng-$OXIPNG_VER.tar.gz download/
116
+ RUN ./extract oxipng && \
117
+ cd build/oxipng && \
118
+ cargo build --release && \
119
+ install -c target/release/oxipng /usr/local/bin
120
+
121
+ FROM libpng as pngcrush
122
+ ARG PNGCRUSH_VER
123
+ ARG PNGCRUSH_SHA256
124
+ COPY download/pngcrush-$PNGCRUSH_VER.tar.gz download/
125
+ COPY patches/pngcrush.patch patches/
126
+ RUN ./extract pngcrush && \
127
+ cd build/pngcrush && \
128
+ patch < ../../patches/pngcrush.patch && \
129
+ make && \
130
+ install -c pngcrush /usr/local/bin
131
+
132
+ FROM build as pngout
133
+ ARG PNGOUT_LINUX_STATIC_VER
134
+ ARG PNGOUT_LINUX_STATIC_SHA256
135
+ COPY download/pngout_linux_static-$PNGOUT_LINUX_STATIC_VER.tar.gz download/
136
+ RUN ./extract pngout_linux_static && \
137
+ cd build/pngout_linux_static && \
138
+ cp amd64/pngout-static /usr/local/bin/pngout
139
+
140
+ FROM liblcms as pngquant
141
+ ARG PNGQUANT_VER
142
+ ARG PNGQUANT_SHA256
143
+ COPY download/pngquant-$PNGQUANT_VER.tar.gz download/
144
+ RUN ./extract pngquant && \
145
+ cd build/pngquant && \
146
+ cargo build --release && \
147
+ install -c target/release/pngquant /usr/local/bin
148
+
149
+ # FROM build as [name]
150
+ # ARG [NAME]_VER
151
+ # ARG [NAME]_SHA256
152
+ # COPY download/[name]-$[NAME]_VER.tar.gz download/
153
+ # RUN ./extract [name] && \
154
+ # cd build/[name] && \
155
+ # ./configure && \
156
+ # make install
157
+
158
+ FROM base as image_optim
159
+ RUN apt-get update && apt-get install -y ruby npm perl-base dumb-init
160
+
161
+ COPY README.markdown /
162
+ COPY acknowledgements /acknowledgements
163
+
164
+ COPY --from=advancecomp /usr/local/bin/advpng /usr/local/bin/
165
+ COPY --from=gifsicle /usr/local/bin/gifsicle /usr/local/bin/
166
+ COPY --from=jhead /usr/local/bin/jhead /usr/local/bin/
167
+ COPY --from=jpegarchive /usr/local/bin/jpeg-recompress /usr/local/bin/
168
+ COPY --from=jpegoptim /usr/local/bin/jpegoptim /usr/local/bin/
169
+ COPY --from=libjpeg /usr/local/bin/jpegtran /usr/local/bin/
170
+ COPY --from=optipng /usr/local/bin/optipng /usr/local/bin/
171
+ COPY --from=oxipng /usr/local/bin/oxipng /usr/local/bin/
172
+ COPY --from=pngcrush /usr/local/bin/pngcrush /usr/local/bin/
173
+ COPY --from=pngout /usr/local/bin/pngout /usr/local/bin/
174
+ COPY --from=pngquant /usr/local/bin/pngquant /usr/local/bin/
175
+
176
+ COPY --from=libjpeg /usr/local/lib/libjpeg.so.9 /usr/local/lib/
177
+ COPY --from=libpng /usr/local/lib/libpng16.so.16 /usr/local/lib/
178
+ COPY --from=libz /usr/local/lib/libz.so.1 /usr/local/lib/
179
+ COPY --from=liblcms /usr/local/lib/liblcms2.so.2 /usr/local/lib/
180
+
181
+ RUN npm -g install svgo
182
+ RUN gem install --no-document image_optim
183
+ ENTRYPOINT ["dumb-init", "image_optim"]
184
+ CMD ["--help"]
data/Gemfile ADDED
@@ -0,0 +1,10 @@
1
+ # frozen_string_literal: true
2
+
3
+ source 'https://rubygems.org'
4
+
5
+ gemspec name: 'image_optim_pack'
6
+
7
+ if RUBY_VERSION >= '2.1.9'
8
+ gem 'gems', '~> 1.0'
9
+ gem 'terminal-table'
10
+ end
data/LICENSE.txt ADDED
@@ -0,0 +1,27 @@
1
+ Copyright (c) 2014-2025 Ivan Kuchin
2
+
3
+ Permission is hereby granted, free of charge, to any person obtaining
4
+ a copy of this software and associated documentation files (the
5
+ "Software"), to deal in the Software without restriction, including
6
+ without limitation the rights to use, copy, modify, merge, publish,
7
+ distribute, sublicense, and/or sell copies of the Software, and to
8
+ permit persons to whom the Software is furnished to do so, subject to
9
+ the following conditions:
10
+
11
+ The above copyright notice and this permission notice shall be
12
+ included in all copies or substantial portions of the Software.
13
+
14
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
15
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
16
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
17
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
18
+ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
19
+ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
20
+ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
21
+
22
+ ======================================================================
23
+
24
+ All binaries and libraries in vendor directory are written by
25
+ different authors. References can be found in README.markdown.
26
+ COPYRIGHTS, DISCLAIMERS, LICENSES and NOTES can be found in
27
+ acknowledgements directory.