@ai-ecoverse/wasm-libjpeg-turbo 0.0.0 → 3.1.2-2

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.
package/LICENSE ADDED
@@ -0,0 +1,400 @@
1
+ ==> LICENSE.md <==
2
+
3
+ libjpeg-turbo Licenses
4
+ ======================
5
+
6
+ libjpeg-turbo is covered by two compatible BSD-style open source licenses:
7
+
8
+ - The IJG (Independent JPEG Group) License, which is listed in
9
+ [README.ijg](README.ijg)
10
+
11
+ This license applies to the libjpeg API library and associated programs,
12
+ including any code inherited from libjpeg and any modifications to that
13
+ code. Note that the libjpeg-turbo SIMD source code bears the
14
+ [zlib License](https://opensource.org/licenses/Zlib), but in the context of
15
+ the overall libjpeg API library, the terms of the zlib License are subsumed
16
+ by the terms of the IJG License.
17
+
18
+ - The Modified (3-clause) BSD License, which is listed below
19
+
20
+ This license applies to the TurboJPEG API library and associated programs, as
21
+ well as the build system. Note that the TurboJPEG API library wraps the
22
+ libjpeg API library, so in the context of the overall TurboJPEG API library,
23
+ both the terms of the IJG License and the terms of the Modified (3-clause)
24
+ BSD License apply.
25
+
26
+
27
+ Complying with the libjpeg-turbo Licenses
28
+ =========================================
29
+
30
+ This section provides a roll-up of the libjpeg-turbo licensing terms, to the
31
+ best of our understanding. This is not a license in and of itself. It is
32
+ intended solely for clarification.
33
+
34
+ 1. If you are distributing a modified version of the libjpeg-turbo source,
35
+ then:
36
+
37
+ 1. You cannot alter or remove any existing copyright or license notices
38
+ from the source.
39
+
40
+ **Origin**
41
+ - Clause 1 of the IJG License
42
+ - Clause 1 of the Modified BSD License
43
+ - Clauses 1 and 3 of the zlib License
44
+
45
+ 2. You must add your own copyright notice to the header of each source
46
+ file you modified, so others can tell that you modified that file. (If
47
+ there is not an existing copyright header in that file, then you can
48
+ simply add a notice stating that you modified the file.)
49
+
50
+ **Origin**
51
+ - Clause 1 of the IJG License
52
+ - Clause 2 of the zlib License
53
+
54
+ 3. You must include the IJG README file, and you must not alter any of the
55
+ copyright or license text in that file.
56
+
57
+ **Origin**
58
+ - Clause 1 of the IJG License
59
+
60
+ 2. If you are distributing only libjpeg-turbo binaries without the source, or
61
+ if you are distributing an application that statically links with
62
+ libjpeg-turbo, then:
63
+
64
+ 1. Your product documentation must include a message stating:
65
+
66
+ This software is based in part on the work of the Independent JPEG
67
+ Group.
68
+
69
+ **Origin**
70
+ - Clause 2 of the IJG license
71
+
72
+ 2. If your binary distribution includes or uses the TurboJPEG API, then
73
+ your product documentation must include the text of the Modified BSD
74
+ License (see below.)
75
+
76
+ **Origin**
77
+ - Clause 2 of the Modified BSD License
78
+
79
+ 3. You cannot use the name of the IJG or The libjpeg-turbo Project or the
80
+ contributors thereof in advertising, publicity, etc.
81
+
82
+ **Origin**
83
+ - IJG License
84
+ - Clause 3 of the Modified BSD License
85
+
86
+ 4. The IJG and The libjpeg-turbo Project do not warrant libjpeg-turbo to be
87
+ free of defects, nor do we accept any liability for undesirable
88
+ consequences resulting from your use of the software.
89
+
90
+ **Origin**
91
+ - IJG License
92
+ - Modified BSD License
93
+ - zlib License
94
+
95
+
96
+ The Modified (3-clause) BSD License
97
+ ===================================
98
+
99
+ Copyright (C)2009-2025 D. R. Commander. All Rights Reserved.<br>
100
+ Copyright (C)2015 Viktor Szathmáry. All Rights Reserved.
101
+
102
+ Redistribution and use in source and binary forms, with or without
103
+ modification, are permitted provided that the following conditions are met:
104
+
105
+ - Redistributions of source code must retain the above copyright notice,
106
+ this list of conditions and the following disclaimer.
107
+ - Redistributions in binary form must reproduce the above copyright notice,
108
+ this list of conditions and the following disclaimer in the documentation
109
+ and/or other materials provided with the distribution.
110
+ - Neither the name of the libjpeg-turbo Project nor the names of its
111
+ contributors may be used to endorse or promote products derived from this
112
+ software without specific prior written permission.
113
+
114
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS",
115
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
116
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
117
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR CONTRIBUTORS BE
118
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
119
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
120
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
121
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
122
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
123
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
124
+ POSSIBILITY OF SUCH DAMAGE.
125
+
126
+
127
+ Why Two Licenses?
128
+ =================
129
+
130
+ The zlib License could have been used instead of the Modified (3-clause) BSD
131
+ License, and since the IJG License effectively subsumes the distribution
132
+ conditions of the zlib License, this would have effectively placed
133
+ libjpeg-turbo binary distributions under the IJG License. However, the IJG
134
+ License specifically refers to the Independent JPEG Group and does not extend
135
+ attribution and endorsement protections to other entities. Thus, it was
136
+ desirable to choose a license that granted us the same protections for new code
137
+ that were granted to the IJG for code derived from their software.
138
+
139
+ ==> README.ijg <==
140
+
141
+ libjpeg-turbo note: This file has been modified by The libjpeg-turbo Project
142
+ to include only information relevant to libjpeg-turbo, to wordsmith certain
143
+ sections, and to remove impolitic language that existed in the libjpeg v8
144
+ README. It is included only for reference. Please see README.md for
145
+ information specific to libjpeg-turbo.
146
+
147
+
148
+ The Independent JPEG Group's JPEG software
149
+ ==========================================
150
+
151
+ This distribution contains a release of the Independent JPEG Group's free JPEG
152
+ software. You are welcome to redistribute this software and to use it for any
153
+ purpose, subject to the conditions under LEGAL ISSUES, below.
154
+
155
+ This software is the work of Tom Lane, Guido Vollbeding, Philip Gladstone,
156
+ Bill Allombert, Jim Boucher, Lee Crocker, Bob Friesenhahn, Ben Jackson,
157
+ Julian Minguillon, Luis Ortiz, George Phillips, Davide Rossi, Ge' Weijers,
158
+ and other members of the Independent JPEG Group.
159
+
160
+ IJG is not affiliated with the ISO/IEC JTC1/SC29/WG1 standards committee
161
+ (also known as JPEG, together with ITU-T SG16).
162
+
163
+
164
+ DOCUMENTATION ROADMAP
165
+ =====================
166
+
167
+ This file contains the following sections:
168
+
169
+ OVERVIEW General description of JPEG and the IJG software.
170
+ LEGAL ISSUES Copyright, lack of warranty, terms of distribution.
171
+ REFERENCES Where to learn more about JPEG.
172
+ ARCHIVE LOCATIONS Where to find newer versions of this software.
173
+ FILE FORMAT WARS Software *not* to get.
174
+ TO DO Plans for future IJG releases.
175
+
176
+ Other documentation files in the distribution are:
177
+
178
+ User documentation:
179
+ doc/usage.txt Usage instructions for cjpeg, djpeg, jpegtran,
180
+ rdjpgcom, and wrjpgcom.
181
+ doc/*.1 Unix-style man pages for programs (same info as
182
+ usage.txt).
183
+ doc/wizard.txt Advanced usage instructions for JPEG wizards only.
184
+ doc/change.log Version-to-version change highlights.
185
+ Programmer and internal documentation:
186
+ doc/libjpeg.txt How to use the JPEG library in your own programs.
187
+ src/example.c Sample code for calling the JPEG library.
188
+ doc/structure.txt Overview of the JPEG library's internal structure.
189
+ doc/coderules.txt Coding style rules --- please read if you contribute
190
+ code.
191
+
192
+ Please read at least usage.txt. Some information can also be found in the JPEG
193
+ FAQ (Frequently Asked Questions) article. See ARCHIVE LOCATIONS below to find
194
+ out where to obtain the FAQ article.
195
+
196
+ If you want to understand how the JPEG code works, we suggest reading one or
197
+ more of the REFERENCES, then looking at the documentation files (in roughly
198
+ the order listed) before diving into the code.
199
+
200
+
201
+ OVERVIEW
202
+ ========
203
+
204
+ This package contains C software to implement JPEG image encoding, decoding,
205
+ and transcoding. JPEG (pronounced "jay-peg") is a standardized compression
206
+ method for full-color and grayscale images. JPEG's strong suit is compressing
207
+ photographic images or other types of images that have smooth color and
208
+ brightness transitions between neighboring pixels. Images with sharp lines or
209
+ other abrupt features may not compress well with JPEG, and a higher JPEG
210
+ quality may have to be used to avoid visible compression artifacts with such
211
+ images.
212
+
213
+ JPEG is normally lossy, meaning that the output pixels are not necessarily
214
+ identical to the input pixels. However, on photographic content and other
215
+ "smooth" images, very good compression ratios can be obtained with no visible
216
+ compression artifacts, and extremely high compression ratios are possible if
217
+ you are willing to sacrifice image quality (by reducing the "quality" setting
218
+ in the compressor.)
219
+
220
+ This software implements JPEG baseline, extended-sequential, progressive, and
221
+ lossless compression processes. Provision is made for supporting all variants
222
+ of these processes, although some uncommon parameter settings aren't
223
+ implemented yet. We have made no provision for supporting the hierarchical
224
+ processes defined in the standard.
225
+
226
+ We provide a set of library routines for reading and writing JPEG image files,
227
+ plus two sample applications "cjpeg" and "djpeg", which use the library to
228
+ perform conversion between JPEG and some other popular image file formats.
229
+ The library is intended to be reused in other applications.
230
+
231
+ In order to support file conversion and viewing software, we have included
232
+ considerable functionality beyond the bare JPEG coding/decoding capability;
233
+ for example, the color quantization modules are not strictly part of JPEG
234
+ decoding, but they are essential for output to colormapped file formats. These
235
+ extra functions can be compiled out of the library if not required for a
236
+ particular application.
237
+
238
+ We have also included "jpegtran", a utility for lossless transcoding between
239
+ different JPEG processes, and "rdjpgcom" and "wrjpgcom", two simple
240
+ applications for inserting and extracting textual comments in JFIF files.
241
+
242
+ The emphasis in designing this software has been on achieving portability and
243
+ flexibility, while also making it fast enough to be useful. In particular,
244
+ the software is not intended to be read as a tutorial on JPEG. (See the
245
+ REFERENCES section for introductory material.) Rather, it is intended to
246
+ be reliable, portable, industrial-strength code. We do not claim to have
247
+ achieved that goal in every aspect of the software, but we strive for it.
248
+
249
+ We welcome the use of this software as a component of commercial products.
250
+ No royalty is required, but we do ask for an acknowledgement in product
251
+ documentation, as described under LEGAL ISSUES.
252
+
253
+
254
+ LEGAL ISSUES
255
+ ============
256
+
257
+ In plain English:
258
+
259
+ 1. We don't promise that this software works. (But if you find any bugs,
260
+ please let us know!)
261
+ 2. You can use this software for whatever you want. You don't have to pay us.
262
+ 3. You may not pretend that you wrote this software. If you use it in a
263
+ program, you must acknowledge somewhere in your documentation that
264
+ you've used the IJG code.
265
+
266
+ In legalese:
267
+
268
+ The authors make NO WARRANTY or representation, either express or implied,
269
+ with respect to this software, its quality, accuracy, merchantability, or
270
+ fitness for a particular purpose. This software is provided "AS IS", and you,
271
+ its user, assume the entire risk as to its quality and accuracy.
272
+
273
+ This software is copyright (C) 1991-2020, Thomas G. Lane, Guido Vollbeding.
274
+ All Rights Reserved except as specified below.
275
+
276
+ Permission is hereby granted to use, copy, modify, and distribute this
277
+ software (or portions thereof) for any purpose, without fee, subject to these
278
+ conditions:
279
+ (1) If any part of the source code for this software is distributed, then this
280
+ README file must be included, with this copyright and no-warranty notice
281
+ unaltered; and any additions, deletions, or changes to the original files
282
+ must be clearly indicated in accompanying documentation.
283
+ (2) If only executable code is distributed, then the accompanying
284
+ documentation must state that "this software is based in part on the work of
285
+ the Independent JPEG Group".
286
+ (3) Permission for use of this software is granted only if the user accepts
287
+ full responsibility for any undesirable consequences; the authors accept
288
+ NO LIABILITY for damages of any kind.
289
+
290
+ These conditions apply to any software derived from or based on the IJG code,
291
+ not just to the unmodified library. If you use our work, you ought to
292
+ acknowledge us.
293
+
294
+ Permission is NOT granted for the use of any IJG author's name or company name
295
+ in advertising or publicity relating to this software or products derived from
296
+ it. This software may be referred to only as "the Independent JPEG Group's
297
+ software".
298
+
299
+ We specifically permit and encourage the use of this software as the basis of
300
+ commercial products, provided that all warranty or liability claims are
301
+ assumed by the product vendor.
302
+
303
+
304
+ REFERENCES
305
+ ==========
306
+
307
+ We recommend reading one or more of these references before trying to
308
+ understand the innards of the JPEG software.
309
+
310
+ The best short technical introduction to the JPEG compression algorithm is
311
+ Wallace, Gregory K. "The JPEG Still Picture Compression Standard",
312
+ Communications of the ACM, April 1991 (vol. 34 no. 4), pp. 30-44.
313
+ (Adjacent articles in that issue discuss MPEG motion picture compression,
314
+ applications of JPEG, and related topics.) If you don't have the CACM issue
315
+ handy, a PDF file containing a revised version of Wallace's article is
316
+ available at http://www.ijg.org/files/Wallace.JPEG.pdf. The file (actually
317
+ a preprint for an article that appeared in IEEE Trans. Consumer Electronics)
318
+ omits the sample images that appeared in CACM, but it includes corrections
319
+ and some added material. Note: the Wallace article is copyright ACM and IEEE,
320
+ and it may not be used for commercial purposes.
321
+
322
+ A somewhat less technical, more leisurely introduction to JPEG can be found in
323
+ "The Data Compression Book" by Mark Nelson and Jean-loup Gailly, published by
324
+ M&T Books (New York), 2nd ed. 1996, ISBN 1-55851-434-1. This book provides
325
+ good explanations and example C code for a multitude of compression methods
326
+ including JPEG. It is an excellent source if you are comfortable reading C
327
+ code but don't know much about data compression in general. The book's JPEG
328
+ sample code is far from industrial-strength, but when you are ready to look
329
+ at a full implementation, you've got one here...
330
+
331
+ The best currently available description of JPEG is the textbook "JPEG Still
332
+ Image Data Compression Standard" by William B. Pennebaker and Joan L.
333
+ Mitchell, published by Van Nostrand Reinhold, 1993, ISBN 0-442-01272-1.
334
+ Price US$59.95, 638 pp. The book includes the complete text of the ISO JPEG
335
+ standards (DIS 10918-1 and draft DIS 10918-2).
336
+
337
+ The original JPEG standard is divided into two parts, Part 1 being the actual
338
+ specification, while Part 2 covers compliance testing methods. Part 1 is
339
+ titled "Digital Compression and Coding of Continuous-tone Still Images,
340
+ Part 1: Requirements and guidelines" and has document numbers ISO/IEC IS
341
+ 10918-1, ITU-T T.81. Part 2 is titled "Digital Compression and Coding of
342
+ Continuous-tone Still Images, Part 2: Compliance testing" and has document
343
+ numbers ISO/IEC IS 10918-2, ITU-T T.83.
344
+
345
+ The JPEG standard does not specify all details of an interchangeable file
346
+ format. For the omitted details, we follow the "JFIF" conventions, revision
347
+ 1.02. JFIF version 1 has been adopted as ISO/IEC 10918-5 (05/2013) and
348
+ Recommendation ITU-T T.871 (05/2011): Information technology - Digital
349
+ compression and coding of continuous-tone still images: JPEG File Interchange
350
+ Format (JFIF). It is available as a free download in PDF file format from
351
+ https://www.iso.org/standard/54989.html and http://www.itu.int/rec/T-REC-T.871.
352
+ A PDF file of the older JFIF 1.02 specification is available at
353
+ http://www.w3.org/Graphics/JPEG/jfif3.pdf.
354
+
355
+ The TIFF 6.0 file format specification can be obtained from
356
+ http://mirrors.ctan.org/graphics/tiff/TIFF6.ps.gz. The JPEG incorporation
357
+ scheme found in the TIFF 6.0 spec of 3-June-92 has a number of serious
358
+ problems. IJG does not recommend use of the TIFF 6.0 design (TIFF Compression
359
+ tag 6). Instead, we recommend the JPEG design proposed by TIFF Technical Note
360
+ #2 (Compression tag 7). Copies of this Note can be obtained from
361
+ http://www.ijg.org/files/. It is expected that the next revision
362
+ of the TIFF spec will replace the 6.0 JPEG design with the Note's design.
363
+ Although IJG's own code does not support TIFF/JPEG, the free libtiff library
364
+ uses our library to implement TIFF/JPEG per the Note.
365
+
366
+
367
+ ARCHIVE LOCATIONS
368
+ =================
369
+
370
+ The "official" archive site for this software is www.ijg.org.
371
+ The most recent released version can always be found there in
372
+ directory "files".
373
+
374
+ The JPEG FAQ (Frequently Asked Questions) article is a source of some
375
+ general information about JPEG. It is available at
376
+ http://www.faqs.org/faqs/jpeg-faq.
377
+
378
+
379
+ FILE FORMAT COMPATIBILITY
380
+ =========================
381
+
382
+ This software implements ITU T.81 | ISO/IEC 10918 with some extensions from
383
+ ITU T.871 | ISO/IEC 10918-5 (JPEG File Interchange Format-- see REFERENCES).
384
+ Informally, the term "JPEG image" or "JPEG file" most often refers to JFIF or
385
+ a subset thereof, but there are other formats containing the name "JPEG" that
386
+ are incompatible with the original JPEG standard or with JFIF (for instance,
387
+ JPEG 2000 and JPEG XR). This software therefore does not support these
388
+ formats. Indeed, one of the original reasons for developing this free software
389
+ was to help force convergence on a common, interoperable format standard for
390
+ JPEG files.
391
+
392
+ JFIF is a minimal or "low end" representation. TIFF/JPEG (TIFF revision 6.0 as
393
+ modified by TIFF Technical Note #2) can be used for "high end" applications
394
+ that need to record a lot of additional data about an image.
395
+
396
+
397
+ TO DO
398
+ =====
399
+
400
+ Please send bug reports, offers of help, etc. to jpeg-info@jpegclub.org.
package/README.md CHANGED
@@ -1,9 +1,20 @@
1
1
  # `@ai-ecoverse/wasm-libjpeg-turbo`
2
2
 
3
- **Name reservation stub** (v0.0.0). Real emscripten/WASM artifacts for
4
- **libjpeg-turbo 3.1.2** will ship from the [homescoop](https://github.com/ai-ecoverse/homescoop)
5
- ladder recipes.
3
+ libjpeg-turbo **3.1.2** built for WebAssembly / emscripten, packaged by
4
+ [homescoop](https://github.com/ai-ecoverse/homescoop).
6
5
 
7
- Upstream summary: libjpeg-turbo JPEG codec.
6
+ | | |
7
+ | --- | --- |
8
+ | Upstream | [libjpeg-turbo/libjpeg-turbo](https://github.com/libjpeg-turbo/libjpeg-turbo) `3.1.2` |
9
+ | Recipe | [`packages/libjpeg-turbo`](https://github.com/ai-ecoverse/homescoop/tree/main/packages/libjpeg-turbo) |
10
+ | Build | `build.sh` (ladder `emcmake`, `-DWITH_SIMD=0`) |
8
11
 
9
- Do not depend on this version for binaries yet.
12
+ ## Contents
13
+
14
+ - `lib/libjpeg.a`, `lib/libturbojpeg.a` (same archive; Magick.Native name)
15
+ - `include/jpeglib.h`, `jerror.h`, `jmorecfg.h`, `jconfig.h`
16
+ - `lib/pkgconfig/libjpeg.pc`
17
+
18
+ ## License
19
+
20
+ Homescoope packaging is Apache-2.0. Upstream remains under its own license.
@@ -0,0 +1,60 @@
1
+ /* Version ID for the JPEG library.
2
+ * Might be useful for tests like "#if JPEG_LIB_VERSION >= 60".
3
+ */
4
+ #define JPEG_LIB_VERSION 62
5
+
6
+ /* libjpeg-turbo version */
7
+ #define LIBJPEG_TURBO_VERSION 3.1.2
8
+
9
+ /* libjpeg-turbo version in integer form */
10
+ #define LIBJPEG_TURBO_VERSION_NUMBER 3001002
11
+
12
+ /* Support arithmetic encoding when using 8-bit samples */
13
+ #define C_ARITH_CODING_SUPPORTED 1
14
+
15
+ /* Support arithmetic decoding when using 8-bit samples */
16
+ #define D_ARITH_CODING_SUPPORTED 1
17
+
18
+ /* Support in-memory source/destination managers */
19
+ #define MEM_SRCDST_SUPPORTED 1
20
+
21
+ /* Use accelerated SIMD routines when using 8-bit samples */
22
+ /* #undef WITH_SIMD */
23
+
24
+ /* This version of libjpeg-turbo supports run-time selection of data precision,
25
+ * so BITS_IN_JSAMPLE is no longer used to specify the data precision at build
26
+ * time. However, some downstream software expects the macro to be defined.
27
+ * Since 12-bit data precision is an opt-in feature that requires explicitly
28
+ * calling 12-bit-specific libjpeg API functions and using 12-bit-specific data
29
+ * types, the unmodified portion of the libjpeg API still behaves as if it were
30
+ * built for 8-bit precision, and JSAMPLE is still literally an 8-bit data
31
+ * type. Thus, it is correct to define BITS_IN_JSAMPLE to 8 here.
32
+ */
33
+ #ifndef BITS_IN_JSAMPLE
34
+ #define BITS_IN_JSAMPLE 8
35
+ #endif
36
+
37
+ #ifdef _WIN32
38
+
39
+ #undef RIGHT_SHIFT_IS_UNSIGNED
40
+
41
+ /* Define "boolean" as unsigned char, not int, per Windows custom */
42
+ #ifndef __RPCNDR_H__ /* don't conflict if rpcndr.h already read */
43
+ typedef unsigned char boolean;
44
+ #endif
45
+ #define HAVE_BOOLEAN /* prevent jmorecfg.h from redefining it */
46
+
47
+ /* Define "INT32" as int, not long, per Windows custom */
48
+ #if !(defined(_BASETSD_H_) || defined(_BASETSD_H)) /* don't conflict if basetsd.h already read */
49
+ typedef short INT16;
50
+ typedef signed int INT32;
51
+ #endif
52
+ #define XMD_H /* prevent jmorecfg.h from redefining it */
53
+
54
+ #else
55
+
56
+ /* Define if your (broken) compiler shifts signed values as if they were
57
+ unsigned. */
58
+ /* #undef RIGHT_SHIFT_IS_UNSIGNED */
59
+
60
+ #endif