poppler 2.2.4-x64-mingw32

Sign up to get free protection for your applications and to get access to all the features.
Files changed (185) hide show
  1. checksums.yaml +7 -0
  2. data/README +35 -0
  3. data/Rakefile +75 -0
  4. data/ext/poppler/depend +6 -0
  5. data/ext/poppler/extconf.rb +70 -0
  6. data/ext/poppler/poppler.def +2 -0
  7. data/ext/poppler/rbpoppler-action.c +372 -0
  8. data/ext/poppler/rbpoppler-annotation-callout-line.c +127 -0
  9. data/ext/poppler/rbpoppler-annotation-free-text.c +46 -0
  10. data/ext/poppler/rbpoppler-annotation-mapping.c +72 -0
  11. data/ext/poppler/rbpoppler-annotation-markup.c +98 -0
  12. data/ext/poppler/rbpoppler-annotation-text.c +53 -0
  13. data/ext/poppler/rbpoppler-annotation.c +74 -0
  14. data/ext/poppler/rbpoppler-attachment.c +124 -0
  15. data/ext/poppler/rbpoppler-button-field.c +56 -0
  16. data/ext/poppler/rbpoppler-choice-field.c +131 -0
  17. data/ext/poppler/rbpoppler-color.c +107 -0
  18. data/ext/poppler/rbpoppler-document.c +224 -0
  19. data/ext/poppler/rbpoppler-font-info.c +59 -0
  20. data/ext/poppler/rbpoppler-fonts-iter.c +127 -0
  21. data/ext/poppler/rbpoppler-form-field-mapping.c +44 -0
  22. data/ext/poppler/rbpoppler-form-field.c +98 -0
  23. data/ext/poppler/rbpoppler-image-mapping.c +48 -0
  24. data/ext/poppler/rbpoppler-index-iter.c +128 -0
  25. data/ext/poppler/rbpoppler-link-mapping.c +47 -0
  26. data/ext/poppler/rbpoppler-page-transition.c +59 -0
  27. data/ext/poppler/rbpoppler-page.c +322 -0
  28. data/ext/poppler/rbpoppler-private.h +77 -0
  29. data/ext/poppler/rbpoppler-ps-file.c +66 -0
  30. data/ext/poppler/rbpoppler-rectangle.c +92 -0
  31. data/ext/poppler/rbpoppler-text-field.c +91 -0
  32. data/ext/poppler/rbpoppler.c +111 -0
  33. data/ext/poppler/rbpoppler.h +61 -0
  34. data/ext/poppler/rbpopplerconversions.h +105 -0
  35. data/extconf.rb +49 -0
  36. data/lib/2.0/poppler.so +0 -0
  37. data/lib/2.1/poppler.so +0 -0
  38. data/lib/2.2/poppler.so +0 -0
  39. data/lib/poppler.rb +105 -0
  40. data/sample/number-pdf.rb +32 -0
  41. data/sample/pdf2.rb +132 -0
  42. data/sample/pdf2svg.rb +26 -0
  43. data/sample/pdf2text.rb +16 -0
  44. data/sample/pdfcrop.rb +32 -0
  45. data/sample/pdfdiv.rb +36 -0
  46. data/test/fixtures/image.pdf +0 -0
  47. data/test/fixtures/image.png +0 -0
  48. data/test/poppler-test-utils.rb +58 -0
  49. data/test/run-test.rb +32 -0
  50. data/test/test_annotation.rb +86 -0
  51. data/test/test_color.rb +26 -0
  52. data/test/test_constants.rb +30 -0
  53. data/test/test_document.rb +41 -0
  54. data/test/test_page.rb +42 -0
  55. data/vendor/local/bin/cjpeg.exe +0 -0
  56. data/vendor/local/bin/djpeg.exe +0 -0
  57. data/vendor/local/bin/jpegtran.exe +0 -0
  58. data/vendor/local/bin/libjpeg-9.dll +0 -0
  59. data/vendor/local/bin/libpoppler-48.dll +0 -0
  60. data/vendor/local/bin/libpoppler-cpp-0.dll +0 -0
  61. data/vendor/local/bin/libpoppler-glib-8.dll +0 -0
  62. data/vendor/local/bin/libsqlite3-0.dll +0 -0
  63. data/vendor/local/bin/pdfdetach.exe +0 -0
  64. data/vendor/local/bin/pdffonts.exe +0 -0
  65. data/vendor/local/bin/pdfimages.exe +0 -0
  66. data/vendor/local/bin/pdfinfo.exe +0 -0
  67. data/vendor/local/bin/pdfseparate.exe +0 -0
  68. data/vendor/local/bin/pdftocairo.exe +0 -0
  69. data/vendor/local/bin/pdftohtml.exe +0 -0
  70. data/vendor/local/bin/pdftoppm.exe +0 -0
  71. data/vendor/local/bin/pdftops.exe +0 -0
  72. data/vendor/local/bin/pdftotext.exe +0 -0
  73. data/vendor/local/bin/pdfunite.exe +0 -0
  74. data/vendor/local/bin/rdjpgcom.exe +0 -0
  75. data/vendor/local/bin/sqlite3.exe +0 -0
  76. data/vendor/local/bin/wrjpgcom.exe +0 -0
  77. data/vendor/local/include/jconfig.h +60 -0
  78. data/vendor/local/include/jerror.h +304 -0
  79. data/vendor/local/include/jmorecfg.h +446 -0
  80. data/vendor/local/include/jpeglib.h +1180 -0
  81. data/vendor/local/include/poppler/cpp/poppler-document.h +104 -0
  82. data/vendor/local/include/poppler/cpp/poppler-embedded-file.h +55 -0
  83. data/vendor/local/include/poppler/cpp/poppler-font.h +91 -0
  84. data/vendor/local/include/poppler/cpp/poppler-global.h +111 -0
  85. data/vendor/local/include/poppler/cpp/poppler-image.h +71 -0
  86. data/vendor/local/include/poppler/cpp/poppler-page-renderer.h +66 -0
  87. data/vendor/local/include/poppler/cpp/poppler-page-transition.h +82 -0
  88. data/vendor/local/include/poppler/cpp/poppler-page.h +76 -0
  89. data/vendor/local/include/poppler/cpp/poppler-rectangle.h +84 -0
  90. data/vendor/local/include/poppler/cpp/poppler-toc.h +74 -0
  91. data/vendor/local/include/poppler/cpp/poppler-version.h +39 -0
  92. data/vendor/local/include/poppler/glib/poppler-action.h +316 -0
  93. data/vendor/local/include/poppler/glib/poppler-annot.h +296 -0
  94. data/vendor/local/include/poppler/glib/poppler-attachment.h +87 -0
  95. data/vendor/local/include/poppler/glib/poppler-date.h +30 -0
  96. data/vendor/local/include/poppler/glib/poppler-document.h +299 -0
  97. data/vendor/local/include/poppler/glib/poppler-enums.h +116 -0
  98. data/vendor/local/include/poppler/glib/poppler-features.h +88 -0
  99. data/vendor/local/include/poppler/glib/poppler-form-field.h +111 -0
  100. data/vendor/local/include/poppler/glib/poppler-layer.h +43 -0
  101. data/vendor/local/include/poppler/glib/poppler-media.h +73 -0
  102. data/vendor/local/include/poppler/glib/poppler-movie.h +42 -0
  103. data/vendor/local/include/poppler/glib/poppler-page.h +377 -0
  104. data/vendor/local/include/poppler/glib/poppler-structure-element.h +357 -0
  105. data/vendor/local/include/poppler/glib/poppler.h +250 -0
  106. data/vendor/local/include/sqlite3.h +7494 -0
  107. data/vendor/local/include/sqlite3ext.h +487 -0
  108. data/vendor/local/lib/girepository-1.0/Poppler-0.18.typelib +0 -0
  109. data/vendor/local/lib/libjpeg.a +0 -0
  110. data/vendor/local/lib/libjpeg.dll.a +0 -0
  111. data/vendor/local/lib/libjpeg.la +41 -0
  112. data/vendor/local/lib/libpoppler-cpp.a +0 -0
  113. data/vendor/local/lib/libpoppler-cpp.dll.a +0 -0
  114. data/vendor/local/lib/libpoppler-cpp.la +41 -0
  115. data/vendor/local/lib/libpoppler-glib.a +0 -0
  116. data/vendor/local/lib/libpoppler-glib.dll.a +0 -0
  117. data/vendor/local/lib/libpoppler-glib.la +41 -0
  118. data/vendor/local/lib/libpoppler.a +0 -0
  119. data/vendor/local/lib/libpoppler.dll.a +0 -0
  120. data/vendor/local/lib/libpoppler.la +41 -0
  121. data/vendor/local/lib/libsqlite3.a +0 -0
  122. data/vendor/local/lib/libsqlite3.dll.a +0 -0
  123. data/vendor/local/lib/libsqlite3.la +41 -0
  124. data/vendor/local/lib/pkgconfig/poppler-cairo.pc +9 -0
  125. data/vendor/local/lib/pkgconfig/poppler-cpp.pc +13 -0
  126. data/vendor/local/lib/pkgconfig/poppler-glib.pc +13 -0
  127. data/vendor/local/lib/pkgconfig/poppler-splash.pc +9 -0
  128. data/vendor/local/lib/pkgconfig/poppler.pc +11 -0
  129. data/vendor/local/lib/pkgconfig/sqlite3.pc +13 -0
  130. data/vendor/local/share/gir-1.0/Poppler-0.18.gir +8281 -0
  131. data/vendor/local/share/gtk-doc/html/poppler/PopplerAnnot.html +3221 -0
  132. data/vendor/local/share/gtk-doc/html/poppler/PopplerAttachment.html +267 -0
  133. data/vendor/local/share/gtk-doc/html/poppler/PopplerDocument.html +3328 -0
  134. data/vendor/local/share/gtk-doc/html/poppler/PopplerFormField.html +1403 -0
  135. data/vendor/local/share/gtk-doc/html/poppler/PopplerLayer.html +307 -0
  136. data/vendor/local/share/gtk-doc/html/poppler/PopplerMedia.html +381 -0
  137. data/vendor/local/share/gtk-doc/html/poppler/PopplerMovie.html +197 -0
  138. data/vendor/local/share/gtk-doc/html/poppler/PopplerPage.html +3002 -0
  139. data/vendor/local/share/gtk-doc/html/poppler/PopplerStructureElement.html +3781 -0
  140. data/vendor/local/share/gtk-doc/html/poppler/annotation-glossary.html +63 -0
  141. data/vendor/local/share/gtk-doc/html/poppler/api-index-0-12.html +123 -0
  142. data/vendor/local/share/gtk-doc/html/poppler/api-index-0-14.html +102 -0
  143. data/vendor/local/share/gtk-doc/html/poppler/api-index-0-16.html +180 -0
  144. data/vendor/local/share/gtk-doc/html/poppler/api-index-0-18.html +72 -0
  145. data/vendor/local/share/gtk-doc/html/poppler/api-index-0-20.html +39 -0
  146. data/vendor/local/share/gtk-doc/html/poppler/api-index-0-22.html +64 -0
  147. data/vendor/local/share/gtk-doc/html/poppler/api-index-deprecated.html +39 -0
  148. data/vendor/local/share/gtk-doc/html/poppler/api-index-full.html +1830 -0
  149. data/vendor/local/share/gtk-doc/html/poppler/ch01.html +74 -0
  150. data/vendor/local/share/gtk-doc/html/poppler/home.png +0 -0
  151. data/vendor/local/share/gtk-doc/html/poppler/index.html +85 -0
  152. data/vendor/local/share/gtk-doc/html/poppler/index.sgml +557 -0
  153. data/vendor/local/share/gtk-doc/html/poppler/left-insensitive.png +0 -0
  154. data/vendor/local/share/gtk-doc/html/poppler/left.png +0 -0
  155. data/vendor/local/share/gtk-doc/html/poppler/poppler-PDF-Utility-functions.html +107 -0
  156. data/vendor/local/share/gtk-doc/html/poppler/poppler-PopplerAction.html +796 -0
  157. data/vendor/local/share/gtk-doc/html/poppler/poppler-PopplerColor.html +201 -0
  158. data/vendor/local/share/gtk-doc/html/poppler/poppler-Version-and-Features-Information.html +254 -0
  159. data/vendor/local/share/gtk-doc/html/poppler/poppler-poppler.html +169 -0
  160. data/vendor/local/share/gtk-doc/html/poppler/poppler.devhelp2 +470 -0
  161. data/vendor/local/share/gtk-doc/html/poppler/right-insensitive.png +0 -0
  162. data/vendor/local/share/gtk-doc/html/poppler/right.png +0 -0
  163. data/vendor/local/share/gtk-doc/html/poppler/style.css +476 -0
  164. data/vendor/local/share/gtk-doc/html/poppler/up-insensitive.png +0 -0
  165. data/vendor/local/share/gtk-doc/html/poppler/up.png +0 -0
  166. data/vendor/local/share/license/poppler/AUTHORS +5 -0
  167. data/vendor/local/share/license/poppler/COPYING +339 -0
  168. data/vendor/local/share/man/man1/cjpeg.1 +387 -0
  169. data/vendor/local/share/man/man1/djpeg.1 +252 -0
  170. data/vendor/local/share/man/man1/jpegtran.1 +293 -0
  171. data/vendor/local/share/man/man1/pdfdetach.1 +86 -0
  172. data/vendor/local/share/man/man1/pdffonts.1 +119 -0
  173. data/vendor/local/share/man/man1/pdfimages.1 +260 -0
  174. data/vendor/local/share/man/man1/pdfinfo.1 +152 -0
  175. data/vendor/local/share/man/man1/pdfseparate.1 +49 -0
  176. data/vendor/local/share/man/man1/pdftocairo.1 +295 -0
  177. data/vendor/local/share/man/man1/pdftohtml.1 +107 -0
  178. data/vendor/local/share/man/man1/pdftoppm.1 +170 -0
  179. data/vendor/local/share/man/man1/pdftops.1 +217 -0
  180. data/vendor/local/share/man/man1/pdftotext.1 +137 -0
  181. data/vendor/local/share/man/man1/pdfunite.1 +33 -0
  182. data/vendor/local/share/man/man1/rdjpgcom.1 +63 -0
  183. data/vendor/local/share/man/man1/sqlite3.1 +279 -0
  184. data/vendor/local/share/man/man1/wrjpgcom.1 +103 -0
  185. metadata +254 -0
@@ -0,0 +1,252 @@
1
+ .TH DJPEG 1 "23 November 2013"
2
+ .SH NAME
3
+ djpeg \- decompress a JPEG file to an image file
4
+ .SH SYNOPSIS
5
+ .B djpeg
6
+ [
7
+ .I options
8
+ ]
9
+ [
10
+ .I filename
11
+ ]
12
+ .LP
13
+ .SH DESCRIPTION
14
+ .LP
15
+ .B djpeg
16
+ decompresses the named JPEG file, or the standard input if no file is named,
17
+ and produces an image file on the standard output. PBMPLUS (PPM/PGM), BMP,
18
+ GIF, Targa, or RLE (Utah Raster Toolkit) output format can be selected.
19
+ (RLE is supported only if the URT library is available.)
20
+ .SH OPTIONS
21
+ All switch names may be abbreviated; for example,
22
+ .B \-grayscale
23
+ may be written
24
+ .B \-gray
25
+ or
26
+ .BR \-gr .
27
+ Most of the "basic" switches can be abbreviated to as little as one letter.
28
+ Upper and lower case are equivalent (thus
29
+ .B \-BMP
30
+ is the same as
31
+ .BR \-bmp ).
32
+ British spellings are also accepted (e.g.,
33
+ .BR \-greyscale ),
34
+ though for brevity these are not mentioned below.
35
+ .PP
36
+ The basic switches are:
37
+ .TP
38
+ .BI \-colors " N"
39
+ Reduce image to at most N colors. This reduces the number of colors used in
40
+ the output image, so that it can be displayed on a colormapped display or
41
+ stored in a colormapped file format. For example, if you have an 8-bit
42
+ display, you'd need to reduce to 256 or fewer colors.
43
+ .TP
44
+ .BI \-quantize " N"
45
+ Same as
46
+ .BR \-colors .
47
+ .B \-colors
48
+ is the recommended name,
49
+ .B \-quantize
50
+ is provided only for backwards compatibility.
51
+ .TP
52
+ .B \-fast
53
+ Select recommended processing options for fast, low quality output. (The
54
+ default options are chosen for highest quality output.) Currently, this is
55
+ equivalent to \fB\-dct fast \-nosmooth \-onepass \-dither ordered\fR.
56
+ .TP
57
+ .B \-grayscale
58
+ Force gray-scale output even if JPEG file is color. Useful for viewing on
59
+ monochrome displays; also,
60
+ .B djpeg
61
+ runs noticeably faster in this mode.
62
+ .TP
63
+ .BI \-scale " M/N"
64
+ Scale the output image by a factor M/N. Currently supported scale factors are
65
+ M/N with all M from 1 to 16, where N is the source DCT size, which is 8 for
66
+ baseline JPEG. If the /N part is omitted, then M specifies the DCT scaled
67
+ size to be applied on the given input. For baseline JPEG this is equivalent
68
+ to M/8 scaling, since the source DCT size for baseline JPEG is 8.
69
+ Scaling is handy if the image is larger than your screen; also,
70
+ .B djpeg
71
+ runs much faster when scaling down the output.
72
+ .TP
73
+ .B \-bmp
74
+ Select BMP output format (Windows flavor). 8-bit colormapped format is
75
+ emitted if
76
+ .B \-colors
77
+ or
78
+ .B \-grayscale
79
+ is specified, or if the JPEG file is gray-scale; otherwise, 24-bit full-color
80
+ format is emitted.
81
+ .TP
82
+ .B \-gif
83
+ Select GIF output format. Since GIF does not support more than 256 colors,
84
+ .B \-colors 256
85
+ is assumed (unless you specify a smaller number of colors).
86
+ .TP
87
+ .B \-os2
88
+ Select BMP output format (OS/2 1.x flavor). 8-bit colormapped format is
89
+ emitted if
90
+ .B \-colors
91
+ or
92
+ .B \-grayscale
93
+ is specified, or if the JPEG file is gray-scale; otherwise, 24-bit full-color
94
+ format is emitted.
95
+ .TP
96
+ .B \-pnm
97
+ Select PBMPLUS (PPM/PGM) output format (this is the default format).
98
+ PGM is emitted if the JPEG file is gray-scale or if
99
+ .B \-grayscale
100
+ is specified; otherwise PPM is emitted.
101
+ .TP
102
+ .B \-rle
103
+ Select RLE output format. (Requires URT library.)
104
+ .TP
105
+ .B \-targa
106
+ Select Targa output format. Gray-scale format is emitted if the JPEG file is
107
+ gray-scale or if
108
+ .B \-grayscale
109
+ is specified; otherwise, colormapped format is emitted if
110
+ .B \-colors
111
+ is specified; otherwise, 24-bit full-color format is emitted.
112
+ .PP
113
+ Switches for advanced users:
114
+ .TP
115
+ .B \-dct int
116
+ Use integer DCT method (default).
117
+ .TP
118
+ .B \-dct fast
119
+ Use fast integer DCT (less accurate).
120
+ .TP
121
+ .B \-dct float
122
+ Use floating-point DCT method.
123
+ The float method is very slightly more accurate than the int method, but is
124
+ much slower unless your machine has very fast floating-point hardware. Also
125
+ note that results of the floating-point method may vary slightly across
126
+ machines, while the integer methods should give the same results everywhere.
127
+ The fast integer method is much less accurate than the other two.
128
+ .TP
129
+ .B \-dither fs
130
+ Use Floyd-Steinberg dithering in color quantization.
131
+ .TP
132
+ .B \-dither ordered
133
+ Use ordered dithering in color quantization.
134
+ .TP
135
+ .B \-dither none
136
+ Do not use dithering in color quantization.
137
+ By default, Floyd-Steinberg dithering is applied when quantizing colors; this
138
+ is slow but usually produces the best results. Ordered dither is a compromise
139
+ between speed and quality; no dithering is fast but usually looks awful. Note
140
+ that these switches have no effect unless color quantization is being done.
141
+ Ordered dither is only available in
142
+ .B \-onepass
143
+ mode.
144
+ .TP
145
+ .BI \-map " file"
146
+ Quantize to the colors used in the specified image file. This is useful for
147
+ producing multiple files with identical color maps, or for forcing a
148
+ predefined set of colors to be used. The
149
+ .I file
150
+ must be a GIF or PPM file. This option overrides
151
+ .B \-colors
152
+ and
153
+ .BR \-onepass .
154
+ .TP
155
+ .B \-nosmooth
156
+ Don't use high-quality upsampling.
157
+ .TP
158
+ .B \-onepass
159
+ Use one-pass instead of two-pass color quantization. The one-pass method is
160
+ faster and needs less memory, but it produces a lower-quality image.
161
+ .B \-onepass
162
+ is ignored unless you also say
163
+ .B \-colors
164
+ .IR N .
165
+ Also, the one-pass method is always used for gray-scale output (the two-pass
166
+ method is no improvement then).
167
+ .TP
168
+ .BI \-maxmemory " N"
169
+ Set limit for amount of memory to use in processing large images. Value is
170
+ in thousands of bytes, or millions of bytes if "M" is attached to the
171
+ number. For example,
172
+ .B \-max 4m
173
+ selects 4000000 bytes. If more space is needed, temporary files will be used.
174
+ .TP
175
+ .BI \-outfile " name"
176
+ Send output image to the named file, not to standard output.
177
+ .TP
178
+ .B \-verbose
179
+ Enable debug printout. More
180
+ .BR \-v 's
181
+ give more output. Also, version information is printed at startup.
182
+ .TP
183
+ .B \-debug
184
+ Same as
185
+ .BR \-verbose .
186
+ .SH EXAMPLES
187
+ .LP
188
+ This example decompresses the JPEG file foo.jpg, quantizes it to
189
+ 256 colors, and saves the output in 8-bit BMP format in foo.bmp:
190
+ .IP
191
+ .B djpeg \-colors 256 \-bmp
192
+ .I foo.jpg
193
+ .B >
194
+ .I foo.bmp
195
+ .SH HINTS
196
+ To get a quick preview of an image, use the
197
+ .B \-grayscale
198
+ and/or
199
+ .B \-scale
200
+ switches.
201
+ .B \-grayscale \-scale 1/8
202
+ is the fastest case.
203
+ .PP
204
+ Several options are available that trade off image quality to gain speed.
205
+ .B \-fast
206
+ turns on the recommended settings.
207
+ .PP
208
+ .B \-dct fast
209
+ and/or
210
+ .B \-nosmooth
211
+ gain speed at a small sacrifice in quality.
212
+ When producing a color-quantized image,
213
+ .B \-onepass \-dither ordered
214
+ is fast but much lower quality than the default behavior.
215
+ .B \-dither none
216
+ may give acceptable results in two-pass mode, but is seldom tolerable in
217
+ one-pass mode.
218
+ .PP
219
+ If you are fortunate enough to have very fast floating point hardware,
220
+ \fB\-dct float\fR may be even faster than \fB\-dct fast\fR. But on most
221
+ machines \fB\-dct float\fR is slower than \fB\-dct int\fR; in this case it is
222
+ not worth using, because its theoretical accuracy advantage is too small to be
223
+ significant in practice.
224
+ .SH ENVIRONMENT
225
+ .TP
226
+ .B JPEGMEM
227
+ If this environment variable is set, its value is the default memory limit.
228
+ The value is specified as described for the
229
+ .B \-maxmemory
230
+ switch.
231
+ .B JPEGMEM
232
+ overrides the default value specified when the program was compiled, and
233
+ itself is overridden by an explicit
234
+ .BR \-maxmemory .
235
+ .SH SEE ALSO
236
+ .BR cjpeg (1),
237
+ .BR jpegtran (1),
238
+ .BR rdjpgcom (1),
239
+ .BR wrjpgcom (1)
240
+ .br
241
+ .BR ppm (5),
242
+ .BR pgm (5)
243
+ .br
244
+ Wallace, Gregory K. "The JPEG Still Picture Compression Standard",
245
+ Communications of the ACM, April 1991 (vol. 34, no. 4), pp. 30-44.
246
+ .SH AUTHOR
247
+ Independent JPEG Group
248
+ .SH BUGS
249
+ To avoid the Unisys LZW patent (now expired),
250
+ .B djpeg
251
+ produces uncompressed GIF files. These are larger than they should be, but
252
+ are readable by standard GIF decoders.
@@ -0,0 +1,293 @@
1
+ .TH JPEGTRAN 1 "13 September 2013"
2
+ .SH NAME
3
+ jpegtran \- lossless transformation of JPEG files
4
+ .SH SYNOPSIS
5
+ .B jpegtran
6
+ [
7
+ .I options
8
+ ]
9
+ [
10
+ .I filename
11
+ ]
12
+ .LP
13
+ .SH DESCRIPTION
14
+ .LP
15
+ .B jpegtran
16
+ performs various useful transformations of JPEG files.
17
+ It can translate the coded representation from one variant of JPEG to another,
18
+ for example from baseline JPEG to progressive JPEG or vice versa. It can also
19
+ perform some rearrangements of the image data, for example turning an image
20
+ from landscape to portrait format by rotation.
21
+ .PP
22
+ .B jpegtran
23
+ works by rearranging the compressed data (DCT coefficients), without
24
+ ever fully decoding the image. Therefore, its transformations are lossless:
25
+ there is no image degradation at all, which would not be true if you used
26
+ .B djpeg
27
+ followed by
28
+ .B cjpeg
29
+ to accomplish the same conversion. But by the same token,
30
+ .B jpegtran
31
+ cannot perform lossy operations such as changing the image quality.
32
+ .PP
33
+ .B jpegtran
34
+ reads the named JPEG/JFIF file, or the standard input if no file is
35
+ named, and produces a JPEG/JFIF file on the standard output.
36
+ .SH OPTIONS
37
+ All switch names may be abbreviated; for example,
38
+ .B \-optimize
39
+ may be written
40
+ .B \-opt
41
+ or
42
+ .BR \-o .
43
+ Upper and lower case are equivalent.
44
+ British spellings are also accepted (e.g.,
45
+ .BR \-optimise ),
46
+ though for brevity these are not mentioned below.
47
+ .PP
48
+ To specify the coded JPEG representation used in the output file,
49
+ .B jpegtran
50
+ accepts a subset of the switches recognized by
51
+ .BR cjpeg :
52
+ .TP
53
+ .B \-optimize
54
+ Perform optimization of entropy encoding parameters.
55
+ .TP
56
+ .B \-progressive
57
+ Create progressive JPEG file.
58
+ .TP
59
+ .BI \-restart " N"
60
+ Emit a JPEG restart marker every N MCU rows, or every N MCU blocks if "B" is
61
+ attached to the number.
62
+ .TP
63
+ .B \-arithmetic
64
+ Use arithmetic coding.
65
+ .TP
66
+ .BI \-scans " file"
67
+ Use the scan script given in the specified text file.
68
+ .PP
69
+ See
70
+ .BR cjpeg (1)
71
+ for more details about these switches.
72
+ If you specify none of these switches, you get a plain baseline-JPEG output
73
+ file. The quality setting and so forth are determined by the input file.
74
+ .PP
75
+ The image can be losslessly transformed by giving one of these switches:
76
+ .TP
77
+ .B \-flip horizontal
78
+ Mirror image horizontally (left-right).
79
+ .TP
80
+ .B \-flip vertical
81
+ Mirror image vertically (top-bottom).
82
+ .TP
83
+ .B \-rotate 90
84
+ Rotate image 90 degrees clockwise.
85
+ .TP
86
+ .B \-rotate 180
87
+ Rotate image 180 degrees.
88
+ .TP
89
+ .B \-rotate 270
90
+ Rotate image 270 degrees clockwise (or 90 ccw).
91
+ .TP
92
+ .B \-transpose
93
+ Transpose image (across UL-to-LR axis).
94
+ .TP
95
+ .B \-transverse
96
+ Transverse transpose (across UR-to-LL axis).
97
+ .IP
98
+ The transpose transformation has no restrictions regarding image dimensions.
99
+ The other transformations operate rather oddly if the image dimensions are not
100
+ a multiple of the iMCU size (usually 8 or 16 pixels), because they can only
101
+ transform complete blocks of DCT coefficient data in the desired way.
102
+ .IP
103
+ .BR jpegtran 's
104
+ default behavior when transforming an odd-size image is designed
105
+ to preserve exact reversibility and mathematical consistency of the
106
+ transformation set. As stated, transpose is able to flip the entire image
107
+ area. Horizontal mirroring leaves any partial iMCU column at the right edge
108
+ untouched, but is able to flip all rows of the image. Similarly, vertical
109
+ mirroring leaves any partial iMCU row at the bottom edge untouched, but is
110
+ able to flip all columns. The other transforms can be built up as sequences
111
+ of transpose and flip operations; for consistency, their actions on edge
112
+ pixels are defined to be the same as the end result of the corresponding
113
+ transpose-and-flip sequence.
114
+ .IP
115
+ For practical use, you may prefer to discard any untransformable edge pixels
116
+ rather than having a strange-looking strip along the right and/or bottom edges
117
+ of a transformed image. To do this, add the
118
+ .B \-trim
119
+ switch:
120
+ .TP
121
+ .B \-trim
122
+ Drop non-transformable edge blocks.
123
+ .IP
124
+ Obviously, a transformation with
125
+ .B \-trim
126
+ is not reversible, so strictly speaking
127
+ .B jpegtran
128
+ with this switch is not lossless. Also, the expected mathematical
129
+ equivalences between the transformations no longer hold. For example,
130
+ .B \-rot 270 -trim
131
+ trims only the bottom edge, but
132
+ .B \-rot 90 -trim
133
+ followed by
134
+ .B \-rot 180 -trim
135
+ trims both edges.
136
+ .IP
137
+ If you are only interested in perfect transformation, add the
138
+ .B \-perfect
139
+ switch:
140
+ .TP
141
+ .B \-perfect
142
+ Fails with an error if the transformation is not perfect.
143
+ .IP
144
+ For example you may want to do
145
+ .IP
146
+ .B (jpegtran \-rot 90 -perfect
147
+ .I foo.jpg
148
+ .B || djpeg
149
+ .I foo.jpg
150
+ .B | pnmflip \-r90 | cjpeg)
151
+ .IP
152
+ to do a perfect rotation if available or an approximated one if not.
153
+ .PP
154
+ We also offer a lossless-crop option, which discards data outside a given
155
+ image region but losslessly preserves what is inside. Like the rotate and
156
+ flip transforms, lossless crop is restricted by the current JPEG format: the
157
+ upper left corner of the selected region must fall on an iMCU boundary. If
158
+ this does not hold for the given crop parameters, we silently move the upper
159
+ left corner up and/or left to make it so, simultaneously increasing the
160
+ region dimensions to keep the lower right crop corner unchanged. (Thus, the
161
+ output image covers at least the requested region, but may cover more.)
162
+ The adjustment of the region dimensions may be optionally disabled.
163
+
164
+ The image can be losslessly cropped by giving the switch:
165
+ .TP
166
+ .B \-crop WxH+X+Y
167
+ Crop to a rectangular subarea of width W, height H starting at point X,Y.
168
+ .PP
169
+ A complementary lossless-wipe option is provided to discard (gray out) data
170
+ inside a given image region while losslessly preserving what is outside:
171
+ .TP
172
+ .B \-wipe WxH+X+Y
173
+ Wipe (gray out) a rectangular subarea of width W, height H starting at point
174
+ X,Y.
175
+ .PP
176
+ Other not-strictly-lossless transformation switches are:
177
+ .TP
178
+ .B \-grayscale
179
+ Force grayscale output.
180
+ .IP
181
+ This option discards the chrominance channels if the input image is YCbCr
182
+ (ie, a standard color JPEG), resulting in a grayscale JPEG file. The
183
+ luminance channel is preserved exactly, so this is a better method of reducing
184
+ to grayscale than decompression, conversion, and recompression. This switch
185
+ is particularly handy for fixing a monochrome picture that was mistakenly
186
+ encoded as a color JPEG. (In such a case, the space savings from getting rid
187
+ of the near-empty chroma channels won't be large; but the decoding time for
188
+ a grayscale JPEG is substantially less than that for a color JPEG.)
189
+ .TP
190
+ .BI \-scale " M/N"
191
+ Scale the output image by a factor M/N.
192
+ .IP
193
+ Currently supported scale factors are M/N with all M from 1 to 16, where N is
194
+ the source DCT size, which is 8 for baseline JPEG. If the /N part is omitted,
195
+ then M specifies the DCT scaled size to be applied on the given input. For
196
+ baseline JPEG this is equivalent to M/8 scaling, since the source DCT size
197
+ for baseline JPEG is 8.
198
+ .B Caution:
199
+ An implementation of the JPEG SmartScale extension is required for this
200
+ feature. SmartScale enabled JPEG is not yet widely implemented, so many
201
+ decoders will be unable to view a SmartScale extended JPEG file at all.
202
+ .PP
203
+ .B jpegtran
204
+ also recognizes these switches that control what to do with "extra" markers,
205
+ such as comment blocks:
206
+ .TP
207
+ .B \-copy none
208
+ Copy no extra markers from source file. This setting suppresses all
209
+ comments and other excess baggage present in the source file.
210
+ .TP
211
+ .B \-copy comments
212
+ Copy only comment markers. This setting copies comments from the source file,
213
+ but discards any other inessential (for image display) data.
214
+ .TP
215
+ .B \-copy all
216
+ Copy all extra markers. This setting preserves miscellaneous markers
217
+ found in the source file, such as JFIF thumbnails, Exif data, and Photoshop
218
+ settings. In some files these extra markers can be sizable.
219
+ .IP
220
+ The default behavior is
221
+ .BR "\-copy comments" .
222
+ (Note: in IJG releases v6 and v6a,
223
+ .B jpegtran
224
+ always did the equivalent of
225
+ .BR "\-copy none" .)
226
+ .PP
227
+ Additional switches recognized by jpegtran are:
228
+ .TP
229
+ .BI \-maxmemory " N"
230
+ Set limit for amount of memory to use in processing large images. Value is
231
+ in thousands of bytes, or millions of bytes if "M" is attached to the
232
+ number. For example,
233
+ .B \-max 4m
234
+ selects 4000000 bytes. If more space is needed, temporary files will be used.
235
+ .TP
236
+ .BI \-outfile " name"
237
+ Send output image to the named file, not to standard output.
238
+ .TP
239
+ .B \-verbose
240
+ Enable debug printout. More
241
+ .BR \-v 's
242
+ give more output. Also, version information is printed at startup.
243
+ .TP
244
+ .B \-debug
245
+ Same as
246
+ .BR \-verbose .
247
+ .SH EXAMPLES
248
+ .LP
249
+ This example converts a baseline JPEG file to progressive form:
250
+ .IP
251
+ .B jpegtran \-progressive
252
+ .I foo.jpg
253
+ .B >
254
+ .I fooprog.jpg
255
+ .PP
256
+ This example rotates an image 90 degrees clockwise, discarding any
257
+ unrotatable edge pixels:
258
+ .IP
259
+ .B jpegtran \-rot 90 -trim
260
+ .I foo.jpg
261
+ .B >
262
+ .I foo90.jpg
263
+ .SH ENVIRONMENT
264
+ .TP
265
+ .B JPEGMEM
266
+ If this environment variable is set, its value is the default memory limit.
267
+ The value is specified as described for the
268
+ .B \-maxmemory
269
+ switch.
270
+ .B JPEGMEM
271
+ overrides the default value specified when the program was compiled, and
272
+ itself is overridden by an explicit
273
+ .BR \-maxmemory .
274
+ .SH SEE ALSO
275
+ .BR cjpeg (1),
276
+ .BR djpeg (1),
277
+ .BR rdjpgcom (1),
278
+ .BR wrjpgcom (1)
279
+ .br
280
+ Wallace, Gregory K. "The JPEG Still Picture Compression Standard",
281
+ Communications of the ACM, April 1991 (vol. 34, no. 4), pp. 30-44.
282
+ .SH AUTHOR
283
+ Independent JPEG Group
284
+ .SH BUGS
285
+ The transform options can't transform odd-size images perfectly. Use
286
+ .B \-trim
287
+ or
288
+ .B \-perfect
289
+ if you don't like the results.
290
+ .PP
291
+ The entire image is read into memory and then written out again, even in
292
+ cases where this isn't really necessary. Expect swapping on large images,
293
+ especially when using the more complex transform options.