isbn 2.0.4 → 2.0.5

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 (288) hide show
  1. data/{README → README.md} +5 -11
  2. data/Rakefile +20 -14
  3. data/isbn.gemspec +23 -0
  4. data/lib/isbn.rb +2 -0
  5. data/test/isbn_spec.rb +1 -1
  6. metadata +29 -316
  7. data/VERSION +0 -1
  8. data/src/gocr-0.48/.cvsignore +0 -6
  9. data/src/gocr-0.48/AUTHORS +0 -7
  10. data/src/gocr-0.48/BUGS +0 -55
  11. data/src/gocr-0.48/CREDITS +0 -17
  12. data/src/gocr-0.48/HISTORY +0 -243
  13. data/src/gocr-0.48/INSTALL +0 -83
  14. data/src/gocr-0.48/Makefile +0 -193
  15. data/src/gocr-0.48/Makefile.in +0 -193
  16. data/src/gocr-0.48/README +0 -165
  17. data/src/gocr-0.48/READMEde.txt +0 -80
  18. data/src/gocr-0.48/REMARK.txt +0 -18
  19. data/src/gocr-0.48/REVIEW +0 -538
  20. data/src/gocr-0.48/TODO +0 -65
  21. data/src/gocr-0.48/bin/.cvsignore +0 -2
  22. data/src/gocr-0.48/bin/create_db +0 -38
  23. data/src/gocr-0.48/bin/gocr.tcl +0 -527
  24. data/src/gocr-0.48/bin/gocr_chk.sh +0 -44
  25. data/src/gocr-0.48/configure +0 -4689
  26. data/src/gocr-0.48/configure.in +0 -71
  27. data/src/gocr-0.48/doc/.#Makefile.1.6 +0 -39
  28. data/src/gocr-0.48/doc/.cvsignore +0 -2
  29. data/src/gocr-0.48/doc/Makefile +0 -39
  30. data/src/gocr-0.48/doc/Makefile.in +0 -39
  31. data/src/gocr-0.48/doc/example.dtd +0 -53
  32. data/src/gocr-0.48/doc/example.xml +0 -21
  33. data/src/gocr-0.48/doc/examples.txt +0 -67
  34. data/src/gocr-0.48/doc/gocr.html +0 -578
  35. data/src/gocr-0.48/doc/unicode.txt +0 -57
  36. data/src/gocr-0.48/examples/.#Makefile.1.22 +0 -166
  37. data/src/gocr-0.48/examples/4x6.png +0 -0
  38. data/src/gocr-0.48/examples/4x6.txt +0 -2
  39. data/src/gocr-0.48/examples/5x7.png +0 -0
  40. data/src/gocr-0.48/examples/5x7.png.txt +0 -2
  41. data/src/gocr-0.48/examples/5x8.png +0 -0
  42. data/src/gocr-0.48/examples/5x8.png.txt +0 -2
  43. data/src/gocr-0.48/examples/Makefile +0 -166
  44. data/src/gocr-0.48/examples/color.fig +0 -20
  45. data/src/gocr-0.48/examples/ex.fig +0 -16
  46. data/src/gocr-0.48/examples/font.tex +0 -22
  47. data/src/gocr-0.48/examples/font1.tex +0 -46
  48. data/src/gocr-0.48/examples/font2.fig +0 -27
  49. data/src/gocr-0.48/examples/font_nw.tex +0 -24
  50. data/src/gocr-0.48/examples/handwrt1.jpg +0 -0
  51. data/src/gocr-0.48/examples/handwrt1.txt +0 -10
  52. data/src/gocr-0.48/examples/inverse.fig +0 -20
  53. data/src/gocr-0.48/examples/matrix.jpg +0 -0
  54. data/src/gocr-0.48/examples/ocr-a-subset.png +0 -0
  55. data/src/gocr-0.48/examples/ocr-a-subset.png.txt +0 -4
  56. data/src/gocr-0.48/examples/ocr-a.png +0 -0
  57. data/src/gocr-0.48/examples/ocr-a.txt +0 -6
  58. data/src/gocr-0.48/examples/ocr-b.png +0 -0
  59. data/src/gocr-0.48/examples/ocr-b.png.txt +0 -4
  60. data/src/gocr-0.48/examples/polish.tex +0 -28
  61. data/src/gocr-0.48/examples/rotate45.fig +0 -14
  62. data/src/gocr-0.48/examples/score +0 -36
  63. data/src/gocr-0.48/examples/text.tex +0 -28
  64. data/src/gocr-0.48/gpl.html +0 -537
  65. data/src/gocr-0.48/include/.cvsignore +0 -2
  66. data/src/gocr-0.48/include/config.h +0 -36
  67. data/src/gocr-0.48/include/config.h.in +0 -36
  68. data/src/gocr-0.48/include/version.h +0 -2
  69. data/src/gocr-0.48/install-sh +0 -3
  70. data/src/gocr-0.48/make.bat +0 -57
  71. data/src/gocr-0.48/man/.cvsignore +0 -2
  72. data/src/gocr-0.48/man/Makefile +0 -29
  73. data/src/gocr-0.48/man/Makefile.in +0 -29
  74. data/src/gocr-0.48/man/man1/gocr.1 +0 -166
  75. data/src/gocr-0.48/src/.cvsignore +0 -4
  76. data/src/gocr-0.48/src/Makefile +0 -132
  77. data/src/gocr-0.48/src/Makefile.in +0 -132
  78. data/src/gocr-0.48/src/amiga.h +0 -31
  79. data/src/gocr-0.48/src/barcode.c +0 -846
  80. data/src/gocr-0.48/src/barcode.c.orig +0 -593
  81. data/src/gocr-0.48/src/barcode.h +0 -11
  82. data/src/gocr-0.48/src/box.c +0 -372
  83. data/src/gocr-0.48/src/database.c +0 -462
  84. data/src/gocr-0.48/src/detect.c +0 -943
  85. data/src/gocr-0.48/src/gocr.c +0 -373
  86. data/src/gocr-0.48/src/gocr.h +0 -288
  87. data/src/gocr-0.48/src/jconv.c +0 -168
  88. data/src/gocr-0.48/src/job.c +0 -84
  89. data/src/gocr-0.48/src/lines.c +0 -350
  90. data/src/gocr-0.48/src/list.c +0 -334
  91. data/src/gocr-0.48/src/list.h +0 -90
  92. data/src/gocr-0.48/src/ocr0.c +0 -6756
  93. data/src/gocr-0.48/src/ocr0.h +0 -63
  94. data/src/gocr-0.48/src/ocr0n.c +0 -1475
  95. data/src/gocr-0.48/src/ocr1.c +0 -85
  96. data/src/gocr-0.48/src/ocr1.h +0 -3
  97. data/src/gocr-0.48/src/otsu.c +0 -289
  98. data/src/gocr-0.48/src/otsu.h +0 -23
  99. data/src/gocr-0.48/src/output.c +0 -289
  100. data/src/gocr-0.48/src/output.h +0 -37
  101. data/src/gocr-0.48/src/pcx.c +0 -153
  102. data/src/gocr-0.48/src/pcx.h +0 -9
  103. data/src/gocr-0.48/src/pgm2asc.c +0 -2893
  104. data/src/gocr-0.48/src/pgm2asc.h +0 -105
  105. data/src/gocr-0.48/src/pixel.c +0 -537
  106. data/src/gocr-0.48/src/pnm.c +0 -533
  107. data/src/gocr-0.48/src/pnm.h +0 -35
  108. data/src/gocr-0.48/src/progress.c +0 -87
  109. data/src/gocr-0.48/src/progress.h +0 -42
  110. data/src/gocr-0.48/src/remove.c +0 -703
  111. data/src/gocr-0.48/src/tga.c +0 -87
  112. data/src/gocr-0.48/src/tga.h +0 -6
  113. data/src/gocr-0.48/src/unicode.c +0 -1314
  114. data/src/gocr-0.48/src/unicode.h +0 -1257
  115. data/src/jpeg-7/Makefile.am +0 -133
  116. data/src/jpeg-7/Makefile.in +0 -1089
  117. data/src/jpeg-7/README +0 -322
  118. data/src/jpeg-7/aclocal.m4 +0 -8990
  119. data/src/jpeg-7/ansi2knr.1 +0 -36
  120. data/src/jpeg-7/ansi2knr.c +0 -739
  121. data/src/jpeg-7/cderror.h +0 -132
  122. data/src/jpeg-7/cdjpeg.c +0 -181
  123. data/src/jpeg-7/cdjpeg.h +0 -187
  124. data/src/jpeg-7/change.log +0 -270
  125. data/src/jpeg-7/cjpeg.1 +0 -325
  126. data/src/jpeg-7/cjpeg.c +0 -616
  127. data/src/jpeg-7/ckconfig.c +0 -402
  128. data/src/jpeg-7/coderules.txt +0 -118
  129. data/src/jpeg-7/config.guess +0 -1561
  130. data/src/jpeg-7/config.sub +0 -1686
  131. data/src/jpeg-7/configure +0 -17139
  132. data/src/jpeg-7/configure.ac +0 -317
  133. data/src/jpeg-7/depcomp +0 -630
  134. data/src/jpeg-7/djpeg.1 +0 -251
  135. data/src/jpeg-7/djpeg.c +0 -617
  136. data/src/jpeg-7/example.c +0 -433
  137. data/src/jpeg-7/filelist.txt +0 -215
  138. data/src/jpeg-7/install-sh +0 -520
  139. data/src/jpeg-7/install.txt +0 -1097
  140. data/src/jpeg-7/jaricom.c +0 -148
  141. data/src/jpeg-7/jcapimin.c +0 -282
  142. data/src/jpeg-7/jcapistd.c +0 -161
  143. data/src/jpeg-7/jcarith.c +0 -921
  144. data/src/jpeg-7/jccoefct.c +0 -453
  145. data/src/jpeg-7/jccolor.c +0 -459
  146. data/src/jpeg-7/jcdctmgr.c +0 -482
  147. data/src/jpeg-7/jchuff.c +0 -1612
  148. data/src/jpeg-7/jcinit.c +0 -65
  149. data/src/jpeg-7/jcmainct.c +0 -293
  150. data/src/jpeg-7/jcmarker.c +0 -667
  151. data/src/jpeg-7/jcmaster.c +0 -770
  152. data/src/jpeg-7/jcomapi.c +0 -106
  153. data/src/jpeg-7/jconfig.bcc +0 -48
  154. data/src/jpeg-7/jconfig.cfg +0 -45
  155. data/src/jpeg-7/jconfig.dj +0 -38
  156. data/src/jpeg-7/jconfig.mac +0 -43
  157. data/src/jpeg-7/jconfig.manx +0 -43
  158. data/src/jpeg-7/jconfig.mc6 +0 -52
  159. data/src/jpeg-7/jconfig.sas +0 -43
  160. data/src/jpeg-7/jconfig.st +0 -42
  161. data/src/jpeg-7/jconfig.txt +0 -155
  162. data/src/jpeg-7/jconfig.vc +0 -45
  163. data/src/jpeg-7/jconfig.vms +0 -37
  164. data/src/jpeg-7/jconfig.wat +0 -38
  165. data/src/jpeg-7/jcparam.c +0 -632
  166. data/src/jpeg-7/jcprepct.c +0 -358
  167. data/src/jpeg-7/jcsample.c +0 -545
  168. data/src/jpeg-7/jctrans.c +0 -381
  169. data/src/jpeg-7/jdapimin.c +0 -396
  170. data/src/jpeg-7/jdapistd.c +0 -275
  171. data/src/jpeg-7/jdarith.c +0 -762
  172. data/src/jpeg-7/jdatadst.c +0 -151
  173. data/src/jpeg-7/jdatasrc.c +0 -212
  174. data/src/jpeg-7/jdcoefct.c +0 -736
  175. data/src/jpeg-7/jdcolor.c +0 -396
  176. data/src/jpeg-7/jdct.h +0 -393
  177. data/src/jpeg-7/jddctmgr.c +0 -382
  178. data/src/jpeg-7/jdhuff.c +0 -1309
  179. data/src/jpeg-7/jdinput.c +0 -384
  180. data/src/jpeg-7/jdmainct.c +0 -512
  181. data/src/jpeg-7/jdmarker.c +0 -1360
  182. data/src/jpeg-7/jdmaster.c +0 -663
  183. data/src/jpeg-7/jdmerge.c +0 -400
  184. data/src/jpeg-7/jdpostct.c +0 -290
  185. data/src/jpeg-7/jdsample.c +0 -361
  186. data/src/jpeg-7/jdtrans.c +0 -136
  187. data/src/jpeg-7/jerror.c +0 -252
  188. data/src/jpeg-7/jerror.h +0 -304
  189. data/src/jpeg-7/jfdctflt.c +0 -174
  190. data/src/jpeg-7/jfdctfst.c +0 -230
  191. data/src/jpeg-7/jfdctint.c +0 -4348
  192. data/src/jpeg-7/jidctflt.c +0 -242
  193. data/src/jpeg-7/jidctfst.c +0 -368
  194. data/src/jpeg-7/jidctint.c +0 -5137
  195. data/src/jpeg-7/jinclude.h +0 -91
  196. data/src/jpeg-7/jmemansi.c +0 -167
  197. data/src/jpeg-7/jmemdos.c +0 -638
  198. data/src/jpeg-7/jmemdosa.asm +0 -379
  199. data/src/jpeg-7/jmemmac.c +0 -289
  200. data/src/jpeg-7/jmemmgr.c +0 -1118
  201. data/src/jpeg-7/jmemname.c +0 -276
  202. data/src/jpeg-7/jmemnobs.c +0 -109
  203. data/src/jpeg-7/jmemsys.h +0 -198
  204. data/src/jpeg-7/jmorecfg.h +0 -369
  205. data/src/jpeg-7/jpegint.h +0 -395
  206. data/src/jpeg-7/jpeglib.h +0 -1135
  207. data/src/jpeg-7/jpegtran.1 +0 -272
  208. data/src/jpeg-7/jpegtran.c +0 -546
  209. data/src/jpeg-7/jquant1.c +0 -856
  210. data/src/jpeg-7/jquant2.c +0 -1310
  211. data/src/jpeg-7/jutils.c +0 -179
  212. data/src/jpeg-7/jversion.h +0 -14
  213. data/src/jpeg-7/libjpeg.map +0 -4
  214. data/src/jpeg-7/libjpeg.txt +0 -3067
  215. data/src/jpeg-7/ltmain.sh +0 -8406
  216. data/src/jpeg-7/makcjpeg.st +0 -36
  217. data/src/jpeg-7/makdjpeg.st +0 -36
  218. data/src/jpeg-7/makeadsw.vc6 +0 -77
  219. data/src/jpeg-7/makeasln.vc9 +0 -33
  220. data/src/jpeg-7/makecdep.vc6 +0 -82
  221. data/src/jpeg-7/makecdsp.vc6 +0 -130
  222. data/src/jpeg-7/makecmak.vc6 +0 -159
  223. data/src/jpeg-7/makecvcp.vc9 +0 -186
  224. data/src/jpeg-7/makeddep.vc6 +0 -82
  225. data/src/jpeg-7/makeddsp.vc6 +0 -130
  226. data/src/jpeg-7/makedmak.vc6 +0 -159
  227. data/src/jpeg-7/makedvcp.vc9 +0 -186
  228. data/src/jpeg-7/makefile.ansi +0 -220
  229. data/src/jpeg-7/makefile.bcc +0 -291
  230. data/src/jpeg-7/makefile.dj +0 -226
  231. data/src/jpeg-7/makefile.manx +0 -220
  232. data/src/jpeg-7/makefile.mc6 +0 -255
  233. data/src/jpeg-7/makefile.mms +0 -224
  234. data/src/jpeg-7/makefile.sas +0 -258
  235. data/src/jpeg-7/makefile.unix +0 -234
  236. data/src/jpeg-7/makefile.vc +0 -217
  237. data/src/jpeg-7/makefile.vms +0 -142
  238. data/src/jpeg-7/makefile.wat +0 -239
  239. data/src/jpeg-7/makejdep.vc6 +0 -423
  240. data/src/jpeg-7/makejdsp.vc6 +0 -285
  241. data/src/jpeg-7/makejdsw.vc6 +0 -29
  242. data/src/jpeg-7/makejmak.vc6 +0 -425
  243. data/src/jpeg-7/makejsln.vc9 +0 -17
  244. data/src/jpeg-7/makejvcp.vc9 +0 -328
  245. data/src/jpeg-7/makeproj.mac +0 -213
  246. data/src/jpeg-7/makerdep.vc6 +0 -6
  247. data/src/jpeg-7/makerdsp.vc6 +0 -78
  248. data/src/jpeg-7/makermak.vc6 +0 -110
  249. data/src/jpeg-7/makervcp.vc9 +0 -133
  250. data/src/jpeg-7/maketdep.vc6 +0 -43
  251. data/src/jpeg-7/maketdsp.vc6 +0 -122
  252. data/src/jpeg-7/maketmak.vc6 +0 -131
  253. data/src/jpeg-7/maketvcp.vc9 +0 -178
  254. data/src/jpeg-7/makewdep.vc6 +0 -6
  255. data/src/jpeg-7/makewdsp.vc6 +0 -78
  256. data/src/jpeg-7/makewmak.vc6 +0 -110
  257. data/src/jpeg-7/makewvcp.vc9 +0 -133
  258. data/src/jpeg-7/makljpeg.st +0 -68
  259. data/src/jpeg-7/maktjpeg.st +0 -30
  260. data/src/jpeg-7/makvms.opt +0 -4
  261. data/src/jpeg-7/missing +0 -376
  262. data/src/jpeg-7/rdbmp.c +0 -439
  263. data/src/jpeg-7/rdcolmap.c +0 -253
  264. data/src/jpeg-7/rdgif.c +0 -38
  265. data/src/jpeg-7/rdjpgcom.1 +0 -63
  266. data/src/jpeg-7/rdjpgcom.c +0 -515
  267. data/src/jpeg-7/rdppm.c +0 -459
  268. data/src/jpeg-7/rdrle.c +0 -387
  269. data/src/jpeg-7/rdswitch.c +0 -365
  270. data/src/jpeg-7/rdtarga.c +0 -500
  271. data/src/jpeg-7/structure.txt +0 -945
  272. data/src/jpeg-7/testimg.bmp +0 -0
  273. data/src/jpeg-7/testimg.jpg +0 -0
  274. data/src/jpeg-7/testimg.ppm +0 -4
  275. data/src/jpeg-7/testimgp.jpg +0 -0
  276. data/src/jpeg-7/testorig.jpg +0 -0
  277. data/src/jpeg-7/testprog.jpg +0 -0
  278. data/src/jpeg-7/transupp.c +0 -1533
  279. data/src/jpeg-7/transupp.h +0 -205
  280. data/src/jpeg-7/usage.txt +0 -605
  281. data/src/jpeg-7/wizard.txt +0 -211
  282. data/src/jpeg-7/wrbmp.c +0 -442
  283. data/src/jpeg-7/wrgif.c +0 -399
  284. data/src/jpeg-7/wrjpgcom.1 +0 -103
  285. data/src/jpeg-7/wrjpgcom.c +0 -583
  286. data/src/jpeg-7/wrppm.c +0 -269
  287. data/src/jpeg-7/wrrle.c +0 -305
  288. data/src/jpeg-7/wrtarga.c +0 -253
data/src/jpeg-7/example.c DELETED
@@ -1,433 +0,0 @@
1
- /*
2
- * example.c
3
- *
4
- * This file illustrates how to use the IJG code as a subroutine library
5
- * to read or write JPEG image files. You should look at this code in
6
- * conjunction with the documentation file libjpeg.txt.
7
- *
8
- * This code will not do anything useful as-is, but it may be helpful as a
9
- * skeleton for constructing routines that call the JPEG library.
10
- *
11
- * We present these routines in the same coding style used in the JPEG code
12
- * (ANSI function definitions, etc); but you are of course free to code your
13
- * routines in a different style if you prefer.
14
- */
15
-
16
- #include <stdio.h>
17
-
18
- /*
19
- * Include file for users of JPEG library.
20
- * You will need to have included system headers that define at least
21
- * the typedefs FILE and size_t before you can include jpeglib.h.
22
- * (stdio.h is sufficient on ANSI-conforming systems.)
23
- * You may also wish to include "jerror.h".
24
- */
25
-
26
- #include "jpeglib.h"
27
-
28
- /*
29
- * <setjmp.h> is used for the optional error recovery mechanism shown in
30
- * the second part of the example.
31
- */
32
-
33
- #include <setjmp.h>
34
-
35
-
36
-
37
- /******************** JPEG COMPRESSION SAMPLE INTERFACE *******************/
38
-
39
- /* This half of the example shows how to feed data into the JPEG compressor.
40
- * We present a minimal version that does not worry about refinements such
41
- * as error recovery (the JPEG code will just exit() if it gets an error).
42
- */
43
-
44
-
45
- /*
46
- * IMAGE DATA FORMATS:
47
- *
48
- * The standard input image format is a rectangular array of pixels, with
49
- * each pixel having the same number of "component" values (color channels).
50
- * Each pixel row is an array of JSAMPLEs (which typically are unsigned chars).
51
- * If you are working with color data, then the color values for each pixel
52
- * must be adjacent in the row; for example, R,G,B,R,G,B,R,G,B,... for 24-bit
53
- * RGB color.
54
- *
55
- * For this example, we'll assume that this data structure matches the way
56
- * our application has stored the image in memory, so we can just pass a
57
- * pointer to our image buffer. In particular, let's say that the image is
58
- * RGB color and is described by:
59
- */
60
-
61
- extern JSAMPLE * image_buffer; /* Points to large array of R,G,B-order data */
62
- extern int image_height; /* Number of rows in image */
63
- extern int image_width; /* Number of columns in image */
64
-
65
-
66
- /*
67
- * Sample routine for JPEG compression. We assume that the target file name
68
- * and a compression quality factor are passed in.
69
- */
70
-
71
- GLOBAL(void)
72
- write_JPEG_file (char * filename, int quality)
73
- {
74
- /* This struct contains the JPEG compression parameters and pointers to
75
- * working space (which is allocated as needed by the JPEG library).
76
- * It is possible to have several such structures, representing multiple
77
- * compression/decompression processes, in existence at once. We refer
78
- * to any one struct (and its associated working data) as a "JPEG object".
79
- */
80
- struct jpeg_compress_struct cinfo;
81
- /* This struct represents a JPEG error handler. It is declared separately
82
- * because applications often want to supply a specialized error handler
83
- * (see the second half of this file for an example). But here we just
84
- * take the easy way out and use the standard error handler, which will
85
- * print a message on stderr and call exit() if compression fails.
86
- * Note that this struct must live as long as the main JPEG parameter
87
- * struct, to avoid dangling-pointer problems.
88
- */
89
- struct jpeg_error_mgr jerr;
90
- /* More stuff */
91
- FILE * outfile; /* target file */
92
- JSAMPROW row_pointer[1]; /* pointer to JSAMPLE row[s] */
93
- int row_stride; /* physical row width in image buffer */
94
-
95
- /* Step 1: allocate and initialize JPEG compression object */
96
-
97
- /* We have to set up the error handler first, in case the initialization
98
- * step fails. (Unlikely, but it could happen if you are out of memory.)
99
- * This routine fills in the contents of struct jerr, and returns jerr's
100
- * address which we place into the link field in cinfo.
101
- */
102
- cinfo.err = jpeg_std_error(&jerr);
103
- /* Now we can initialize the JPEG compression object. */
104
- jpeg_create_compress(&cinfo);
105
-
106
- /* Step 2: specify data destination (eg, a file) */
107
- /* Note: steps 2 and 3 can be done in either order. */
108
-
109
- /* Here we use the library-supplied code to send compressed data to a
110
- * stdio stream. You can also write your own code to do something else.
111
- * VERY IMPORTANT: use "b" option to fopen() if you are on a machine that
112
- * requires it in order to write binary files.
113
- */
114
- if ((outfile = fopen(filename, "wb")) == NULL) {
115
- fprintf(stderr, "can't open %s\n", filename);
116
- exit(1);
117
- }
118
- jpeg_stdio_dest(&cinfo, outfile);
119
-
120
- /* Step 3: set parameters for compression */
121
-
122
- /* First we supply a description of the input image.
123
- * Four fields of the cinfo struct must be filled in:
124
- */
125
- cinfo.image_width = image_width; /* image width and height, in pixels */
126
- cinfo.image_height = image_height;
127
- cinfo.input_components = 3; /* # of color components per pixel */
128
- cinfo.in_color_space = JCS_RGB; /* colorspace of input image */
129
- /* Now use the library's routine to set default compression parameters.
130
- * (You must set at least cinfo.in_color_space before calling this,
131
- * since the defaults depend on the source color space.)
132
- */
133
- jpeg_set_defaults(&cinfo);
134
- /* Now you can set any non-default parameters you wish to.
135
- * Here we just illustrate the use of quality (quantization table) scaling:
136
- */
137
- jpeg_set_quality(&cinfo, quality, TRUE /* limit to baseline-JPEG values */);
138
-
139
- /* Step 4: Start compressor */
140
-
141
- /* TRUE ensures that we will write a complete interchange-JPEG file.
142
- * Pass TRUE unless you are very sure of what you're doing.
143
- */
144
- jpeg_start_compress(&cinfo, TRUE);
145
-
146
- /* Step 5: while (scan lines remain to be written) */
147
- /* jpeg_write_scanlines(...); */
148
-
149
- /* Here we use the library's state variable cinfo.next_scanline as the
150
- * loop counter, so that we don't have to keep track ourselves.
151
- * To keep things simple, we pass one scanline per call; you can pass
152
- * more if you wish, though.
153
- */
154
- row_stride = image_width * 3; /* JSAMPLEs per row in image_buffer */
155
-
156
- while (cinfo.next_scanline < cinfo.image_height) {
157
- /* jpeg_write_scanlines expects an array of pointers to scanlines.
158
- * Here the array is only one element long, but you could pass
159
- * more than one scanline at a time if that's more convenient.
160
- */
161
- row_pointer[0] = & image_buffer[cinfo.next_scanline * row_stride];
162
- (void) jpeg_write_scanlines(&cinfo, row_pointer, 1);
163
- }
164
-
165
- /* Step 6: Finish compression */
166
-
167
- jpeg_finish_compress(&cinfo);
168
- /* After finish_compress, we can close the output file. */
169
- fclose(outfile);
170
-
171
- /* Step 7: release JPEG compression object */
172
-
173
- /* This is an important step since it will release a good deal of memory. */
174
- jpeg_destroy_compress(&cinfo);
175
-
176
- /* And we're done! */
177
- }
178
-
179
-
180
- /*
181
- * SOME FINE POINTS:
182
- *
183
- * In the above loop, we ignored the return value of jpeg_write_scanlines,
184
- * which is the number of scanlines actually written. We could get away
185
- * with this because we were only relying on the value of cinfo.next_scanline,
186
- * which will be incremented correctly. If you maintain additional loop
187
- * variables then you should be careful to increment them properly.
188
- * Actually, for output to a stdio stream you needn't worry, because
189
- * then jpeg_write_scanlines will write all the lines passed (or else exit
190
- * with a fatal error). Partial writes can only occur if you use a data
191
- * destination module that can demand suspension of the compressor.
192
- * (If you don't know what that's for, you don't need it.)
193
- *
194
- * If the compressor requires full-image buffers (for entropy-coding
195
- * optimization or a multi-scan JPEG file), it will create temporary
196
- * files for anything that doesn't fit within the maximum-memory setting.
197
- * (Note that temp files are NOT needed if you use the default parameters.)
198
- * On some systems you may need to set up a signal handler to ensure that
199
- * temporary files are deleted if the program is interrupted. See libjpeg.txt.
200
- *
201
- * Scanlines MUST be supplied in top-to-bottom order if you want your JPEG
202
- * files to be compatible with everyone else's. If you cannot readily read
203
- * your data in that order, you'll need an intermediate array to hold the
204
- * image. See rdtarga.c or rdbmp.c for examples of handling bottom-to-top
205
- * source data using the JPEG code's internal virtual-array mechanisms.
206
- */
207
-
208
-
209
-
210
- /******************** JPEG DECOMPRESSION SAMPLE INTERFACE *******************/
211
-
212
- /* This half of the example shows how to read data from the JPEG decompressor.
213
- * It's a bit more refined than the above, in that we show:
214
- * (a) how to modify the JPEG library's standard error-reporting behavior;
215
- * (b) how to allocate workspace using the library's memory manager.
216
- *
217
- * Just to make this example a little different from the first one, we'll
218
- * assume that we do not intend to put the whole image into an in-memory
219
- * buffer, but to send it line-by-line someplace else. We need a one-
220
- * scanline-high JSAMPLE array as a work buffer, and we will let the JPEG
221
- * memory manager allocate it for us. This approach is actually quite useful
222
- * because we don't need to remember to deallocate the buffer separately: it
223
- * will go away automatically when the JPEG object is cleaned up.
224
- */
225
-
226
-
227
- /*
228
- * ERROR HANDLING:
229
- *
230
- * The JPEG library's standard error handler (jerror.c) is divided into
231
- * several "methods" which you can override individually. This lets you
232
- * adjust the behavior without duplicating a lot of code, which you might
233
- * have to update with each future release.
234
- *
235
- * Our example here shows how to override the "error_exit" method so that
236
- * control is returned to the library's caller when a fatal error occurs,
237
- * rather than calling exit() as the standard error_exit method does.
238
- *
239
- * We use C's setjmp/longjmp facility to return control. This means that the
240
- * routine which calls the JPEG library must first execute a setjmp() call to
241
- * establish the return point. We want the replacement error_exit to do a
242
- * longjmp(). But we need to make the setjmp buffer accessible to the
243
- * error_exit routine. To do this, we make a private extension of the
244
- * standard JPEG error handler object. (If we were using C++, we'd say we
245
- * were making a subclass of the regular error handler.)
246
- *
247
- * Here's the extended error handler struct:
248
- */
249
-
250
- struct my_error_mgr {
251
- struct jpeg_error_mgr pub; /* "public" fields */
252
-
253
- jmp_buf setjmp_buffer; /* for return to caller */
254
- };
255
-
256
- typedef struct my_error_mgr * my_error_ptr;
257
-
258
- /*
259
- * Here's the routine that will replace the standard error_exit method:
260
- */
261
-
262
- METHODDEF(void)
263
- my_error_exit (j_common_ptr cinfo)
264
- {
265
- /* cinfo->err really points to a my_error_mgr struct, so coerce pointer */
266
- my_error_ptr myerr = (my_error_ptr) cinfo->err;
267
-
268
- /* Always display the message. */
269
- /* We could postpone this until after returning, if we chose. */
270
- (*cinfo->err->output_message) (cinfo);
271
-
272
- /* Return control to the setjmp point */
273
- longjmp(myerr->setjmp_buffer, 1);
274
- }
275
-
276
-
277
- /*
278
- * Sample routine for JPEG decompression. We assume that the source file name
279
- * is passed in. We want to return 1 on success, 0 on error.
280
- */
281
-
282
-
283
- GLOBAL(int)
284
- read_JPEG_file (char * filename)
285
- {
286
- /* This struct contains the JPEG decompression parameters and pointers to
287
- * working space (which is allocated as needed by the JPEG library).
288
- */
289
- struct jpeg_decompress_struct cinfo;
290
- /* We use our private extension JPEG error handler.
291
- * Note that this struct must live as long as the main JPEG parameter
292
- * struct, to avoid dangling-pointer problems.
293
- */
294
- struct my_error_mgr jerr;
295
- /* More stuff */
296
- FILE * infile; /* source file */
297
- JSAMPARRAY buffer; /* Output row buffer */
298
- int row_stride; /* physical row width in output buffer */
299
-
300
- /* In this example we want to open the input file before doing anything else,
301
- * so that the setjmp() error recovery below can assume the file is open.
302
- * VERY IMPORTANT: use "b" option to fopen() if you are on a machine that
303
- * requires it in order to read binary files.
304
- */
305
-
306
- if ((infile = fopen(filename, "rb")) == NULL) {
307
- fprintf(stderr, "can't open %s\n", filename);
308
- return 0;
309
- }
310
-
311
- /* Step 1: allocate and initialize JPEG decompression object */
312
-
313
- /* We set up the normal JPEG error routines, then override error_exit. */
314
- cinfo.err = jpeg_std_error(&jerr.pub);
315
- jerr.pub.error_exit = my_error_exit;
316
- /* Establish the setjmp return context for my_error_exit to use. */
317
- if (setjmp(jerr.setjmp_buffer)) {
318
- /* If we get here, the JPEG code has signaled an error.
319
- * We need to clean up the JPEG object, close the input file, and return.
320
- */
321
- jpeg_destroy_decompress(&cinfo);
322
- fclose(infile);
323
- return 0;
324
- }
325
- /* Now we can initialize the JPEG decompression object. */
326
- jpeg_create_decompress(&cinfo);
327
-
328
- /* Step 2: specify data source (eg, a file) */
329
-
330
- jpeg_stdio_src(&cinfo, infile);
331
-
332
- /* Step 3: read file parameters with jpeg_read_header() */
333
-
334
- (void) jpeg_read_header(&cinfo, TRUE);
335
- /* We can ignore the return value from jpeg_read_header since
336
- * (a) suspension is not possible with the stdio data source, and
337
- * (b) we passed TRUE to reject a tables-only JPEG file as an error.
338
- * See libjpeg.txt for more info.
339
- */
340
-
341
- /* Step 4: set parameters for decompression */
342
-
343
- /* In this example, we don't need to change any of the defaults set by
344
- * jpeg_read_header(), so we do nothing here.
345
- */
346
-
347
- /* Step 5: Start decompressor */
348
-
349
- (void) jpeg_start_decompress(&cinfo);
350
- /* We can ignore the return value since suspension is not possible
351
- * with the stdio data source.
352
- */
353
-
354
- /* We may need to do some setup of our own at this point before reading
355
- * the data. After jpeg_start_decompress() we have the correct scaled
356
- * output image dimensions available, as well as the output colormap
357
- * if we asked for color quantization.
358
- * In this example, we need to make an output work buffer of the right size.
359
- */
360
- /* JSAMPLEs per row in output buffer */
361
- row_stride = cinfo.output_width * cinfo.output_components;
362
- /* Make a one-row-high sample array that will go away when done with image */
363
- buffer = (*cinfo.mem->alloc_sarray)
364
- ((j_common_ptr) &cinfo, JPOOL_IMAGE, row_stride, 1);
365
-
366
- /* Step 6: while (scan lines remain to be read) */
367
- /* jpeg_read_scanlines(...); */
368
-
369
- /* Here we use the library's state variable cinfo.output_scanline as the
370
- * loop counter, so that we don't have to keep track ourselves.
371
- */
372
- while (cinfo.output_scanline < cinfo.output_height) {
373
- /* jpeg_read_scanlines expects an array of pointers to scanlines.
374
- * Here the array is only one element long, but you could ask for
375
- * more than one scanline at a time if that's more convenient.
376
- */
377
- (void) jpeg_read_scanlines(&cinfo, buffer, 1);
378
- /* Assume put_scanline_someplace wants a pointer and sample count. */
379
- put_scanline_someplace(buffer[0], row_stride);
380
- }
381
-
382
- /* Step 7: Finish decompression */
383
-
384
- (void) jpeg_finish_decompress(&cinfo);
385
- /* We can ignore the return value since suspension is not possible
386
- * with the stdio data source.
387
- */
388
-
389
- /* Step 8: Release JPEG decompression object */
390
-
391
- /* This is an important step since it will release a good deal of memory. */
392
- jpeg_destroy_decompress(&cinfo);
393
-
394
- /* After finish_decompress, we can close the input file.
395
- * Here we postpone it until after no more JPEG errors are possible,
396
- * so as to simplify the setjmp error logic above. (Actually, I don't
397
- * think that jpeg_destroy can do an error exit, but why assume anything...)
398
- */
399
- fclose(infile);
400
-
401
- /* At this point you may want to check to see whether any corrupt-data
402
- * warnings occurred (test whether jerr.pub.num_warnings is nonzero).
403
- */
404
-
405
- /* And we're done! */
406
- return 1;
407
- }
408
-
409
-
410
- /*
411
- * SOME FINE POINTS:
412
- *
413
- * In the above code, we ignored the return value of jpeg_read_scanlines,
414
- * which is the number of scanlines actually read. We could get away with
415
- * this because we asked for only one line at a time and we weren't using
416
- * a suspending data source. See libjpeg.txt for more info.
417
- *
418
- * We cheated a bit by calling alloc_sarray() after jpeg_start_decompress();
419
- * we should have done it beforehand to ensure that the space would be
420
- * counted against the JPEG max_memory setting. In some systems the above
421
- * code would risk an out-of-memory error. However, in general we don't
422
- * know the output image dimensions before jpeg_start_decompress(), unless we
423
- * call jpeg_calc_output_dimensions(). See libjpeg.txt for more about this.
424
- *
425
- * Scanlines are returned in the same order as they appear in the JPEG file,
426
- * which is standardly top-to-bottom. If you must emit data bottom-to-top,
427
- * you can use one of the virtual arrays provided by the JPEG memory manager
428
- * to invert the data. See wrbmp.c for an example.
429
- *
430
- * As with compression, some operating modes may require temporary files.
431
- * On some systems you may need to set up a signal handler to ensure that
432
- * temporary files are deleted if the program is interrupted. See libjpeg.txt.
433
- */
@@ -1,215 +0,0 @@
1
- IJG JPEG LIBRARY: FILE LIST
2
-
3
- Copyright (C) 1994-2009, Thomas G. Lane, Guido Vollbeding.
4
- This file is part of the Independent JPEG Group's software.
5
- For conditions of distribution and use, see the accompanying README file.
6
-
7
-
8
- Here is a road map to the files in the IJG JPEG distribution. The
9
- distribution includes the JPEG library proper, plus two application
10
- programs ("cjpeg" and "djpeg") which use the library to convert JPEG
11
- files to and from some other popular image formats. A third application
12
- "jpegtran" uses the library to do lossless conversion between different
13
- variants of JPEG. There are also two stand-alone applications,
14
- "rdjpgcom" and "wrjpgcom".
15
-
16
-
17
- THE JPEG LIBRARY
18
- ================
19
-
20
- Include files:
21
-
22
- jpeglib.h JPEG library's exported data and function declarations.
23
- jconfig.h Configuration declarations. Note: this file is not present
24
- in the distribution; it is generated during installation.
25
- jmorecfg.h Additional configuration declarations; need not be changed
26
- for a standard installation.
27
- jerror.h Declares JPEG library's error and trace message codes.
28
- jinclude.h Central include file used by all IJG .c files to reference
29
- system include files.
30
- jpegint.h JPEG library's internal data structures.
31
- jdct.h Private declarations for forward & reverse DCT subsystems.
32
- jmemsys.h Private declarations for memory management subsystem.
33
- jversion.h Version information.
34
-
35
- Applications using the library should include jpeglib.h (which in turn
36
- includes jconfig.h and jmorecfg.h). Optionally, jerror.h may be included
37
- if the application needs to reference individual JPEG error codes. The
38
- other include files are intended for internal use and would not normally
39
- be included by an application program. (cjpeg/djpeg/etc do use jinclude.h,
40
- since its function is to improve portability of the whole IJG distribution.
41
- Most other applications will directly include the system include files they
42
- want, and hence won't need jinclude.h.)
43
-
44
-
45
- C source code files:
46
-
47
- These files contain most of the functions intended to be called directly by
48
- an application program:
49
-
50
- jcapimin.c Application program interface: core routines for compression.
51
- jcapistd.c Application program interface: standard compression.
52
- jdapimin.c Application program interface: core routines for decompression.
53
- jdapistd.c Application program interface: standard decompression.
54
- jcomapi.c Application program interface routines common to compression
55
- and decompression.
56
- jcparam.c Compression parameter setting helper routines.
57
- jctrans.c API and library routines for transcoding compression.
58
- jdtrans.c API and library routines for transcoding decompression.
59
-
60
- Compression side of the library:
61
-
62
- jcinit.c Initialization: determines which other modules to use.
63
- jcmaster.c Master control: setup and inter-pass sequencing logic.
64
- jcmainct.c Main buffer controller (preprocessor => JPEG compressor).
65
- jcprepct.c Preprocessor buffer controller.
66
- jccoefct.c Buffer controller for DCT coefficient buffer.
67
- jccolor.c Color space conversion.
68
- jcsample.c Downsampling.
69
- jcdctmgr.c DCT manager (DCT implementation selection & control).
70
- jfdctint.c Forward DCT using slow-but-accurate integer method.
71
- jfdctfst.c Forward DCT using faster, less accurate integer method.
72
- jfdctflt.c Forward DCT using floating-point arithmetic.
73
- jchuff.c Huffman entropy coding.
74
- jcarith.c Arithmetic entropy coding.
75
- jcmarker.c JPEG marker writing.
76
- jdatadst.c Data destination manager for stdio output.
77
-
78
- Decompression side of the library:
79
-
80
- jdmaster.c Master control: determines which other modules to use.
81
- jdinput.c Input controller: controls input processing modules.
82
- jdmainct.c Main buffer controller (JPEG decompressor => postprocessor).
83
- jdcoefct.c Buffer controller for DCT coefficient buffer.
84
- jdpostct.c Postprocessor buffer controller.
85
- jdmarker.c JPEG marker reading.
86
- jdhuff.c Huffman entropy decoding.
87
- jdarith.c Arithmetic entropy decoding.
88
- jddctmgr.c IDCT manager (IDCT implementation selection & control).
89
- jidctint.c Inverse DCT using slow-but-accurate integer method.
90
- jidctfst.c Inverse DCT using faster, less accurate integer method.
91
- jidctflt.c Inverse DCT using floating-point arithmetic.
92
- jdsample.c Upsampling.
93
- jdcolor.c Color space conversion.
94
- jdmerge.c Merged upsampling/color conversion (faster, lower quality).
95
- jquant1.c One-pass color quantization using a fixed-spacing colormap.
96
- jquant2.c Two-pass color quantization using a custom-generated colormap.
97
- Also handles one-pass quantization to an externally given map.
98
- jdatasrc.c Data source manager for stdio input.
99
-
100
- Support files for both compression and decompression:
101
-
102
- jaricom.c Tables for common use in arithmetic entropy encoding and
103
- decoding routines.
104
- jerror.c Standard error handling routines (application replaceable).
105
- jmemmgr.c System-independent (more or less) memory management code.
106
- jutils.c Miscellaneous utility routines.
107
-
108
- jmemmgr.c relies on a system-dependent memory management module. The IJG
109
- distribution includes the following implementations of the system-dependent
110
- module:
111
-
112
- jmemnobs.c "No backing store": assumes adequate virtual memory exists.
113
- jmemansi.c Makes temporary files with ANSI-standard routine tmpfile().
114
- jmemname.c Makes temporary files with program-generated file names.
115
- jmemdos.c Custom implementation for MS-DOS (16-bit environment only):
116
- can use extended and expanded memory as well as temp files.
117
- jmemmac.c Custom implementation for Apple Macintosh.
118
-
119
- Exactly one of the system-dependent modules should be configured into an
120
- installed JPEG library (see install.txt for hints about which one to use).
121
- On unusual systems you may find it worthwhile to make a special
122
- system-dependent memory manager.
123
-
124
-
125
- Non-C source code files:
126
-
127
- jmemdosa.asm 80x86 assembly code support for jmemdos.c; used only in
128
- MS-DOS-specific configurations of the JPEG library.
129
-
130
-
131
- CJPEG/DJPEG/JPEGTRAN
132
- ====================
133
-
134
- Include files:
135
-
136
- cdjpeg.h Declarations shared by cjpeg/djpeg/jpegtran modules.
137
- cderror.h Additional error and trace message codes for cjpeg et al.
138
- transupp.h Declarations for jpegtran support routines in transupp.c.
139
-
140
- C source code files:
141
-
142
- cjpeg.c Main program for cjpeg.
143
- djpeg.c Main program for djpeg.
144
- jpegtran.c Main program for jpegtran.
145
- cdjpeg.c Utility routines used by all three programs.
146
- rdcolmap.c Code to read a colormap file for djpeg's "-map" switch.
147
- rdswitch.c Code to process some of cjpeg's more complex switches.
148
- Also used by jpegtran.
149
- transupp.c Support code for jpegtran: lossless image manipulations.
150
-
151
- Image file reader modules for cjpeg:
152
-
153
- rdbmp.c BMP file input.
154
- rdgif.c GIF file input (now just a stub).
155
- rdppm.c PPM/PGM file input.
156
- rdrle.c Utah RLE file input.
157
- rdtarga.c Targa file input.
158
-
159
- Image file writer modules for djpeg:
160
-
161
- wrbmp.c BMP file output.
162
- wrgif.c GIF file output (a mere shadow of its former self).
163
- wrppm.c PPM/PGM file output.
164
- wrrle.c Utah RLE file output.
165
- wrtarga.c Targa file output.
166
-
167
-
168
- RDJPGCOM/WRJPGCOM
169
- =================
170
-
171
- C source code files:
172
-
173
- rdjpgcom.c Stand-alone rdjpgcom application.
174
- wrjpgcom.c Stand-alone wrjpgcom application.
175
-
176
- These programs do not depend on the IJG library. They do use
177
- jconfig.h and jinclude.h, only to improve portability.
178
-
179
-
180
- ADDITIONAL FILES
181
- ================
182
-
183
- Documentation (see README for a guide to the documentation files):
184
-
185
- README Master documentation file.
186
- *.txt Other documentation files.
187
- *.1 Documentation in Unix man page format.
188
- change.log Version-to-version change highlights.
189
- example.c Sample code for calling JPEG library.
190
-
191
- Configuration/installation files and programs (see install.txt for more info):
192
-
193
- configure Unix shell script to perform automatic configuration.
194
- configure.ac Source file for use with Autoconf to generate configure.
195
- ltmain.sh Support scripts for configure (from GNU libtool).
196
- config.guess
197
- config.sub
198
- depcomp
199
- missing
200
- install-sh Install shell script for those Unix systems lacking one.
201
- Makefile.in Makefile input for configure.
202
- Makefile.am Source file for use with Automake to generate Makefile.in.
203
- ckconfig.c Program to generate jconfig.h on non-Unix systems.
204
- jconfig.txt Template for making jconfig.h by hand.
205
- mak*.* Sample makefiles for particular systems.
206
- jconfig.* Sample jconfig.h for particular systems.
207
- libjpeg.map Script to generate shared library with versioned symbols.
208
- aclocal.m4 M4 macro definitions for use with Autoconf.
209
- ansi2knr.c De-ANSIfier for pre-ANSI C compilers (courtesy of
210
- L. Peter Deutsch and Aladdin Enterprises).
211
-
212
- Test files (see install.txt for test procedure):
213
-
214
- test*.* Source and comparison files for confidence test.
215
- These are binary image files, NOT text files.