image_pack 0.2.2 → 0.2.3
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.
- checksums.yaml +4 -4
- data/CHANGELOG.md +1 -0
- data/README.md +23 -4
- data/ext/image_pack/extconf.rb +35 -124
- data/ext/image_pack/image_pack.c +638 -595
- data/ext/image_pack/mozjpeg_sources.rb +178 -0
- data/ext/image_pack/vendor/mozjpeg/BUILDING.md +744 -0
- data/ext/image_pack/vendor/mozjpeg/CODE_OF_CONDUCT.md +15 -0
- data/ext/image_pack/vendor/mozjpeg/ChangeLog.md +1996 -0
- data/lib/image_pack/configuration.rb +54 -8
- data/lib/image_pack/version.rb +1 -1
- data/lib/image_pack.rb +65 -18
- metadata +13 -78
- data/ext/image_pack/vendor/mozjpeg/README.ijg +0 -258
- data/ext/image_pack/vendor/mozjpeg/cdjpeg.c +0 -156
- data/ext/image_pack/vendor/mozjpeg/cjpeg.c +0 -961
- data/ext/image_pack/vendor/mozjpeg/djpeg.c +0 -855
- data/ext/image_pack/vendor/mozjpeg/jaricom.c +0 -157
- data/ext/image_pack/vendor/mozjpeg/jcarith.c +0 -972
- data/ext/image_pack/vendor/mozjpeg/jcstest.c +0 -126
- data/ext/image_pack/vendor/mozjpeg/jdarith.c +0 -782
- data/ext/image_pack/vendor/mozjpeg/jdatadst-tj.c +0 -198
- data/ext/image_pack/vendor/mozjpeg/jdatasrc-tj.c +0 -194
- data/ext/image_pack/vendor/mozjpeg/jpegtran.c +0 -827
- data/ext/image_pack/vendor/mozjpeg/jpegyuv.c +0 -172
- data/ext/image_pack/vendor/mozjpeg/rdbmp.c +0 -690
- data/ext/image_pack/vendor/mozjpeg/rdcolmap.c +0 -253
- data/ext/image_pack/vendor/mozjpeg/rdgif.c +0 -720
- data/ext/image_pack/vendor/mozjpeg/rdjpeg.c +0 -160
- data/ext/image_pack/vendor/mozjpeg/rdjpgcom.c +0 -494
- data/ext/image_pack/vendor/mozjpeg/rdpng.c +0 -194
- data/ext/image_pack/vendor/mozjpeg/rdppm.c +0 -781
- data/ext/image_pack/vendor/mozjpeg/rdswitch.c +0 -642
- data/ext/image_pack/vendor/mozjpeg/rdtarga.c +0 -508
- data/ext/image_pack/vendor/mozjpeg/simd/arm/aarch32/jccolext-neon.c +0 -148
- data/ext/image_pack/vendor/mozjpeg/simd/arm/aarch32/jchuff-neon.c +0 -334
- data/ext/image_pack/vendor/mozjpeg/simd/arm/aarch32/jsimd.c +0 -976
- data/ext/image_pack/vendor/mozjpeg/simd/i386/jsimd.c +0 -1312
- data/ext/image_pack/vendor/mozjpeg/simd/mips/jsimd.c +0 -1143
- data/ext/image_pack/vendor/mozjpeg/simd/mips64/jccolext-mmi.c +0 -455
- data/ext/image_pack/vendor/mozjpeg/simd/mips64/jccolor-mmi.c +0 -148
- data/ext/image_pack/vendor/mozjpeg/simd/mips64/jcgray-mmi.c +0 -132
- data/ext/image_pack/vendor/mozjpeg/simd/mips64/jcgryext-mmi.c +0 -374
- data/ext/image_pack/vendor/mozjpeg/simd/mips64/jcsample-mmi.c +0 -98
- data/ext/image_pack/vendor/mozjpeg/simd/mips64/jdcolext-mmi.c +0 -415
- data/ext/image_pack/vendor/mozjpeg/simd/mips64/jdcolor-mmi.c +0 -139
- data/ext/image_pack/vendor/mozjpeg/simd/mips64/jdmerge-mmi.c +0 -149
- data/ext/image_pack/vendor/mozjpeg/simd/mips64/jdmrgext-mmi.c +0 -615
- data/ext/image_pack/vendor/mozjpeg/simd/mips64/jdsample-mmi.c +0 -304
- data/ext/image_pack/vendor/mozjpeg/simd/mips64/jfdctfst-mmi.c +0 -255
- data/ext/image_pack/vendor/mozjpeg/simd/mips64/jfdctint-mmi.c +0 -398
- data/ext/image_pack/vendor/mozjpeg/simd/mips64/jidctfst-mmi.c +0 -395
- data/ext/image_pack/vendor/mozjpeg/simd/mips64/jidctint-mmi.c +0 -571
- data/ext/image_pack/vendor/mozjpeg/simd/mips64/jquanti-mmi.c +0 -124
- data/ext/image_pack/vendor/mozjpeg/simd/mips64/jsimd.c +0 -866
- data/ext/image_pack/vendor/mozjpeg/simd/powerpc/jccolext-altivec.c +0 -269
- data/ext/image_pack/vendor/mozjpeg/simd/powerpc/jccolor-altivec.c +0 -116
- data/ext/image_pack/vendor/mozjpeg/simd/powerpc/jcgray-altivec.c +0 -111
- data/ext/image_pack/vendor/mozjpeg/simd/powerpc/jcgryext-altivec.c +0 -228
- data/ext/image_pack/vendor/mozjpeg/simd/powerpc/jcsample-altivec.c +0 -159
- data/ext/image_pack/vendor/mozjpeg/simd/powerpc/jdcolext-altivec.c +0 -276
- data/ext/image_pack/vendor/mozjpeg/simd/powerpc/jdcolor-altivec.c +0 -106
- data/ext/image_pack/vendor/mozjpeg/simd/powerpc/jdmerge-altivec.c +0 -130
- data/ext/image_pack/vendor/mozjpeg/simd/powerpc/jdmrgext-altivec.c +0 -329
- data/ext/image_pack/vendor/mozjpeg/simd/powerpc/jdsample-altivec.c +0 -400
- data/ext/image_pack/vendor/mozjpeg/simd/powerpc/jfdctfst-altivec.c +0 -154
- data/ext/image_pack/vendor/mozjpeg/simd/powerpc/jfdctint-altivec.c +0 -258
- data/ext/image_pack/vendor/mozjpeg/simd/powerpc/jidctfst-altivec.c +0 -255
- data/ext/image_pack/vendor/mozjpeg/simd/powerpc/jidctint-altivec.c +0 -357
- data/ext/image_pack/vendor/mozjpeg/simd/powerpc/jquanti-altivec.c +0 -250
- data/ext/image_pack/vendor/mozjpeg/simd/powerpc/jsimd.c +0 -884
- data/ext/image_pack/vendor/mozjpeg/strtest.c +0 -170
- data/ext/image_pack/vendor/mozjpeg/tjbench.c +0 -1044
- data/ext/image_pack/vendor/mozjpeg/tjexample.c +0 -406
- data/ext/image_pack/vendor/mozjpeg/tjunittest.c +0 -961
- data/ext/image_pack/vendor/mozjpeg/tjutil.c +0 -70
- data/ext/image_pack/vendor/mozjpeg/transupp.c +0 -2373
- data/ext/image_pack/vendor/mozjpeg/turbojpeg-jni.c +0 -1259
- data/ext/image_pack/vendor/mozjpeg/turbojpeg.c +0 -2320
- data/ext/image_pack/vendor/mozjpeg/wrbmp.c +0 -552
- data/ext/image_pack/vendor/mozjpeg/wrgif.c +0 -580
- data/ext/image_pack/vendor/mozjpeg/wrjpgcom.c +0 -577
- data/ext/image_pack/vendor/mozjpeg/wrppm.c +0 -366
- data/ext/image_pack/vendor/mozjpeg/wrtarga.c +0 -258
- data/ext/image_pack/vendor/mozjpeg/yuvjpeg.c +0 -268
|
@@ -1,126 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* Copyright (C)2011 D. R. Commander. All Rights Reserved.
|
|
3
|
-
*
|
|
4
|
-
* Redistribution and use in source and binary forms, with or without
|
|
5
|
-
* modification, are permitted provided that the following conditions are met:
|
|
6
|
-
*
|
|
7
|
-
* - Redistributions of source code must retain the above copyright notice,
|
|
8
|
-
* this list of conditions and the following disclaimer.
|
|
9
|
-
* - Redistributions in binary form must reproduce the above copyright notice,
|
|
10
|
-
* this list of conditions and the following disclaimer in the documentation
|
|
11
|
-
* and/or other materials provided with the distribution.
|
|
12
|
-
* - Neither the name of the libjpeg-turbo Project nor the names of its
|
|
13
|
-
* contributors may be used to endorse or promote products derived from this
|
|
14
|
-
* software without specific prior written permission.
|
|
15
|
-
*
|
|
16
|
-
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS",
|
|
17
|
-
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
|
18
|
-
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
|
19
|
-
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR CONTRIBUTORS BE
|
|
20
|
-
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
|
21
|
-
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
|
22
|
-
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
|
23
|
-
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
|
24
|
-
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
|
25
|
-
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
|
26
|
-
* POSSIBILITY OF SUCH DAMAGE.
|
|
27
|
-
*/
|
|
28
|
-
|
|
29
|
-
/* This program demonstrates how to check for the colorspace extension
|
|
30
|
-
capabilities of libjpeg-turbo at both compile time and run time. */
|
|
31
|
-
|
|
32
|
-
#include <stdio.h>
|
|
33
|
-
#include <jpeglib.h>
|
|
34
|
-
#include <jerror.h>
|
|
35
|
-
#include <setjmp.h>
|
|
36
|
-
|
|
37
|
-
#ifndef JCS_EXTENSIONS
|
|
38
|
-
#define JCS_EXT_RGB 6
|
|
39
|
-
#endif
|
|
40
|
-
#if !defined(JCS_EXTENSIONS) || !defined(JCS_ALPHA_EXTENSIONS)
|
|
41
|
-
#define JCS_EXT_RGBA 12
|
|
42
|
-
#endif
|
|
43
|
-
|
|
44
|
-
static char lasterror[JMSG_LENGTH_MAX] = "No error";
|
|
45
|
-
|
|
46
|
-
typedef struct _error_mgr {
|
|
47
|
-
struct jpeg_error_mgr pub;
|
|
48
|
-
jmp_buf jb;
|
|
49
|
-
} error_mgr;
|
|
50
|
-
|
|
51
|
-
static void my_error_exit(j_common_ptr cinfo)
|
|
52
|
-
{
|
|
53
|
-
error_mgr *myerr = (error_mgr *)cinfo->err;
|
|
54
|
-
(*cinfo->err->output_message) (cinfo);
|
|
55
|
-
longjmp(myerr->jb, 1);
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
static void my_output_message(j_common_ptr cinfo)
|
|
59
|
-
{
|
|
60
|
-
(*cinfo->err->format_message) (cinfo, lasterror);
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
int main(void)
|
|
64
|
-
{
|
|
65
|
-
int jcs_valid = -1, jcs_alpha_valid = -1;
|
|
66
|
-
struct jpeg_compress_struct cinfo;
|
|
67
|
-
error_mgr jerr;
|
|
68
|
-
|
|
69
|
-
printf("libjpeg-turbo colorspace extensions:\n");
|
|
70
|
-
#if JCS_EXTENSIONS
|
|
71
|
-
printf(" Present at compile time\n");
|
|
72
|
-
#else
|
|
73
|
-
printf(" Not present at compile time\n");
|
|
74
|
-
#endif
|
|
75
|
-
|
|
76
|
-
cinfo.err = jpeg_std_error(&jerr.pub);
|
|
77
|
-
jerr.pub.error_exit = my_error_exit;
|
|
78
|
-
jerr.pub.output_message = my_output_message;
|
|
79
|
-
|
|
80
|
-
if (setjmp(jerr.jb)) {
|
|
81
|
-
/* this will execute if libjpeg has an error */
|
|
82
|
-
jcs_valid = 0;
|
|
83
|
-
goto done;
|
|
84
|
-
}
|
|
85
|
-
|
|
86
|
-
jpeg_create_compress(&cinfo);
|
|
87
|
-
cinfo.input_components = 3;
|
|
88
|
-
jpeg_set_defaults(&cinfo);
|
|
89
|
-
cinfo.in_color_space = JCS_EXT_RGB;
|
|
90
|
-
jpeg_default_colorspace(&cinfo);
|
|
91
|
-
jcs_valid = 1;
|
|
92
|
-
|
|
93
|
-
done:
|
|
94
|
-
if (jcs_valid)
|
|
95
|
-
printf(" Working properly\n");
|
|
96
|
-
else
|
|
97
|
-
printf(" Not working properly. Error returned was:\n %s\n",
|
|
98
|
-
lasterror);
|
|
99
|
-
|
|
100
|
-
printf("libjpeg-turbo alpha colorspace extensions:\n");
|
|
101
|
-
#if JCS_ALPHA_EXTENSIONS
|
|
102
|
-
printf(" Present at compile time\n");
|
|
103
|
-
#else
|
|
104
|
-
printf(" Not present at compile time\n");
|
|
105
|
-
#endif
|
|
106
|
-
|
|
107
|
-
if (setjmp(jerr.jb)) {
|
|
108
|
-
/* this will execute if libjpeg has an error */
|
|
109
|
-
jcs_alpha_valid = 0;
|
|
110
|
-
goto done2;
|
|
111
|
-
}
|
|
112
|
-
|
|
113
|
-
cinfo.in_color_space = JCS_EXT_RGBA;
|
|
114
|
-
jpeg_default_colorspace(&cinfo);
|
|
115
|
-
jcs_alpha_valid = 1;
|
|
116
|
-
|
|
117
|
-
done2:
|
|
118
|
-
if (jcs_alpha_valid)
|
|
119
|
-
printf(" Working properly\n");
|
|
120
|
-
else
|
|
121
|
-
printf(" Not working properly. Error returned was:\n %s\n",
|
|
122
|
-
lasterror);
|
|
123
|
-
|
|
124
|
-
jpeg_destroy_compress(&cinfo);
|
|
125
|
-
return 0;
|
|
126
|
-
}
|