home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #30 / NN_1992_30.iso / spool / comp / sources / misc / 4210 < prev    next >
SHell self-extracting ARchive  |  1992-12-17  |  58.5 KB

open in: MacOS 8.1     |     Win98     |     DOS

browse contents    |     view JSON data     |     view as text


This file was processed as: SHell self-extracting ARchive (archive/shar).

ConfidenceProgramDetectionMatch TypeSupport
100% dexvert SHell self-extracting ARchive (archive/shar) magic Supported
1% dexvert Text File (text/txt) fallback Supported
100% file ASCII text default
100% checkBytes Printable ASCII default
100% perlTextCheck Likely Text (Perl) default
100% siegfried fmt/329 Shell Archive Format default
100% detectItEasy Format: plain text[LF] default (weak)



hex view
+--------+-------------------------+-------------------------+--------+--------+
|00000000| 4e 65 77 73 67 72 6f 75 | 70 73 3a 20 63 6f 6d 70 |Newsgrou|ps: comp|
|00000010| 2e 73 6f 75 72 63 65 73 | 2e 6d 69 73 63 0a 50 61 |.sources|.misc.Pa|
|00000020| 74 68 3a 20 73 70 61 72 | 6b 79 21 6b 65 6e 74 0a |th: spar|ky!kent.|
|00000030| 46 72 6f 6d 3a 20 6a 70 | 65 67 2d 69 6e 66 6f 40 |From: jp|eg-info@|
|00000040| 75 75 6e 65 74 2e 75 75 | 2e 6e 65 74 20 28 49 6e |uunet.uu|.net (In|
|00000050| 64 65 70 65 6e 64 65 6e | 74 20 4a 50 45 47 20 47 |dependen|t JPEG G|
|00000060| 72 6f 75 70 29 0a 53 75 | 62 6a 65 63 74 3a 20 20 |roup).Su|bject: |
|00000070| 76 33 34 69 30 37 30 3a | 20 20 6a 70 65 67 20 2d |v34i070:| jpeg -|
|00000080| 20 4a 50 45 47 20 69 6d | 61 67 65 20 63 6f 6d 70 | JPEG im|age comp|
|00000090| 72 65 73 73 69 6f 6e 2c | 20 50 61 72 74 31 36 2f |ression,| Part16/|
|000000a0| 31 38 0a 4d 65 73 73 61 | 67 65 2d 49 44 3a 20 3c |18.Messa|ge-ID: <|
|000000b0| 31 39 39 32 44 65 63 31 | 37 2e 31 36 35 31 31 39 |1992Dec1|7.165119|
|000000c0| 2e 36 38 37 37 40 73 70 | 61 72 6b 79 2e 69 6d 64 |.6877@sp|arky.imd|
|000000d0| 2e 73 74 65 72 6c 69 6e | 67 2e 63 6f 6d 3e 0a 46 |.sterlin|g.com>.F|
|000000e0| 6f 6c 6c 6f 77 75 70 2d | 54 6f 3a 20 63 6f 6d 70 |ollowup-|To: comp|
|000000f0| 2e 73 6f 75 72 63 65 73 | 2e 64 0a 58 2d 4d 64 34 |.sources|.d.X-Md4|
|00000100| 2d 53 69 67 6e 61 74 75 | 72 65 3a 20 36 30 65 33 |-Signatu|re: 60e3|
|00000110| 32 61 30 38 37 65 65 32 | 65 38 35 61 39 64 61 64 |2a087ee2|e85a9dad|
|00000120| 31 62 31 32 30 38 37 62 | 31 31 38 36 0a 4b 65 79 |1b12087b|1186.Key|
|00000130| 77 6f 72 64 73 3a 20 4a | 50 45 47 2c 20 69 6d 61 |words: J|PEG, ima|
|00000140| 67 65 20 63 6f 6d 70 72 | 65 73 73 69 6f 6e 0a 53 |ge compr|ession.S|
|00000150| 65 6e 64 65 72 3a 20 6b | 65 6e 74 40 73 70 61 72 |ender: k|ent@spar|
|00000160| 6b 79 2e 69 6d 64 2e 73 | 74 65 72 6c 69 6e 67 2e |ky.imd.s|terling.|
|00000170| 63 6f 6d 20 28 4b 65 6e | 74 20 4c 61 6e 64 66 69 |com (Ken|t Landfi|
|00000180| 65 6c 64 29 0a 4f 72 67 | 61 6e 69 7a 61 74 69 6f |eld).Org|anizatio|
|00000190| 6e 3a 20 49 6e 64 65 70 | 65 6e 64 65 6e 74 20 4a |n: Indep|endent J|
|000001a0| 50 45 47 20 47 72 6f 75 | 70 0a 52 65 66 65 72 65 |PEG Grou|p.Refere|
|000001b0| 6e 63 65 73 3a 20 3c 63 | 73 6d 2d 76 33 34 69 30 |nces: <c|sm-v34i0|
|000001c0| 35 35 3d 6a 70 65 67 2e | 32 32 30 34 32 34 40 73 |55=jpeg.|220424@s|
|000001d0| 70 61 72 6b 79 2e 49 4d | 44 2e 53 74 65 72 6c 69 |parky.IM|D.Sterli|
|000001e0| 6e 67 2e 43 4f 4d 3e 0a | 44 61 74 65 3a 20 54 68 |ng.COM>.|Date: Th|
|000001f0| 75 2c 20 31 37 20 44 65 | 63 20 31 39 39 32 20 31 |u, 17 De|c 1992 1|
|00000200| 36 3a 35 31 3a 31 39 20 | 47 4d 54 0a 41 70 70 72 |6:51:19 |GMT.Appr|
|00000210| 6f 76 65 64 3a 20 6b 65 | 6e 74 40 73 70 61 72 6b |oved: ke|nt@spark|
|00000220| 79 2e 69 6d 64 2e 73 74 | 65 72 6c 69 6e 67 2e 63 |y.imd.st|erling.c|
|00000230| 6f 6d 0a 4c 69 6e 65 73 | 3a 20 31 35 33 30 0a 0a |om.Lines|: 1530..|
|00000240| 53 75 62 6d 69 74 74 65 | 64 2d 62 79 3a 20 6a 70 |Submitte|d-by: jp|
|00000250| 65 67 2d 69 6e 66 6f 40 | 75 75 6e 65 74 2e 75 75 |eg-info@|uunet.uu|
|00000260| 2e 6e 65 74 20 28 49 6e | 64 65 70 65 6e 64 65 6e |.net (In|dependen|
|00000270| 74 20 4a 50 45 47 20 47 | 72 6f 75 70 29 0a 50 6f |t JPEG G|roup).Po|
|00000280| 73 74 69 6e 67 2d 6e 75 | 6d 62 65 72 3a 20 56 6f |sting-nu|mber: Vo|
|00000290| 6c 75 6d 65 20 33 34 2c | 20 49 73 73 75 65 20 37 |lume 34,| Issue 7|
|000002a0| 30 0a 41 72 63 68 69 76 | 65 2d 6e 61 6d 65 3a 20 |0.Archiv|e-name: |
|000002b0| 6a 70 65 67 2f 70 61 72 | 74 31 36 0a 45 6e 76 69 |jpeg/par|t16.Envi|
|000002c0| 72 6f 6e 6d 65 6e 74 3a | 20 55 4e 49 58 2c 20 56 |ronment:| UNIX, V|
|000002d0| 4d 53 2c 20 4d 53 2d 44 | 4f 53 2c 20 4d 61 63 2c |MS, MS-D|OS, Mac,|
|000002e0| 20 41 6d 69 67 61 2c 20 | 41 74 61 72 69 2c 20 43 | Amiga, |Atari, C|
|000002f0| 72 61 79 0a 53 75 70 65 | 72 73 65 64 65 73 3a 20 |ray.Supe|rsedes: |
|00000300| 6a 70 65 67 3a 20 56 6f | 6c 75 6d 65 20 32 39 2c |jpeg: Vo|lume 29,|
|00000310| 20 49 73 73 75 65 20 31 | 2d 31 38 0a 0a 23 21 20 | Issue 1|-18..#! |
|00000320| 2f 62 69 6e 2f 73 68 0a | 23 20 54 68 69 73 20 69 |/bin/sh.|# This i|
|00000330| 73 20 61 20 73 68 65 6c | 6c 20 61 72 63 68 69 76 |s a shel|l archiv|
|00000340| 65 2e 20 20 52 65 6d 6f | 76 65 20 61 6e 79 74 68 |e. Remo|ve anyth|
|00000350| 69 6e 67 20 62 65 66 6f | 72 65 20 74 68 69 73 20 |ing befo|re this |
|00000360| 6c 69 6e 65 2c 20 74 68 | 65 6e 20 66 65 65 64 20 |line, th|en feed |
|00000370| 69 74 0a 23 20 69 6e 74 | 6f 20 61 20 73 68 65 6c |it.# int|o a shel|
|00000380| 6c 20 76 69 61 20 22 73 | 68 20 66 69 6c 65 22 20 |l via "s|h file" |
|00000390| 6f 72 20 73 69 6d 69 6c | 61 72 2e 20 20 54 6f 20 |or simil|ar. To |
|000003a0| 6f 76 65 72 77 72 69 74 | 65 20 65 78 69 73 74 69 |overwrit|e existi|
|000003b0| 6e 67 20 66 69 6c 65 73 | 2c 0a 23 20 74 79 70 65 |ng files|,.# type|
|000003c0| 20 22 73 68 20 66 69 6c | 65 20 2d 63 22 2e 0a 23 | "sh fil|e -c"..#|
|000003d0| 20 43 6f 6e 74 65 6e 74 | 73 3a 20 20 63 6a 70 65 | Content|s: cjpe|
|000003e0| 67 2e 31 20 63 6f 64 69 | 6e 67 72 75 6c 65 73 20 |g.1 codi|ngrules |
|000003f0| 6a 64 64 65 66 6c 74 73 | 2e 63 20 6a 6d 65 6d 6e |jddeflts|.c jmemn|
|00000400| 61 6d 65 2e 63 20 6d 61 | 6b 65 66 69 6c 65 2e 61 |ame.c ma|kefile.a|
|00000410| 6e 73 69 0a 23 20 20 20 | 6d 61 6b 65 66 69 6c 65 |nsi.# |makefile|
|00000420| 2e 62 63 63 20 6d 61 6b | 65 66 69 6c 65 2e 6d 6d |.bcc mak|efile.mm|
|00000430| 73 20 6d 61 6b 65 66 69 | 6c 65 2e 75 6e 69 78 0a |s makefi|le.unix.|
|00000440| 23 20 57 72 61 70 70 65 | 64 20 62 79 20 6b 65 6e |# Wrappe|d by ken|
|00000450| 74 40 73 70 61 72 6b 79 | 20 6f 6e 20 57 65 64 20 |t@sparky| on Wed |
|00000460| 44 65 63 20 31 36 20 32 | 30 3a 35 32 3a 33 31 20 |Dec 16 2|0:52:31 |
|00000470| 31 39 39 32 0a 50 41 54 | 48 3d 2f 62 69 6e 3a 2f |1992.PAT|H=/bin:/|
|00000480| 75 73 72 2f 62 69 6e 3a | 2f 75 73 72 2f 75 63 62 |usr/bin:|/usr/ucb|
|00000490| 3a 2f 75 73 72 2f 6c 6f | 63 61 6c 2f 62 69 6e 3a |:/usr/lo|cal/bin:|
|000004a0| 2f 75 73 72 2f 6c 62 69 | 6e 20 3b 20 65 78 70 6f |/usr/lbi|n ; expo|
|000004b0| 72 74 20 50 41 54 48 0a | 65 63 68 6f 20 49 66 20 |rt PATH.|echo If |
|000004c0| 74 68 69 73 20 61 72 63 | 68 69 76 65 20 69 73 20 |this arc|hive is |
|000004d0| 63 6f 6d 70 6c 65 74 65 | 2c 20 79 6f 75 20 77 69 |complete|, you wi|
|000004e0| 6c 6c 20 73 65 65 20 74 | 68 65 20 66 6f 6c 6c 6f |ll see t|he follo|
|000004f0| 77 69 6e 67 20 6d 65 73 | 73 61 67 65 3a 0a 65 63 |wing mes|sage:.ec|
|00000500| 68 6f 20 27 20 20 20 20 | 20 20 20 20 20 20 22 73 |ho ' | "s|
|00000510| 68 61 72 3a 20 45 6e 64 | 20 6f 66 20 61 72 63 68 |har: End| of arch|
|00000520| 69 76 65 20 31 36 20 28 | 6f 66 20 31 38 29 2e 22 |ive 16 (|of 18)."|
|00000530| 27 0a 69 66 20 74 65 73 | 74 20 2d 66 20 27 63 6a |'.if tes|t -f 'cj|
|00000540| 70 65 67 2e 31 27 20 2d | 61 20 22 24 7b 31 7d 22 |peg.1' -|a "${1}"|
|00000550| 20 21 3d 20 22 2d 63 22 | 20 3b 20 74 68 65 6e 20 | != "-c"| ; then |
|00000560| 0a 20 20 65 63 68 6f 20 | 73 68 61 72 3a 20 57 69 |. echo |shar: Wi|
|00000570| 6c 6c 20 6e 6f 74 20 63 | 6c 6f 62 62 65 72 20 65 |ll not c|lobber e|
|00000580| 78 69 73 74 69 6e 67 20 | 66 69 6c 65 20 5c 22 27 |xisting |file \"'|
|00000590| 63 6a 70 65 67 2e 31 27 | 5c 22 0a 65 6c 73 65 0a |cjpeg.1'|\".else.|
|000005a0| 20 20 65 63 68 6f 20 73 | 68 61 72 3a 20 45 78 74 | echo s|har: Ext|
|000005b0| 72 61 63 74 69 6e 67 20 | 5c 22 27 63 6a 70 65 67 |racting |\"'cjpeg|
|000005c0| 2e 31 27 5c 22 20 5c 28 | 37 38 33 38 20 63 68 61 |.1'\" \(|7838 cha|
|000005d0| 72 61 63 74 65 72 73 5c | 29 0a 20 20 73 65 64 20 |racters\|). sed |
|000005e0| 22 73 2f 5e 58 2f 2f 22 | 20 3e 27 63 6a 70 65 67 |"s/^X//"| >'cjpeg|
|000005f0| 2e 31 27 20 3c 3c 27 45 | 4e 44 5f 4f 46 5f 46 49 |.1' <<'E|ND_OF_FI|
|00000600| 4c 45 27 0a 58 2e 54 48 | 20 43 4a 50 45 47 20 31 |LE'.X.TH| CJPEG 1|
|00000610| 20 22 34 20 4e 6f 76 65 | 6d 62 65 72 20 31 39 39 | "4 Nove|mber 199|
|00000620| 32 22 0a 58 2e 53 48 20 | 4e 41 4d 45 0a 58 63 6a |2".X.SH |NAME.Xcj|
|00000630| 70 65 67 20 5c 2d 20 63 | 6f 6d 70 72 65 73 73 20 |peg \- c|ompress |
|00000640| 61 6e 20 69 6d 61 67 65 | 20 66 69 6c 65 20 74 6f |an image| file to|
|00000650| 20 61 20 4a 50 45 47 20 | 66 69 6c 65 0a 58 2e 53 | a JPEG |file.X.S|
|00000660| 48 20 53 59 4e 4f 50 53 | 49 53 0a 58 2e 42 20 63 |H SYNOPS|IS.X.B c|
|00000670| 6a 70 65 67 0a 58 5b 0a | 58 2e 42 49 20 5c 2d 71 |jpeg.X[.|X.BI \-q|
|00000680| 75 61 6c 69 74 79 20 22 | 20 4e 22 0a 58 5d 0a 58 |uality "| N".X].X|
|00000690| 5b 0a 58 2e 42 20 5c 2d | 67 72 61 79 73 63 61 6c |[.X.B \-|grayscal|
|000006a0| 65 0a 58 5d 0a 58 5b 0a | 58 2e 42 20 5c 2d 6f 70 |e.X].X[.|X.B \-op|
|000006b0| 74 69 6d 69 7a 65 0a 58 | 5d 0a 58 5b 0a 58 2e 42 |timize.X|].X[.X.B|
|000006c0| 20 5c 2d 74 61 72 67 61 | 0a 58 5d 0a 58 5b 0a 58 | \-targa|.X].X[.X|
|000006d0| 2e 42 49 20 5c 2d 6d 61 | 78 6d 65 6d 6f 72 79 20 |.BI \-ma|xmemory |
|000006e0| 22 20 4e 22 0a 58 5d 0a | 58 5b 0a 58 2e 42 49 20 |" N".X].|X[.X.BI |
|000006f0| 5c 2d 72 65 73 74 61 72 | 74 20 22 20 4e 22 0a 58 |\-restar|t " N".X|
|00000700| 5d 0a 58 5b 0a 58 2e 42 | 49 20 5c 2d 73 6d 6f 6f |].X[.X.B|I \-smoo|
|00000710| 74 68 20 22 20 4e 22 0a | 58 5d 0a 58 5b 0a 58 2e |th " N".|X].X[.X.|
|00000720| 42 20 5c 2d 76 65 72 62 | 6f 73 65 0a 58 5d 0a 58 |B \-verb|ose.X].X|
|00000730| 5b 0a 58 2e 42 20 5c 2d | 64 65 62 75 67 0a 58 5d |[.X.B \-|debug.X]|
|00000740| 0a 58 5b 0a 58 2e 42 20 | 5c 2d 61 72 69 74 68 6d |.X[.X.B |\-arithm|
|00000750| 65 74 69 63 0a 58 5d 0a | 58 5b 0a 58 2e 42 20 5c |etic.X].|X[.X.B \|
|00000760| 2d 6e 6f 69 6e 74 65 72 | 6c 65 61 76 65 0a 58 5d |-nointer|leave.X]|
|00000770| 0a 58 5b 0a 58 2e 42 49 | 20 5c 2d 71 74 61 62 6c |.X[.X.BI| \-qtabl|
|00000780| 65 73 20 22 20 66 69 6c | 65 22 0a 58 5d 0a 58 5b |es " fil|e".X].X[|
|00000790| 0a 58 2e 42 49 20 5c 2d | 73 61 6d 70 6c 65 20 22 |.X.BI \-|sample "|
|000007a0| 20 48 78 56 5b 2c 2e 2e | 2e 5d 22 0a 58 5d 0a 58 | HxV[,..|.]".X].X|
|000007b0| 5b 0a 58 2e 49 20 66 69 | 6c 65 6e 61 6d 65 0a 58 |[.X.I fi|lename.X|
|000007c0| 5d 0a 58 2e 4c 50 0a 58 | 2e 53 48 20 44 45 53 43 |].X.LP.X|.SH DESC|
|000007d0| 52 49 50 54 49 4f 4e 0a | 58 2e 4c 50 0a 58 2e 42 |RIPTION.|X.LP.X.B|
|000007e0| 20 63 6a 70 65 67 0a 58 | 63 6f 6d 70 72 65 73 73 | cjpeg.X|compress|
|000007f0| 65 73 20 74 68 65 20 6e | 61 6d 65 64 20 69 6d 61 |es the n|amed ima|
|00000800| 67 65 20 66 69 6c 65 2c | 20 6f 72 20 74 68 65 20 |ge file,| or the |
|00000810| 73 74 61 6e 64 61 72 64 | 20 69 6e 70 75 74 20 69 |standard| input i|
|00000820| 66 20 6e 6f 20 66 69 6c | 65 20 69 73 0a 58 6e 61 |f no fil|e is.Xna|
|00000830| 6d 65 64 2c 20 61 6e 64 | 20 70 72 6f 64 75 63 65 |med, and| produce|
|00000840| 73 20 61 20 4a 50 45 47 | 2f 4a 46 49 46 20 66 69 |s a JPEG|/JFIF fi|
|00000850| 6c 65 20 6f 6e 20 74 68 | 65 20 73 74 61 6e 64 61 |le on th|e standa|
|00000860| 72 64 20 6f 75 74 70 75 | 74 2e 0a 58 54 68 65 20 |rd outpu|t..XThe |
|00000870| 63 75 72 72 65 6e 74 6c | 79 20 73 75 70 70 6f 72 |currentl|y suppor|
|00000880| 74 65 64 20 69 6e 70 75 | 74 20 66 69 6c 65 20 66 |ted inpu|t file f|
|00000890| 6f 72 6d 61 74 73 20 61 | 72 65 3a 20 50 50 4d 20 |ormats a|re: PPM |
|000008a0| 28 50 42 4d 50 4c 55 53 | 20 63 6f 6c 6f 72 0a 58 |(PBMPLUS| color.X|
|000008b0| 66 6f 72 6d 61 74 29 2c | 20 50 47 4d 20 28 50 42 |format),| PGM (PB|
|000008c0| 4d 50 4c 55 53 20 67 72 | 61 79 2d 73 63 61 6c 65 |MPLUS gr|ay-scale|
|000008d0| 20 66 6f 72 6d 61 74 29 | 2c 20 47 49 46 2c 20 54 | format)|, GIF, T|
|000008e0| 61 72 67 61 2c 20 61 6e | 64 20 52 4c 45 20 28 55 |arga, an|d RLE (U|
|000008f0| 74 61 68 20 52 61 73 74 | 65 72 0a 58 54 6f 6f 6c |tah Rast|er.XTool|
|00000900| 6b 69 74 20 66 6f 72 6d | 61 74 29 2e 20 20 28 52 |kit form|at). (R|
|00000910| 4c 45 20 69 73 20 73 75 | 70 70 6f 72 74 65 64 20 |LE is su|pported |
|00000920| 6f 6e 6c 79 20 69 66 20 | 74 68 65 20 55 52 54 20 |only if |the URT |
|00000930| 6c 69 62 72 61 72 79 20 | 69 73 20 61 76 61 69 6c |library |is avail|
|00000940| 61 62 6c 65 2e 29 0a 58 | 2e 53 48 20 4f 50 54 49 |able.).X|.SH OPTI|
|00000950| 4f 4e 53 0a 58 41 6c 6c | 20 73 77 69 74 63 68 20 |ONS.XAll| switch |
|00000960| 6e 61 6d 65 73 20 6d 61 | 79 20 62 65 20 61 62 62 |names ma|y be abb|
|00000970| 72 65 76 69 61 74 65 64 | 3b 20 66 6f 72 20 65 78 |reviated|; for ex|
|00000980| 61 6d 70 6c 65 2c 0a 58 | 2e 42 20 5c 2d 67 72 61 |ample,.X|.B \-gra|
|00000990| 79 73 63 61 6c 65 0a 58 | 6d 61 79 20 62 65 20 77 |yscale.X|may be w|
|000009a0| 72 69 74 74 65 6e 0a 58 | 2e 42 20 5c 2d 67 72 61 |ritten.X|.B \-gra|
|000009b0| 79 0a 58 6f 72 0a 58 2e | 42 52 20 5c 2d 67 72 20 |y.Xor.X.|BR \-gr |
|000009c0| 2e 0a 58 4d 6f 73 74 20 | 6f 66 20 74 68 65 20 22 |..XMost |of the "|
|000009d0| 62 61 73 69 63 22 20 73 | 77 69 74 63 68 65 73 20 |basic" s|witches |
|000009e0| 63 61 6e 20 62 65 20 61 | 62 62 72 65 76 69 61 74 |can be a|bbreviat|
|000009f0| 65 64 20 74 6f 20 61 73 | 20 6c 69 74 74 6c 65 20 |ed to as| little |
|00000a00| 61 73 20 6f 6e 65 20 6c | 65 74 74 65 72 2e 0a 58 |as one l|etter..X|
|00000a10| 55 70 70 65 72 20 61 6e | 64 20 6c 6f 77 65 72 20 |Upper an|d lower |
|00000a20| 63 61 73 65 20 61 72 65 | 20 65 71 75 69 76 61 6c |case are| equival|
|00000a30| 65 6e 74 20 28 74 68 75 | 73 0a 58 2e 42 20 5c 2d |ent (thu|s.X.B \-|
|00000a40| 47 49 46 0a 58 69 73 20 | 74 68 65 20 73 61 6d 65 |GIF.Xis |the same|
|00000a50| 20 61 73 0a 58 2e 42 52 | 20 5c 2d 67 69 66 20 29 | as.X.BR| \-gif )|
|00000a60| 2e 0a 58 42 72 69 74 69 | 73 68 20 73 70 65 6c 6c |..XBriti|sh spell|
|00000a70| 69 6e 67 73 20 61 72 65 | 20 61 6c 73 6f 20 61 63 |ings are| also ac|
|00000a80| 63 65 70 74 65 64 20 28 | 65 2e 67 2e 2c 0a 58 2e |cepted (|e.g.,.X.|
|00000a90| 42 52 20 5c 2d 67 72 65 | 79 73 63 61 6c 65 20 29 |BR \-gre|yscale )|
|00000aa0| 2c 0a 58 74 68 6f 75 67 | 68 20 66 6f 72 20 62 72 |,.Xthoug|h for br|
|00000ab0| 65 76 69 74 79 20 74 68 | 65 73 65 20 61 72 65 20 |evity th|ese are |
|00000ac0| 6e 6f 74 20 6d 65 6e 74 | 69 6f 6e 65 64 20 62 65 |not ment|ioned be|
|00000ad0| 6c 6f 77 2e 0a 58 2e 50 | 50 0a 58 54 68 65 20 62 |low..X.P|P.XThe b|
|00000ae0| 61 73 69 63 20 73 77 69 | 74 63 68 65 73 20 61 72 |asic swi|tches ar|
|00000af0| 65 3a 0a 58 2e 54 50 0a | 58 2e 42 49 20 5c 2d 71 |e:.X.TP.|X.BI \-q|
|00000b00| 75 61 6c 69 74 79 20 22 | 20 4e 22 0a 58 53 63 61 |uality "| N".XSca|
|00000b10| 6c 65 20 71 75 61 6e 74 | 69 7a 61 74 69 6f 6e 20 |le quant|ization |
|00000b20| 74 61 62 6c 65 73 20 74 | 6f 20 61 64 6a 75 73 74 |tables t|o adjust|
|00000b30| 20 69 6d 61 67 65 20 71 | 75 61 6c 69 74 79 2e 20 | image q|uality. |
|00000b40| 20 51 75 61 6c 69 74 79 | 20 69 73 20 30 20 28 77 | Quality| is 0 (w|
|00000b50| 6f 72 73 74 29 20 74 6f | 0a 58 31 30 30 20 28 62 |orst) to|.X100 (b|
|00000b60| 65 73 74 29 3b 20 64 65 | 66 61 75 6c 74 20 69 73 |est); de|fault is|
|00000b70| 20 37 35 2e 20 20 28 53 | 65 65 20 62 65 6c 6f 77 | 75. (S|ee below|
|00000b80| 20 66 6f 72 20 6d 6f 72 | 65 20 69 6e 66 6f 2e 29 | for mor|e info.)|
|00000b90| 0a 58 2e 54 50 0a 58 2e | 42 20 5c 2d 67 72 61 79 |.X.TP.X.|B \-gray|
|00000ba0| 73 63 61 6c 65 0a 58 43 | 72 65 61 74 65 20 6d 6f |scale.XC|reate mo|
|00000bb0| 6e 6f 63 68 72 6f 6d 65 | 20 4a 50 45 47 20 66 69 |nochrome| JPEG fi|
|00000bc0| 6c 65 20 66 72 6f 6d 20 | 63 6f 6c 6f 72 20 69 6e |le from |color in|
|00000bd0| 70 75 74 2e 20 20 42 65 | 20 73 75 72 65 20 74 6f |put. Be| sure to|
|00000be0| 20 75 73 65 20 74 68 69 | 73 20 73 77 69 74 63 68 | use thi|s switch|
|00000bf0| 20 77 68 65 6e 0a 58 63 | 6f 6d 70 72 65 73 73 69 | when.Xc|ompressi|
|00000c00| 6e 67 20 61 20 67 72 61 | 79 73 63 61 6c 65 20 47 |ng a gra|yscale G|
|00000c10| 49 46 20 66 69 6c 65 2c | 20 62 65 63 61 75 73 65 |IF file,| because|
|00000c20| 0a 58 2e 42 20 63 6a 70 | 65 67 0a 58 69 73 6e 27 |.X.B cjp|eg.Xisn'|
|00000c30| 74 20 62 72 69 67 68 74 | 20 65 6e 6f 75 67 68 20 |t bright| enough |
|00000c40| 74 6f 20 6e 6f 74 69 63 | 65 20 77 68 65 74 68 65 |to notic|e whethe|
|00000c50| 72 20 61 20 47 49 46 20 | 66 69 6c 65 20 75 73 65 |r a GIF |file use|
|00000c60| 73 20 6f 6e 6c 79 20 73 | 68 61 64 65 73 20 6f 66 |s only s|hades of|
|00000c70| 20 67 72 61 79 2e 0a 58 | 42 79 20 73 61 79 69 6e | gray..X|By sayin|
|00000c80| 67 0a 58 2e 42 52 20 5c | 2d 67 72 61 79 73 63 61 |g.X.BR \|-graysca|
|00000c90| 6c 65 20 2c 0a 58 79 6f | 75 27 6c 6c 20 67 65 74 |le ,.Xyo|u'll get|
|00000ca0| 20 61 20 73 6d 61 6c 6c | 65 72 20 4a 50 45 47 20 | a small|er JPEG |
|00000cb0| 66 69 6c 65 20 74 68 61 | 74 20 74 61 6b 65 73 20 |file tha|t takes |
|00000cc0| 6c 65 73 73 20 74 69 6d | 65 20 74 6f 20 70 72 6f |less tim|e to pro|
|00000cd0| 63 65 73 73 2e 0a 58 2e | 54 50 0a 58 2e 42 20 5c |cess..X.|TP.X.B \|
|00000ce0| 2d 6f 70 74 69 6d 69 7a | 65 0a 58 50 65 72 66 6f |-optimiz|e.XPerfo|
|00000cf0| 72 6d 20 6f 70 74 69 6d | 69 7a 61 74 69 6f 6e 20 |rm optim|ization |
|00000d00| 6f 66 20 65 6e 74 72 6f | 70 79 20 65 6e 63 6f 64 |of entro|py encod|
|00000d10| 69 6e 67 20 70 61 72 61 | 6d 65 74 65 72 73 2e 20 |ing para|meters. |
|00000d20| 20 57 69 74 68 6f 75 74 | 20 74 68 69 73 2c 20 64 | Without| this, d|
|00000d30| 65 66 61 75 6c 74 0a 58 | 65 6e 63 6f 64 69 6e 67 |efault.X|encoding|
|00000d40| 20 70 61 72 61 6d 65 74 | 65 72 73 20 61 72 65 20 | paramet|ers are |
|00000d50| 75 73 65 64 2e 0a 58 2e | 42 20 5c 2d 6f 70 74 69 |used..X.|B \-opti|
|00000d60| 6d 69 7a 65 0a 58 75 73 | 75 61 6c 6c 79 20 6d 61 |mize.Xus|ually ma|
|00000d70| 6b 65 73 20 74 68 65 20 | 4a 50 45 47 20 66 69 6c |kes the |JPEG fil|
|00000d80| 65 20 61 20 6c 69 74 74 | 6c 65 20 73 6d 61 6c 6c |e a litt|le small|
|00000d90| 65 72 2c 20 62 75 74 0a | 58 2e 42 20 63 6a 70 65 |er, but.|X.B cjpe|
|00000da0| 67 0a 58 72 75 6e 73 20 | 73 6f 6d 65 77 68 61 74 |g.Xruns |somewhat|
|00000db0| 20 73 6c 6f 77 65 72 20 | 61 6e 64 20 6e 65 65 64 | slower |and need|
|00000dc0| 73 20 6d 75 63 68 20 6d | 6f 72 65 20 6d 65 6d 6f |s much m|ore memo|
|00000dd0| 72 79 2e 20 20 49 6d 61 | 67 65 20 71 75 61 6c 69 |ry. Ima|ge quali|
|00000de0| 74 79 20 61 6e 64 20 73 | 70 65 65 64 20 6f 66 0a |ty and s|peed of.|
|00000df0| 58 64 65 63 6f 6d 70 72 | 65 73 73 69 6f 6e 20 61 |Xdecompr|ession a|
|00000e00| 72 65 20 75 6e 61 66 66 | 65 63 74 65 64 20 62 79 |re unaff|ected by|
|00000e10| 0a 58 2e 42 52 20 5c 2d | 6f 70 74 69 6d 69 7a 65 |.X.BR \-|optimize|
|00000e20| 20 2e 0a 58 2e 54 50 0a | 58 2e 42 20 5c 2d 74 61 | ..X.TP.|X.B \-ta|
|00000e30| 72 67 61 0a 58 49 6e 70 | 75 74 20 66 69 6c 65 20 |rga.XInp|ut file |
|00000e40| 69 73 20 54 61 72 67 61 | 20 66 6f 72 6d 61 74 2e |is Targa| format.|
|00000e50| 20 20 54 61 72 67 61 20 | 66 69 6c 65 73 20 74 68 | Targa |files th|
|00000e60| 61 74 20 63 6f 6e 74 61 | 69 6e 20 61 6e 20 22 69 |at conta|in an "i|
|00000e70| 64 65 6e 74 69 66 69 63 | 61 74 69 6f 6e 22 0a 58 |dentific|ation".X|
|00000e80| 66 69 65 6c 64 20 77 69 | 6c 6c 20 6e 6f 74 20 62 |field wi|ll not b|
|00000e90| 65 20 61 75 74 6f 6d 61 | 74 69 63 61 6c 6c 79 20 |e automa|tically |
|00000ea0| 72 65 63 6f 67 6e 69 7a | 65 64 20 62 79 0a 58 2e |recogniz|ed by.X.|
|00000eb0| 42 52 20 63 6a 70 65 67 | 20 3b 0a 58 66 6f 72 20 |BR cjpeg| ;.Xfor |
|00000ec0| 73 75 63 68 20 66 69 6c | 65 73 20 79 6f 75 20 6d |such fil|es you m|
|00000ed0| 75 73 74 20 73 70 65 63 | 69 66 79 0a 58 2e 42 20 |ust spec|ify.X.B |
|00000ee0| 5c 2d 74 61 72 67 61 0a | 58 74 6f 20 6d 61 6b 65 |\-targa.|Xto make|
|00000ef0| 0a 58 2e 42 20 63 6a 70 | 65 67 0a 58 74 72 65 61 |.X.B cjp|eg.Xtrea|
|00000f00| 74 20 74 68 65 20 69 6e | 70 75 74 20 61 73 20 54 |t the in|put as T|
|00000f10| 61 72 67 61 20 66 6f 72 | 6d 61 74 2e 0a 58 2e 50 |arga for|mat..X.P|
|00000f20| 50 0a 58 54 68 65 0a 58 | 2e 42 20 5c 2d 71 75 61 |P.XThe.X|.B \-qua|
|00000f30| 6c 69 74 79 0a 58 73 77 | 69 74 63 68 20 6c 65 74 |lity.Xsw|itch let|
|00000f40| 73 20 79 6f 75 20 74 72 | 61 64 65 20 6f 66 66 20 |s you tr|ade off |
|00000f50| 63 6f 6d 70 72 65 73 73 | 65 64 20 66 69 6c 65 20 |compress|ed file |
|00000f60| 73 69 7a 65 20 61 67 61 | 69 6e 73 74 20 71 75 61 |size aga|inst qua|
|00000f70| 6c 69 74 79 20 6f 66 20 | 74 68 65 0a 58 72 65 63 |lity of |the.Xrec|
|00000f80| 6f 6e 73 74 72 75 63 74 | 65 64 20 69 6d 61 67 65 |onstruct|ed image|
|00000f90| 3a 20 74 68 65 20 68 69 | 67 68 65 72 20 74 68 65 |: the hi|gher the|
|00000fa0| 20 71 75 61 6c 69 74 79 | 20 73 65 74 74 69 6e 67 | quality| setting|
|00000fb0| 2c 20 74 68 65 20 6c 61 | 72 67 65 72 20 74 68 65 |, the la|rger the|
|00000fc0| 20 4a 50 45 47 20 66 69 | 6c 65 2c 0a 58 61 6e 64 | JPEG fi|le,.Xand|
|00000fd0| 20 74 68 65 20 63 6c 6f | 73 65 72 20 74 68 65 20 | the clo|ser the |
|00000fe0| 6f 75 74 70 75 74 20 69 | 6d 61 67 65 20 77 69 6c |output i|mage wil|
|00000ff0| 6c 20 62 65 20 74 6f 20 | 74 68 65 20 6f 72 69 67 |l be to |the orig|
|00001000| 69 6e 61 6c 20 69 6e 70 | 75 74 2e 20 20 4e 6f 72 |inal inp|ut. Nor|
|00001010| 6d 61 6c 6c 79 20 79 6f | 75 0a 58 77 61 6e 74 20 |mally yo|u.Xwant |
|00001020| 74 6f 20 75 73 65 20 74 | 68 65 20 6c 6f 77 65 73 |to use t|he lowes|
|00001030| 74 20 71 75 61 6c 69 74 | 79 20 73 65 74 74 69 6e |t qualit|y settin|
|00001040| 67 20 28 73 6d 61 6c 6c | 65 73 74 20 66 69 6c 65 |g (small|est file|
|00001050| 29 20 74 68 61 74 20 64 | 65 63 6f 6d 70 72 65 73 |) that d|ecompres|
|00001060| 73 65 73 20 69 6e 74 6f | 0a 58 73 6f 6d 65 74 68 |ses into|.Xsometh|
|00001070| 69 6e 67 20 76 69 73 75 | 61 6c 6c 79 20 69 6e 64 |ing visu|ally ind|
|00001080| 69 73 74 69 6e 67 75 69 | 73 68 61 62 6c 65 20 66 |istingui|shable f|
|00001090| 72 6f 6d 20 74 68 65 20 | 6f 72 69 67 69 6e 61 6c |rom the |original|
|000010a0| 20 69 6d 61 67 65 2e 20 | 20 46 6f 72 20 74 68 69 | image. | For thi|
|000010b0| 73 0a 58 70 75 72 70 6f | 73 65 20 74 68 65 20 71 |s.Xpurpo|se the q|
|000010c0| 75 61 6c 69 74 79 20 73 | 65 74 74 69 6e 67 20 73 |uality s|etting s|
|000010d0| 68 6f 75 6c 64 20 62 65 | 20 62 65 74 77 65 65 6e |hould be| between|
|000010e0| 20 35 30 20 61 6e 64 20 | 39 35 3b 20 74 68 65 20 | 50 and |95; the |
|000010f0| 64 65 66 61 75 6c 74 20 | 6f 66 20 37 35 20 69 73 |default |of 75 is|
|00001100| 0a 58 6f 66 74 65 6e 20 | 61 62 6f 75 74 20 72 69 |.Xoften |about ri|
|00001110| 67 68 74 2e 20 20 49 66 | 20 79 6f 75 20 73 65 65 |ght. If| you see|
|00001120| 20 64 65 66 65 63 74 73 | 20 61 74 0a 58 2e 42 20 | defects| at.X.B |
|00001130| 5c 2d 71 75 61 6c 69 74 | 79 0a 58 37 35 2c 20 74 |\-qualit|y.X75, t|
|00001140| 68 65 6e 20 67 6f 20 75 | 70 20 35 20 6f 72 20 31 |hen go u|p 5 or 1|
|00001150| 30 20 63 6f 75 6e 74 73 | 20 61 74 20 61 20 74 69 |0 counts| at a ti|
|00001160| 6d 65 20 75 6e 74 69 6c | 20 79 6f 75 20 61 72 65 |me until| you are|
|00001170| 20 68 61 70 70 79 20 77 | 69 74 68 20 74 68 65 20 | happy w|ith the |
|00001180| 6f 75 74 70 75 74 0a 58 | 69 6d 61 67 65 2e 20 20 |output.X|image. |
|00001190| 28 54 68 65 20 6f 70 74 | 69 6d 61 6c 20 73 65 74 |(The opt|imal set|
|000011a0| 74 69 6e 67 20 77 69 6c | 6c 20 76 61 72 79 20 66 |ting wil|l vary f|
|000011b0| 72 6f 6d 20 6f 6e 65 20 | 69 6d 61 67 65 20 74 6f |rom one |image to|
|000011c0| 20 61 6e 6f 74 68 65 72 | 2e 29 0a 58 2e 50 50 0a | another|.).X.PP.|
|000011d0| 58 2e 42 20 5c 2d 71 75 | 61 6c 69 74 79 0a 58 31 |X.B \-qu|ality.X1|
|000011e0| 30 30 20 77 69 6c 6c 20 | 67 65 6e 65 72 61 74 65 |00 will |generate|
|000011f0| 20 61 20 71 75 61 6e 74 | 69 7a 61 74 69 6f 6e 20 | a quant|ization |
|00001200| 74 61 62 6c 65 20 6f 66 | 20 61 6c 6c 20 31 27 73 |table of| all 1's|
|00001210| 2c 20 65 6c 69 6d 69 6e | 61 74 69 6e 67 20 6c 6f |, elimin|ating lo|
|00001220| 73 73 20 69 6e 20 74 68 | 65 0a 58 71 75 61 6e 74 |ss in th|e.Xquant|
|00001230| 69 7a 61 74 69 6f 6e 20 | 73 74 65 70 20 28 62 75 |ization |step (bu|
|00001240| 74 20 74 68 65 72 65 20 | 69 73 20 73 74 69 6c 6c |t there |is still|
|00001250| 20 69 6e 66 6f 72 6d 61 | 74 69 6f 6e 20 6c 6f 73 | informa|tion los|
|00001260| 73 20 69 6e 20 73 75 62 | 73 61 6d 70 6c 69 6e 67 |s in sub|sampling|
|00001270| 2c 20 61 73 20 77 65 6c | 6c 0a 58 61 73 20 72 6f |, as wel|l.Xas ro|
|00001280| 75 6e 64 6f 66 66 20 65 | 72 72 6f 72 29 2e 20 20 |undoff e|rror). |
|00001290| 54 68 69 73 20 73 65 74 | 74 69 6e 67 20 69 73 20 |This set|ting is |
|000012a0| 6d 61 69 6e 6c 79 20 6f | 66 20 69 6e 74 65 72 65 |mainly o|f intere|
|000012b0| 73 74 20 66 6f 72 20 65 | 78 70 65 72 69 6d 65 6e |st for e|xperimen|
|000012c0| 74 61 6c 0a 58 70 75 72 | 70 6f 73 65 73 2e 20 20 |tal.Xpur|poses. |
|000012d0| 51 75 61 6c 69 74 79 20 | 76 61 6c 75 65 73 20 61 |Quality |values a|
|000012e0| 62 6f 76 65 20 61 62 6f | 75 74 20 39 35 20 61 72 |bove abo|ut 95 ar|
|000012f0| 65 0a 58 2e 42 20 6e 6f | 74 0a 58 72 65 63 6f 6d |e.X.B no|t.Xrecom|
|00001300| 6d 65 6e 64 65 64 20 66 | 6f 72 20 6e 6f 72 6d 61 |mended f|or norma|
|00001310| 6c 20 75 73 65 3b 20 74 | 68 65 20 63 6f 6d 70 72 |l use; t|he compr|
|00001320| 65 73 73 65 64 20 66 69 | 6c 65 20 73 69 7a 65 20 |essed fi|le size |
|00001330| 67 6f 65 73 20 75 70 20 | 64 72 61 6d 61 74 69 63 |goes up |dramatic|
|00001340| 61 6c 6c 79 20 66 6f 72 | 0a 58 68 61 72 64 6c 79 |ally for|.Xhardly|
|00001350| 20 61 6e 79 20 67 61 69 | 6e 20 69 6e 20 6f 75 74 | any gai|n in out|
|00001360| 70 75 74 20 69 6d 61 67 | 65 20 71 75 61 6c 69 74 |put imag|e qualit|
|00001370| 79 2e 0a 58 2e 50 50 0a | 58 49 6e 20 74 68 65 20 |y..X.PP.|XIn the |
|00001380| 6f 74 68 65 72 20 64 69 | 72 65 63 74 69 6f 6e 2c |other di|rection,|
|00001390| 20 71 75 61 6c 69 74 79 | 20 76 61 6c 75 65 73 20 | quality| values |
|000013a0| 62 65 6c 6f 77 20 35 30 | 20 77 69 6c 6c 20 70 72 |below 50| will pr|
|000013b0| 6f 64 75 63 65 20 76 65 | 72 79 20 73 6d 61 6c 6c |oduce ve|ry small|
|000013c0| 20 66 69 6c 65 73 0a 58 | 6f 66 20 6c 6f 77 20 69 | files.X|of low i|
|000013d0| 6d 61 67 65 20 71 75 61 | 6c 69 74 79 2e 20 20 53 |mage qua|lity. S|
|000013e0| 65 74 74 69 6e 67 73 20 | 61 72 6f 75 6e 64 20 35 |ettings |around 5|
|000013f0| 20 74 6f 20 31 30 20 6d | 69 67 68 74 20 62 65 20 | to 10 m|ight be |
|00001400| 75 73 65 66 75 6c 20 69 | 6e 20 70 72 65 70 61 72 |useful i|n prepar|
|00001410| 69 6e 67 20 61 6e 0a 58 | 69 6e 64 65 78 20 6f 66 |ing an.X|index of|
|00001420| 20 61 20 6c 61 72 67 65 | 20 69 6d 61 67 65 20 6c | a large| image l|
|00001430| 69 62 72 61 72 79 2c 20 | 66 6f 72 20 65 78 61 6d |ibrary, |for exam|
|00001440| 70 6c 65 2e 20 20 54 72 | 79 0a 58 2e 42 20 5c 2d |ple. Tr|y.X.B \-|
|00001450| 71 75 61 6c 69 74 79 0a | 58 32 20 28 6f 72 20 73 |quality.|X2 (or s|
|00001460| 6f 29 20 66 6f 72 20 73 | 6f 6d 65 20 61 6d 75 73 |o) for s|ome amus|
|00001470| 69 6e 67 20 43 75 62 69 | 73 74 20 65 66 66 65 63 |ing Cubi|st effec|
|00001480| 74 73 2e 20 20 28 4e 6f | 74 65 3a 20 71 75 61 6c |ts. (No|te: qual|
|00001490| 69 74 79 0a 58 76 61 6c | 75 65 73 20 62 65 6c 6f |ity.Xval|ues belo|
|000014a0| 77 20 61 62 6f 75 74 20 | 32 35 20 67 65 6e 65 72 |w about |25 gener|
|000014b0| 61 74 65 20 32 2d 62 79 | 74 65 20 71 75 61 6e 74 |ate 2-by|te quant|
|000014c0| 69 7a 61 74 69 6f 6e 20 | 74 61 62 6c 65 73 2c 20 |ization |tables, |
|000014d0| 77 68 69 63 68 20 61 72 | 65 0a 58 63 6f 6e 73 69 |which ar|e.Xconsi|
|000014e0| 64 65 72 65 64 20 6f 70 | 74 69 6f 6e 61 6c 20 69 |dered op|tional i|
|000014f0| 6e 20 74 68 65 20 4a 50 | 45 47 20 73 74 61 6e 64 |n the JP|EG stand|
|00001500| 61 72 64 2e 0a 58 2e 42 | 20 63 6a 70 65 67 0a 58 |ard..X.B| cjpeg.X|
|00001510| 65 6d 69 74 73 20 61 20 | 77 61 72 6e 69 6e 67 20 |emits a |warning |
|00001520| 6d 65 73 73 61 67 65 20 | 77 68 65 6e 20 79 6f 75 |message |when you|
|00001530| 20 67 69 76 65 20 73 75 | 63 68 20 61 20 71 75 61 | give su|ch a qua|
|00001540| 6c 69 74 79 20 76 61 6c | 75 65 2c 20 62 65 63 61 |lity val|ue, beca|
|00001550| 75 73 65 20 73 6f 6d 65 | 0a 58 63 6f 6d 6d 65 72 |use some|.Xcommer|
|00001560| 63 69 61 6c 20 4a 50 45 | 47 20 70 72 6f 67 72 61 |cial JPE|G progra|
|00001570| 6d 73 20 6d 61 79 20 62 | 65 20 75 6e 61 62 6c 65 |ms may b|e unable|
|00001580| 20 74 6f 20 64 65 63 6f | 64 65 20 74 68 65 20 72 | to deco|de the r|
|00001590| 65 73 75 6c 74 69 6e 67 | 20 66 69 6c 65 2e 29 0a |esulting| file.).|
|000015a0| 58 2e 50 50 0a 58 53 77 | 69 74 63 68 65 73 20 66 |X.PP.XSw|itches f|
|000015b0| 6f 72 20 61 64 76 61 6e | 63 65 64 20 75 73 65 72 |or advan|ced user|
|000015c0| 73 3a 0a 58 2e 54 50 0a | 58 2e 42 49 20 5c 2d 6d |s:.X.TP.|X.BI \-m|
|000015d0| 61 78 6d 65 6d 6f 72 79 | 20 22 20 4e 22 0a 58 53 |axmemory| " N".XS|
|000015e0| 65 74 20 6c 69 6d 69 74 | 20 66 6f 72 20 61 6d 6f |et limit| for amo|
|000015f0| 75 6e 74 20 6f 66 20 6d | 65 6d 6f 72 79 20 74 6f |unt of m|emory to|
|00001600| 20 75 73 65 20 69 6e 20 | 70 72 6f 63 65 73 73 69 | use in |processi|
|00001610| 6e 67 20 6c 61 72 67 65 | 20 69 6d 61 67 65 73 2e |ng large| images.|
|00001620| 20 20 56 61 6c 75 65 20 | 69 73 0a 58 69 6e 20 74 | Value |is.Xin t|
|00001630| 68 6f 75 73 61 6e 64 73 | 20 6f 66 20 62 79 74 65 |housands| of byte|
|00001640| 73 2c 20 6f 72 20 6d 69 | 6c 6c 69 6f 6e 73 20 6f |s, or mi|llions o|
|00001650| 66 20 62 79 74 65 73 20 | 69 66 20 22 4d 22 20 69 |f bytes |if "M" i|
|00001660| 73 20 61 74 74 61 63 68 | 65 64 20 74 6f 20 74 68 |s attach|ed to th|
|00001670| 65 0a 58 6e 75 6d 62 65 | 72 2e 20 20 46 6f 72 20 |e.Xnumbe|r. For |
|00001680| 65 78 61 6d 70 6c 65 2c | 0a 58 2e 42 20 5c 2d 6d |example,|.X.B \-m|
|00001690| 61 78 20 34 6d 0a 58 73 | 65 6c 65 63 74 73 20 34 |ax 4m.Xs|elects 4|
|000016a0| 30 30 30 30 30 30 20 62 | 79 74 65 73 2e 20 20 49 |000000 b|ytes. I|
|000016b0| 66 20 6d 6f 72 65 20 73 | 70 61 63 65 20 69 73 20 |f more s|pace is |
|000016c0| 6e 65 65 64 65 64 2c 20 | 74 65 6d 70 6f 72 61 72 |needed, |temporar|
|000016d0| 79 20 66 69 6c 65 73 20 | 77 69 6c 6c 20 62 65 20 |y files |will be |
|000016e0| 75 73 65 64 2e 0a 58 2e | 54 50 0a 58 2e 42 49 20 |used..X.|TP.X.BI |
|000016f0| 5c 2d 72 65 73 74 61 72 | 74 20 22 20 4e 22 0a 58 |\-restar|t " N".X|
|00001700| 45 6d 69 74 20 61 20 4a | 50 45 47 20 72 65 73 74 |Emit a J|PEG rest|
|00001710| 61 72 74 20 6d 61 72 6b | 65 72 20 65 76 65 72 79 |art mark|er every|
|00001720| 20 4e 20 4d 43 55 20 72 | 6f 77 73 2c 20 6f 72 20 | N MCU r|ows, or |
|00001730| 65 76 65 72 79 20 4e 20 | 4d 43 55 20 62 6c 6f 63 |every N |MCU bloc|
|00001740| 6b 73 20 69 66 20 22 42 | 22 20 69 73 0a 58 61 74 |ks if "B|" is.Xat|
|00001750| 74 61 63 68 65 64 20 74 | 6f 20 74 68 65 20 6e 75 |tached t|o the nu|
|00001760| 6d 62 65 72 2e 0a 58 2e | 42 20 5c 2d 72 65 73 74 |mber..X.|B \-rest|
|00001770| 61 72 74 20 30 0a 58 28 | 74 68 65 20 64 65 66 61 |art 0.X(|the defa|
|00001780| 75 6c 74 29 20 6d 65 61 | 6e 73 20 6e 6f 20 72 65 |ult) mea|ns no re|
|00001790| 73 74 61 72 74 20 6d 61 | 72 6b 65 72 73 2e 0a 58 |start ma|rkers..X|
|000017a0| 2e 54 50 0a 58 2e 42 49 | 20 5c 2d 73 6d 6f 6f 74 |.TP.X.BI| \-smoot|
|000017b0| 68 20 22 20 4e 22 0a 58 | 53 6d 6f 6f 74 68 20 74 |h " N".X|Smooth t|
|000017c0| 68 65 20 69 6e 70 75 74 | 20 69 6d 61 67 65 20 74 |he input| image t|
|000017d0| 6f 20 65 6c 69 6d 69 6e | 61 74 65 20 64 69 74 68 |o elimin|ate dith|
|000017e0| 65 72 69 6e 67 20 6e 6f | 69 73 65 2e 20 20 4e 2c |ering no|ise. N,|
|000017f0| 20 72 61 6e 67 69 6e 67 | 20 66 72 6f 6d 20 31 20 | ranging| from 1 |
|00001800| 74 6f 0a 58 31 30 30 2c | 20 69 6e 64 69 63 61 74 |to.X100,| indicat|
|00001810| 65 73 20 74 68 65 20 73 | 74 72 65 6e 67 74 68 20 |es the s|trength |
|00001820| 6f 66 20 73 6d 6f 6f 74 | 68 69 6e 67 2e 20 20 30 |of smoot|hing. 0|
|00001830| 20 28 74 68 65 20 64 65 | 66 61 75 6c 74 29 20 6d | (the de|fault) m|
|00001840| 65 61 6e 73 20 6e 6f 20 | 73 6d 6f 6f 74 68 69 6e |eans no |smoothin|
|00001850| 67 2e 0a 58 2e 54 50 0a | 58 2e 42 20 5c 2d 76 65 |g..X.TP.|X.B \-ve|
|00001860| 72 62 6f 73 65 0a 58 45 | 6e 61 62 6c 65 20 64 65 |rbose.XE|nable de|
|00001870| 62 75 67 20 70 72 69 6e | 74 6f 75 74 2e 20 20 4d |bug prin|tout. M|
|00001880| 6f 72 65 0a 58 2e 42 52 | 20 5c 2d 76 20 27 73 0a |ore.X.BR| \-v 's.|
|00001890| 58 67 69 76 65 20 6d 6f | 72 65 20 6f 75 74 70 75 |Xgive mo|re outpu|
|000018a0| 74 2e 20 20 41 6c 73 6f | 2c 20 76 65 72 73 69 6f |t. Also|, versio|
|000018b0| 6e 20 69 6e 66 6f 72 6d | 61 74 69 6f 6e 20 69 73 |n inform|ation is|
|000018c0| 20 70 72 69 6e 74 65 64 | 20 61 74 20 73 74 61 72 | printed| at star|
|000018d0| 74 75 70 2e 0a 58 2e 54 | 50 0a 58 2e 42 20 5c 2d |tup..X.T|P.X.B \-|
|000018e0| 64 65 62 75 67 0a 58 53 | 61 6d 65 20 61 73 0a 58 |debug.XS|ame as.X|
|000018f0| 2e 42 52 20 5c 2d 76 65 | 72 62 6f 73 65 20 2e 0a |.BR \-ve|rbose ..|
|00001900| 58 2e 50 50 0a 58 54 68 | 65 0a 58 2e 42 20 5c 2d |X.PP.XTh|e.X.B \-|
|00001910| 72 65 73 74 61 72 74 0a | 58 6f 70 74 69 6f 6e 20 |restart.|Xoption |
|00001920| 69 6e 73 65 72 74 73 20 | 65 78 74 72 61 20 6d 61 |inserts |extra ma|
|00001930| 72 6b 65 72 73 20 74 68 | 61 74 20 61 6c 6c 6f 77 |rkers th|at allow|
|00001940| 20 61 20 4a 50 45 47 20 | 64 65 63 6f 64 65 72 20 | a JPEG |decoder |
|00001950| 74 6f 20 72 65 73 79 6e | 63 68 72 6f 6e 69 7a 65 |to resyn|chronize|
|00001960| 20 61 66 74 65 72 0a 58 | 61 20 74 72 61 6e 73 6d | after.X|a transm|
|00001970| 69 73 73 69 6f 6e 20 65 | 72 72 6f 72 2e 20 20 57 |ission e|rror. W|
|00001980| 69 74 68 6f 75 74 20 72 | 65 73 74 61 72 74 20 6d |ithout r|estart m|
|00001990| 61 72 6b 65 72 73 2c 20 | 61 6e 79 20 64 61 6d 61 |arkers, |any dama|
|000019a0| 67 65 20 74 6f 20 61 20 | 63 6f 6d 70 72 65 73 73 |ge to a |compress|
|000019b0| 65 64 0a 58 66 69 6c 65 | 20 77 69 6c 6c 20 75 73 |ed.Xfile| will us|
|000019c0| 75 61 6c 6c 79 20 72 75 | 69 6e 20 74 68 65 20 69 |ually ru|in the i|
|000019d0| 6d 61 67 65 20 66 72 6f | 6d 20 74 68 65 20 70 6f |mage fro|m the po|
|000019e0| 69 6e 74 20 6f 66 20 74 | 68 65 20 65 72 72 6f 72 |int of t|he error|
|000019f0| 20 74 6f 20 74 68 65 20 | 65 6e 64 20 6f 66 20 74 | to the |end of t|
|00001a00| 68 65 0a 58 69 6d 61 67 | 65 3b 20 77 69 74 68 20 |he.Ximag|e; with |
|00001a10| 72 65 73 74 61 72 74 20 | 6d 61 72 6b 65 72 73 2c |restart |markers,|
|00001a20| 20 74 68 65 20 64 61 6d | 61 67 65 20 69 73 20 75 | the dam|age is u|
|00001a30| 73 75 61 6c 6c 79 20 63 | 6f 6e 66 69 6e 65 64 20 |sually c|onfined |
|00001a40| 74 6f 20 74 68 65 20 70 | 6f 72 74 69 6f 6e 20 6f |to the p|ortion o|
|00001a50| 66 0a 58 74 68 65 20 69 | 6d 61 67 65 20 75 70 20 |f.Xthe i|mage up |
|00001a60| 74 6f 20 74 68 65 20 6e | 65 78 74 20 72 65 73 74 |to the n|ext rest|
|00001a70| 61 72 74 20 6d 61 72 6b | 65 72 2e 20 20 4f 66 20 |art mark|er. Of |
|00001a80| 63 6f 75 72 73 65 2c 20 | 74 68 65 20 72 65 73 74 |course, |the rest|
|00001a90| 61 72 74 20 6d 61 72 6b | 65 72 73 0a 58 6f 63 63 |art mark|ers.Xocc|
|00001aa0| 75 70 79 20 65 78 74 72 | 61 20 73 70 61 63 65 2e |upy extr|a space.|
|00001ab0| 20 20 57 65 20 72 65 63 | 6f 6d 6d 65 6e 64 0a 58 | We rec|ommend.X|
|00001ac0| 2e 42 20 5c 2d 72 65 73 | 74 61 72 74 20 31 0a 58 |.B \-res|tart 1.X|
|00001ad0| 66 6f 72 20 69 6d 61 67 | 65 73 20 74 68 61 74 20 |for imag|es that |
|00001ae0| 77 69 6c 6c 20 62 65 20 | 74 72 61 6e 73 6d 69 74 |will be |transmit|
|00001af0| 74 65 64 20 61 63 72 6f | 73 73 20 75 6e 72 65 6c |ted acro|ss unrel|
|00001b00| 69 61 62 6c 65 20 6e 65 | 74 77 6f 72 6b 73 20 73 |iable ne|tworks s|
|00001b10| 75 63 68 20 61 73 20 55 | 73 65 6e 65 74 2e 0a 58 |uch as U|senet..X|
|00001b20| 2e 50 50 0a 58 54 68 65 | 0a 58 2e 42 20 5c 2d 73 |.PP.XThe|.X.B \-s|
|00001b30| 6d 6f 6f 74 68 0a 58 6f | 70 74 69 6f 6e 20 66 69 |mooth.Xo|ption fi|
|00001b40| 6c 74 65 72 73 20 74 68 | 65 20 69 6e 70 75 74 20 |lters th|e input |
|00001b50| 74 6f 20 65 6c 69 6d 69 | 6e 61 74 65 20 66 69 6e |to elimi|nate fin|
|00001b60| 65 2d 73 63 61 6c 65 20 | 6e 6f 69 73 65 2e 20 20 |e-scale |noise. |
|00001b70| 54 68 69 73 20 69 73 20 | 6f 66 74 65 6e 20 75 73 |This is |often us|
|00001b80| 65 66 75 6c 0a 58 77 68 | 65 6e 20 63 6f 6e 76 65 |eful.Xwh|en conve|
|00001b90| 72 74 69 6e 67 20 47 49 | 46 20 66 69 6c 65 73 20 |rting GI|F files |
|00001ba0| 74 6f 20 4a 50 45 47 3a | 20 61 20 6d 6f 64 65 72 |to JPEG:| a moder|
|00001bb0| 61 74 65 20 73 6d 6f 6f | 74 68 69 6e 67 20 66 61 |ate smoo|thing fa|
|00001bc0| 63 74 6f 72 20 6f 66 20 | 31 30 20 74 6f 20 35 30 |ctor of |10 to 50|
|00001bd0| 0a 58 67 65 74 73 20 72 | 69 64 20 6f 66 20 64 69 |.Xgets r|id of di|
|00001be0| 74 68 65 72 69 6e 67 20 | 70 61 74 74 65 72 6e 73 |thering |patterns|
|00001bf0| 20 69 6e 20 74 68 65 20 | 69 6e 70 75 74 20 66 69 | in the |input fi|
|00001c00| 6c 65 2c 20 72 65 73 75 | 6c 74 69 6e 67 20 69 6e |le, resu|lting in|
|00001c10| 20 61 20 73 6d 61 6c 6c | 65 72 20 4a 50 45 47 0a | a small|er JPEG.|
|00001c20| 58 66 69 6c 65 20 61 6e | 64 20 61 20 62 65 74 74 |Xfile an|d a bett|
|00001c30| 65 72 2d 6c 6f 6f 6b 69 | 6e 67 20 69 6d 61 67 65 |er-looki|ng image|
|00001c40| 2e 20 20 54 6f 6f 20 6c | 61 72 67 65 20 61 20 73 |. Too l|arge a s|
|00001c50| 6d 6f 6f 74 68 69 6e 67 | 20 66 61 63 74 6f 72 20 |moothing| factor |
|00001c60| 77 69 6c 6c 20 76 69 73 | 69 62 6c 79 0a 58 62 6c |will vis|ibly.Xbl|
|00001c70| 75 72 20 74 68 65 20 69 | 6d 61 67 65 2c 20 68 6f |ur the i|mage, ho|
|00001c80| 77 65 76 65 72 2e 0a 58 | 2e 50 50 0a 58 53 77 69 |wever..X|.PP.XSwi|
|00001c90| 74 63 68 65 73 20 66 6f | 72 20 77 69 7a 61 72 64 |tches fo|r wizard|
|00001ca0| 73 3a 0a 58 2e 54 50 0a | 58 2e 42 20 5c 2d 61 72 |s:.X.TP.|X.B \-ar|
|00001cb0| 69 74 68 6d 65 74 69 63 | 0a 58 55 73 65 20 61 72 |ithmetic|.XUse ar|
|00001cc0| 69 74 68 6d 65 74 69 63 | 20 63 6f 64 69 6e 67 20 |ithmetic| coding |
|00001cd0| 72 61 74 68 65 72 20 74 | 68 61 6e 20 48 75 66 66 |rather t|han Huff|
|00001ce0| 6d 61 6e 20 63 6f 64 69 | 6e 67 2e 20 20 28 4e 6f |man codi|ng. (No|
|00001cf0| 74 20 63 75 72 72 65 6e | 74 6c 79 0a 58 73 75 70 |t curren|tly.Xsup|
|00001d00| 70 6f 72 74 65 64 20 66 | 6f 72 20 6c 65 67 61 6c |ported f|or legal|
|00001d10| 20 72 65 61 73 6f 6e 73 | 2e 29 0a 58 2e 54 50 0a | reasons|.).X.TP.|
|00001d20| 58 2e 42 20 5c 2d 6e 6f | 69 6e 74 65 72 6c 65 61 |X.B \-no|interlea|
|00001d30| 76 65 0a 58 47 65 6e 65 | 72 61 74 65 20 6e 6f 6e |ve.XGene|rate non|
|00001d40| 69 6e 74 65 72 6c 65 61 | 76 65 64 20 4a 50 45 47 |interlea|ved JPEG|
|00001d50| 20 66 69 6c 65 20 28 6e | 6f 74 20 79 65 74 20 73 | file (n|ot yet s|
|00001d60| 75 70 70 6f 72 74 65 64 | 29 2e 0a 58 2e 54 50 0a |upported|)..X.TP.|
|00001d70| 58 2e 42 49 20 5c 2d 71 | 74 61 62 6c 65 73 20 22 |X.BI \-q|tables "|
|00001d80| 20 66 69 6c 65 22 0a 58 | 55 73 65 20 74 68 65 20 | file".X|Use the |
|00001d90| 71 75 61 6e 74 69 7a 61 | 74 69 6f 6e 20 74 61 62 |quantiza|tion tab|
|00001da0| 6c 65 73 20 67 69 76 65 | 6e 20 69 6e 20 74 68 65 |les give|n in the|
|00001db0| 20 73 70 65 63 69 66 69 | 65 64 20 66 69 6c 65 2e | specifi|ed file.|
|00001dc0| 20 20 54 68 65 20 66 69 | 6c 65 20 73 68 6f 75 6c | The fi|le shoul|
|00001dd0| 64 0a 58 63 6f 6e 74 61 | 69 6e 20 6f 6e 65 20 74 |d.Xconta|in one t|
|00001de0| 6f 20 66 6f 75 72 20 74 | 61 62 6c 65 73 20 28 36 |o four t|ables (6|
|00001df0| 34 20 76 61 6c 75 65 73 | 20 65 61 63 68 29 20 61 |4 values| each) a|
|00001e00| 73 20 70 6c 61 69 6e 20 | 74 65 78 74 2e 20 20 43 |s plain |text. C|
|00001e10| 6f 6d 6d 65 6e 74 73 20 | 70 72 65 63 65 64 65 64 |omments |preceded|
|00001e20| 0a 58 62 79 20 27 23 27 | 20 6d 61 79 20 62 65 20 |.Xby '#'| may be |
|00001e30| 69 6e 63 6c 75 64 65 64 | 20 69 6e 20 74 68 65 20 |included| in the |
|00001e40| 66 69 6c 65 2e 20 20 54 | 68 65 20 74 61 62 6c 65 |file. T|he table|
|00001e50| 73 20 61 72 65 20 69 6d | 70 6c 69 63 69 74 6c 79 |s are im|plicitly|
|00001e60| 20 6e 75 6d 62 65 72 65 | 64 0a 58 30 2c 31 2c 65 | numbere|d.X0,1,e|
|00001e70| 74 63 2e 20 20 49 66 0a | 58 2e 42 20 5c 2d 71 75 |tc. If.|X.B \-qu|
|00001e80| 61 6c 69 74 79 0a 58 4e | 20 69 73 20 61 6c 73 6f |ality.XN| is also|
|00001e90| 20 73 70 65 63 69 66 69 | 65 64 2c 20 74 68 65 20 | specifi|ed, the |
|00001ea0| 76 61 6c 75 65 73 20 69 | 6e 20 74 68 65 20 66 69 |values i|n the fi|
|00001eb0| 6c 65 20 61 72 65 20 73 | 63 61 6c 65 64 20 61 63 |le are s|caled ac|
|00001ec0| 63 6f 72 64 69 6e 67 20 | 74 6f 0a 58 2e 42 52 20 |cording |to.X.BR |
|00001ed0| 63 6a 70 65 67 20 27 73 | 0a 58 71 75 61 6c 69 74 |cjpeg 's|.Xqualit|
|00001ee0| 79 20 73 63 61 6c 69 6e | 67 20 63 75 72 76 65 2e |y scalin|g curve.|
|00001ef0| 0a 58 2e 54 50 0a 58 2e | 42 49 20 5c 2d 73 61 6d |.X.TP.X.|BI \-sam|
|00001f00| 70 6c 65 20 22 20 48 78 | 56 5b 2c 2e 2e 2e 5d 22 |ple " Hx|V[,...]"|
|00001f10| 0a 58 53 65 74 20 4a 50 | 45 47 20 73 61 6d 70 6c |.XSet JP|EG sampl|
|00001f20| 69 6e 67 20 66 61 63 74 | 6f 72 73 2e 20 20 49 66 |ing fact|ors. If|
|00001f30| 20 79 6f 75 20 73 70 65 | 63 69 66 79 20 66 65 77 | you spe|cify few|
|00001f40| 65 72 20 48 2f 56 20 70 | 61 69 72 73 20 74 68 61 |er H/V p|airs tha|
|00001f50| 6e 20 74 68 65 72 65 20 | 61 72 65 0a 58 63 6f 6d |n there |are.Xcom|
|00001f60| 70 6f 6e 65 6e 74 73 2c | 20 74 68 65 20 72 65 6d |ponents,| the rem|
|00001f70| 61 69 6e 69 6e 67 20 63 | 6f 6d 70 6f 6e 65 6e 74 |aining c|omponent|
|00001f80| 73 20 61 72 65 20 73 65 | 74 20 74 6f 20 31 78 31 |s are se|t to 1x1|
|00001f90| 20 73 61 6d 70 6c 69 6e | 67 2e 20 20 54 68 65 20 | samplin|g. The |
|00001fa0| 64 65 66 61 75 6c 74 0a | 58 73 65 74 74 69 6e 67 |default.|Xsetting|
|00001fb0| 20 69 73 20 65 71 75 69 | 76 61 6c 65 6e 74 20 74 | is equi|valent t|
|00001fc0| 6f 20 5c 66 42 5c 2d 73 | 61 6d 70 6c 65 20 32 78 |o \fB\-s|ample 2x|
|00001fd0| 32 5c 66 52 2e 0a 58 2e | 50 50 0a 58 54 68 65 20 |2\fR..X.|PP.XThe |
|00001fe0| 22 77 69 7a 61 72 64 22 | 20 73 77 69 74 63 68 65 |"wizard"| switche|
|00001ff0| 73 20 61 72 65 20 69 6e | 74 65 6e 64 65 64 20 66 |s are in|tended f|
|00002000| 6f 72 20 65 78 70 65 72 | 69 6d 65 6e 74 61 74 69 |or exper|imentati|
|00002010| 6f 6e 20 77 69 74 68 20 | 4a 50 45 47 2e 20 20 49 |on with |JPEG. I|
|00002020| 66 20 79 6f 75 0a 58 64 | 6f 6e 27 74 20 6b 6e 6f |f you.Xd|on't kno|
|00002030| 77 20 77 68 61 74 20 79 | 6f 75 20 61 72 65 20 64 |w what y|ou are d|
|00002040| 6f 69 6e 67 2c 20 5c 66 | 42 64 6f 6e 27 74 20 75 |oing, \f|Bdon't u|
|00002050| 73 65 20 74 68 65 6d 5c | 66 52 2e 20 20 59 6f 75 |se them\|fR. You|
|00002060| 20 63 61 6e 20 65 61 73 | 69 6c 79 20 70 72 6f 64 | can eas|ily prod|
|00002070| 75 63 65 0a 58 66 69 6c | 65 73 20 77 69 74 68 20 |uce.Xfil|es with |
|00002080| 77 6f 72 73 65 20 69 6d | 61 67 65 20 71 75 61 6c |worse im|age qual|
|00002090| 69 74 79 20 61 6e 64 2f | 6f 72 20 70 6f 6f 72 65 |ity and/|or poore|
|000020a0| 72 20 63 6f 6d 70 72 65 | 73 73 69 6f 6e 20 74 68 |r compre|ssion th|
|000020b0| 61 6e 20 79 6f 75 27 6c | 6c 20 67 65 74 20 66 72 |an you'l|l get fr|
|000020c0| 6f 6d 0a 58 74 68 65 20 | 64 65 66 61 75 6c 74 20 |om.Xthe |default |
|000020d0| 73 65 74 74 69 6e 67 73 | 2e 20 20 46 75 72 74 68 |settings|. Furth|
|000020e0| 65 72 6d 6f 72 65 2c 20 | 74 68 65 73 65 20 73 77 |ermore, |these sw|
|000020f0| 69 74 63 68 65 73 20 73 | 68 6f 75 6c 64 20 6e 6f |itches s|hould no|
|00002100| 74 20 62 65 20 75 73 65 | 64 20 77 68 65 6e 0a 58 |t be use|d when.X|
|00002110| 6d 61 6b 69 6e 67 20 66 | 69 6c 65 73 20 69 6e 74 |making f|iles int|
|00002120| 65 6e 64 65 64 20 66 6f | 72 20 67 65 6e 65 72 61 |ended fo|r genera|
|00002130| 6c 20 75 73 65 2c 20 62 | 65 63 61 75 73 65 20 6e |l use, b|ecause n|
|00002140| 6f 74 20 61 6c 6c 20 4a | 50 45 47 20 69 6d 70 6c |ot all J|PEG impl|
|00002150| 65 6d 65 6e 74 61 74 69 | 6f 6e 73 0a 58 77 69 6c |ementati|ons.Xwil|
|00002160| 6c 20 73 75 70 70 6f 72 | 74 20 75 6e 75 73 75 61 |l suppor|t unusua|
|00002170| 6c 20 4a 50 45 47 20 70 | 61 72 61 6d 65 74 65 72 |l JPEG p|arameter|
|00002180| 20 73 65 74 74 69 6e 67 | 73 2e 0a 58 2e 53 48 20 | setting|s..X.SH |
|00002190| 45 58 41 4d 50 4c 45 53 | 0a 58 2e 4c 50 0a 58 54 |EXAMPLES|.X.LP.XT|
|000021a0| 68 69 73 20 65 78 61 6d | 70 6c 65 20 63 6f 6d 70 |his exam|ple comp|
|000021b0| 72 65 73 73 65 73 20 74 | 68 65 20 50 50 4d 20 66 |resses t|he PPM f|
|000021c0| 69 6c 65 20 66 6f 6f 2e | 70 70 6d 20 77 69 74 68 |ile foo.|ppm with|
|000021d0| 20 61 20 71 75 61 6c 69 | 74 79 20 66 61 63 74 6f | a quali|ty facto|
|000021e0| 72 20 6f 66 0a 58 36 30 | 20 61 6e 64 20 73 61 76 |r of.X60| and sav|
|000021f0| 65 73 20 74 68 65 20 6f | 75 74 70 75 74 20 61 73 |es the o|utput as|
|00002200| 20 66 6f 6f 2e 6a 70 67 | 3a 0a 58 2e 49 50 0a 58 | foo.jpg|:.X.IP.X|
|00002210| 2e 42 20 63 6a 70 65 67 | 20 5c 2d 71 75 61 6c 69 |.B cjpeg| \-quali|
|00002220| 74 79 0a 58 2e 49 20 36 | 30 20 66 6f 6f 2e 70 70 |ty.X.I 6|0 foo.pp|
|00002230| 6d 0a 58 2e 42 20 3e 0a | 58 2e 49 20 66 6f 6f 2e |m.X.B >.|X.I foo.|
|00002240| 6a 70 67 0a 58 2e 53 48 | 20 45 4e 56 49 52 4f 4e |jpg.X.SH| ENVIRON|
|00002250| 4d 45 4e 54 0a 58 2e 54 | 50 0a 58 2e 42 20 4a 50 |MENT.X.T|P.X.B JP|
|00002260| 45 47 4d 45 4d 0a 58 49 | 66 20 74 68 69 73 20 65 |EGMEM.XI|f this e|
|00002270| 6e 76 69 72 6f 6e 6d 65 | 6e 74 20 76 61 72 69 61 |nvironme|nt varia|
|00002280| 62 6c 65 20 69 73 20 73 | 65 74 2c 20 69 74 73 20 |ble is s|et, its |
|00002290| 76 61 6c 75 65 20 69 73 | 20 74 68 65 20 64 65 66 |value is| the def|
|000022a0| 61 75 6c 74 20 6d 65 6d | 6f 72 79 20 6c 69 6d 69 |ault mem|ory limi|
|000022b0| 74 2e 0a 58 54 68 65 20 | 76 61 6c 75 65 20 69 73 |t..XThe |value is|
|000022c0| 20 73 70 65 63 69 66 69 | 65 64 20 61 73 20 64 65 | specifi|ed as de|
|000022d0| 73 63 72 69 62 65 64 20 | 66 6f 72 20 74 68 65 0a |scribed |for the.|
|000022e0| 58 2e 42 20 5c 2d 6d 61 | 78 6d 65 6d 6f 72 79 0a |X.B \-ma|xmemory.|
|000022f0| 58 73 77 69 74 63 68 2e | 0a 58 2e 42 20 4a 50 45 |Xswitch.|.X.B JPE|
|00002300| 47 4d 45 4d 0a 58 6f 76 | 65 72 72 69 64 65 73 20 |GMEM.Xov|errides |
|00002310| 74 68 65 20 64 65 66 61 | 75 6c 74 20 76 61 6c 75 |the defa|ult valu|
|00002320| 65 20 73 70 65 63 69 66 | 69 65 64 20 77 68 65 6e |e specif|ied when|
|00002330| 20 74 68 65 20 70 72 6f | 67 72 61 6d 20 77 61 73 | the pro|gram was|
|00002340| 20 63 6f 6d 70 69 6c 65 | 64 2c 20 61 6e 64 0a 58 | compile|d, and.X|
|00002350| 69 74 73 65 6c 66 20 69 | 73 20 6f 76 65 72 72 69 |itself i|s overri|
|00002360| 64 64 65 6e 20 62 79 20 | 61 6e 20 65 78 70 6c 69 |dden by |an expli|
|00002370| 63 69 74 0a 58 2e 42 52 | 20 5c 2d 6d 61 78 6d 65 |cit.X.BR| \-maxme|
|00002380| 6d 6f 72 79 20 2e 0a 58 | 2e 53 48 20 53 45 45 20 |mory ..X|.SH SEE |
|00002390| 41 4c 53 4f 0a 58 2e 42 | 52 20 64 6a 70 65 67 20 |ALSO.X.B|R djpeg |
|000023a0| 28 31 29 0a 58 2e 62 72 | 0a 58 2e 42 52 20 70 70 |(1).X.br|.X.BR pp|
|000023b0| 6d 20 28 35 29 2c 0a 58 | 2e 42 52 20 70 67 6d 20 |m (5),.X|.BR pgm |
|000023c0| 28 35 29 0a 58 2e 62 72 | 0a 58 57 61 6c 6c 61 63 |(5).X.br|.XWallac|
|000023d0| 65 2c 20 47 72 65 67 6f | 72 79 20 4b 2e 20 20 22 |e, Grego|ry K. "|
|000023e0| 54 68 65 20 4a 50 45 47 | 20 53 74 69 6c 6c 20 50 |The JPEG| Still P|
|000023f0| 69 63 74 75 72 65 20 43 | 6f 6d 70 72 65 73 73 69 |icture C|ompressi|
|00002400| 6f 6e 20 53 74 61 6e 64 | 61 72 64 22 2c 0a 58 43 |on Stand|ard",.XC|
|00002410| 6f 6d 6d 75 6e 69 63 61 | 74 69 6f 6e 73 20 6f 66 |ommunica|tions of|
|00002420| 20 74 68 65 20 41 43 4d | 2c 20 41 70 72 69 6c 20 | the ACM|, April |
|00002430| 31 39 39 31 20 28 76 6f | 6c 2e 20 33 34 2c 20 6e |1991 (vo|l. 34, n|
|00002440| 6f 2e 20 34 29 2c 20 70 | 70 2e 20 33 30 2d 34 34 |o. 4), p|p. 30-44|
|00002450| 2e 0a 58 2e 53 48 20 41 | 55 54 48 4f 52 0a 58 49 |..X.SH A|UTHOR.XI|
|00002460| 6e 64 65 70 65 6e 64 65 | 6e 74 20 4a 50 45 47 20 |ndepende|nt JPEG |
|00002470| 47 72 6f 75 70 0a 58 2e | 53 48 20 42 55 47 53 0a |Group.X.|SH BUGS.|
|00002480| 58 41 72 69 74 68 6d 65 | 74 69 63 20 63 6f 64 69 |XArithme|tic codi|
|00002490| 6e 67 20 61 6e 64 20 69 | 6e 74 65 72 6c 65 61 76 |ng and i|nterleav|
|000024a0| 65 64 20 6f 75 74 70 75 | 74 20 6e 6f 74 20 79 65 |ed outpu|t not ye|
|000024b0| 74 20 73 75 70 70 6f 72 | 74 65 64 2e 0a 58 2e 50 |t suppor|ted..X.P|
|000024c0| 50 0a 58 4e 6f 74 20 61 | 6c 6c 20 76 61 72 69 61 |P.XNot a|ll varia|
|000024d0| 6e 74 73 20 6f 66 20 54 | 61 72 67 61 20 66 69 6c |nts of T|arga fil|
|000024e0| 65 20 66 6f 72 6d 61 74 | 20 61 72 65 20 73 75 70 |e format| are sup|
|000024f0| 70 6f 72 74 65 64 2e 0a | 58 2e 50 50 0a 58 54 68 |ported..|X.PP.XTh|
|00002500| 65 0a 58 2e 42 20 2d 74 | 61 72 67 61 0a 58 73 77 |e.X.B -t|arga.Xsw|
|00002510| 69 74 63 68 20 69 73 20 | 6e 6f 74 20 61 20 62 75 |itch is |not a bu|
|00002520| 67 2c 20 69 74 27 73 20 | 61 20 66 65 61 74 75 72 |g, it's |a featur|
|00002530| 65 2e 20 20 28 49 74 20 | 77 6f 75 6c 64 20 62 65 |e. (It |would be|
|00002540| 20 61 20 62 75 67 20 69 | 66 20 74 68 65 20 54 61 | a bug i|f the Ta|
|00002550| 72 67 61 20 66 6f 72 6d | 61 74 0a 58 64 65 73 69 |rga form|at.Xdesi|
|00002560| 67 6e 65 72 73 20 68 61 | 64 20 6e 6f 74 20 62 65 |gners ha|d not be|
|00002570| 65 6e 20 63 6c 75 65 6c | 65 73 73 2e 29 0a 58 2e |en cluel|ess.).X.|
|00002580| 50 50 0a 58 53 74 69 6c | 6c 20 6e 6f 74 20 61 73 |PP.XStil|l not as|
|00002590| 20 66 61 73 74 20 61 73 | 20 77 65 27 64 20 6c 69 | fast as| we'd li|
|000025a0| 6b 65 2e 0a 45 4e 44 5f | 4f 46 5f 46 49 4c 45 0a |ke..END_|OF_FILE.|
|000025b0| 20 20 69 66 20 74 65 73 | 74 20 37 38 33 38 20 2d | if tes|t 7838 -|
|000025c0| 6e 65 20 60 77 63 20 2d | 63 20 3c 27 63 6a 70 65 |ne `wc -|c <'cjpe|
|000025d0| 67 2e 31 27 60 3b 20 74 | 68 65 6e 0a 20 20 20 20 |g.1'`; t|hen. |
|000025e0| 65 63 68 6f 20 73 68 61 | 72 3a 20 5c 22 27 63 6a |echo sha|r: \"'cj|
|000025f0| 70 65 67 2e 31 27 5c 22 | 20 75 6e 70 61 63 6b 65 |peg.1'\"| unpacke|
|00002600| 64 20 77 69 74 68 20 77 | 72 6f 6e 67 20 73 69 7a |d with w|rong siz|
|00002610| 65 21 0a 20 20 66 69 0a | 20 20 23 20 65 6e 64 20 |e!. fi.| # end |
|00002620| 6f 66 20 27 63 6a 70 65 | 67 2e 31 27 0a 66 69 0a |of 'cjpe|g.1'.fi.|
|00002630| 69 66 20 74 65 73 74 20 | 2d 66 20 27 63 6f 64 69 |if test |-f 'codi|
|00002640| 6e 67 72 75 6c 65 73 27 | 20 2d 61 20 22 24 7b 31 |ngrules'| -a "${1|
|00002650| 7d 22 20 21 3d 20 22 2d | 63 22 20 3b 20 74 68 65 |}" != "-|c" ; the|
|00002660| 6e 20 0a 20 20 65 63 68 | 6f 20 73 68 61 72 3a 20 |n . ech|o shar: |
|00002670| 57 69 6c 6c 20 6e 6f 74 | 20 63 6c 6f 62 62 65 72 |Will not| clobber|
|00002680| 20 65 78 69 73 74 69 6e | 67 20 66 69 6c 65 20 5c | existin|g file \|
|00002690| 22 27 63 6f 64 69 6e 67 | 72 75 6c 65 73 27 5c 22 |"'coding|rules'\"|
|000026a0| 0a 65 6c 73 65 0a 20 20 | 65 63 68 6f 20 73 68 61 |.else. |echo sha|
|000026b0| 72 3a 20 45 78 74 72 61 | 63 74 69 6e 67 20 5c 22 |r: Extra|cting \"|
|000026c0| 27 63 6f 64 69 6e 67 72 | 75 6c 65 73 27 5c 22 20 |'codingr|ules'\" |
|000026d0| 5c 28 33 39 34 38 20 63 | 68 61 72 61 63 74 65 72 |\(3948 c|haracter|
|000026e0| 73 5c 29 0a 20 20 73 65 | 64 20 22 73 2f 5e 58 2f |s\). se|d "s/^X/|
|000026f0| 2f 22 20 3e 27 63 6f 64 | 69 6e 67 72 75 6c 65 73 |/" >'cod|ingrules|
|00002700| 27 20 3c 3c 27 45 4e 44 | 5f 4f 46 5f 46 49 4c 45 |' <<'END|_OF_FILE|
|00002710| 27 0a 58 0a 58 09 4a 50 | 45 47 20 53 59 53 54 45 |'.X.X.JP|EG SYSTE|
|00002720| 4d 20 43 4f 44 49 4e 47 | 20 52 55 4c 45 53 09 09 |M CODING| RULES..|
|00002730| 32 37 2d 53 45 50 2d 39 | 31 0a 58 0a 58 53 69 6e |27-SEP-9|1.X.XSin|
|00002740| 63 65 20 6e 75 6d 65 72 | 6f 75 73 20 70 65 6f 70 |ce numer|ous peop|
|00002750| 6c 65 20 77 69 6c 6c 20 | 62 65 20 63 6f 6e 74 72 |le will |be contr|
|00002760| 69 62 75 74 69 6e 67 20 | 63 6f 64 65 20 61 6e 64 |ibuting |code and|
|00002770| 20 62 75 67 20 66 69 78 | 65 73 2c 20 69 74 27 73 | bug fix|es, it's|
|00002780| 20 69 6d 70 6f 72 74 61 | 6e 74 0a 58 74 6f 20 65 | importa|nt.Xto e|
|00002790| 73 74 61 62 6c 69 73 68 | 20 61 20 63 6f 6d 6d 6f |stablish| a commo|
|000027a0| 6e 20 63 6f 64 69 6e 67 | 20 73 74 79 6c 65 2e 20 |n coding| style. |
|000027b0| 20 54 68 65 20 67 6f 61 | 6c 20 6f 66 20 75 73 69 | The goa|l of usi|
|000027c0| 6e 67 20 73 69 6d 69 6c | 61 72 20 63 6f 64 69 6e |ng simil|ar codin|
|000027d0| 67 20 73 74 79 6c 65 73 | 0a 58 69 73 20 6d 75 63 |g styles|.Xis muc|
|000027e0| 68 20 6d 6f 72 65 20 69 | 6d 70 6f 72 74 61 6e 74 |h more i|mportant|
|000027f0| 20 74 68 61 6e 20 74 68 | 65 20 64 65 74 61 69 6c | than th|e detail|
|00002800| 73 20 6f 66 20 6a 75 73 | 74 20 77 68 61 74 20 74 |s of jus|t what t|
|00002810| 68 61 74 20 73 74 79 6c | 65 20 69 73 2e 0a 58 0a |hat styl|e is..X.|
|00002820| 58 49 20 73 75 67 67 65 | 73 74 20 77 65 20 66 6f |XI sugge|st we fo|
|00002830| 6c 6c 6f 77 20 74 68 65 | 20 72 65 63 6f 6d 6d 65 |llow the| recomme|
|00002840| 6e 64 61 74 69 6f 6e 73 | 20 6f 66 20 22 52 65 63 |ndations| of "Rec|
|00002850| 6f 6d 6d 65 6e 64 65 64 | 20 43 20 53 74 79 6c 65 |ommended| C Style|
|00002860| 20 61 6e 64 20 43 6f 64 | 69 6e 67 0a 58 53 74 61 | and Cod|ing.XSta|
|00002870| 6e 64 61 72 64 73 22 20 | 72 65 76 69 73 69 6f 6e |ndards" |revision|
|00002880| 20 36 2e 31 20 28 43 61 | 6e 6e 6f 6e 20 65 74 20 | 6.1 (Ca|nnon et |
|00002890| 61 6c 2e 20 61 73 20 6d | 6f 64 69 66 69 65 64 20 |al. as m|odified |
|000028a0| 62 79 20 53 70 65 6e 63 | 65 72 2c 20 4b 65 70 70 |by Spenc|er, Kepp|
|000028b0| 65 6c 20 61 6e 64 0a 58 | 42 72 61 64 65 72 29 2e |el and.X|Brader).|
|000028c0| 20 20 49 20 68 61 76 65 | 20 70 6c 61 63 65 64 20 | I have| placed |
|000028d0| 61 20 63 6f 70 79 20 6f | 66 20 74 68 69 73 20 64 |a copy o|f this d|
|000028e0| 6f 63 75 6d 65 6e 74 20 | 69 6e 20 74 68 65 20 6a |ocument |in the j|
|000028f0| 70 65 67 20 46 54 50 20 | 61 72 63 68 69 76 65 20 |peg FTP |archive |
|00002900| 28 73 65 65 0a 58 6a 70 | 65 67 2f 64 6f 63 2f 63 |(see.Xjp|eg/doc/c|
|00002910| 73 74 79 6c 65 2e 6d 73 | 2e 74 62 6c 2e 5a 2c 20 |style.ms|.tbl.Z, |
|00002920| 6f 72 20 63 73 74 79 6c | 65 2e 74 78 74 2e 5a 20 |or cstyl|e.txt.Z |
|00002930| 66 6f 72 20 74 68 6f 73 | 65 20 77 69 74 68 6f 75 |for thos|e withou|
|00002940| 74 20 6e 72 6f 66 66 2f | 74 62 6c 29 2e 0a 58 0a |t nroff/|tbl)..X.|
|00002950| 58 55 6e 6c 65 73 73 20 | 73 6f 6d 65 6f 6e 65 20 |XUnless |someone |
|00002960| 68 61 73 20 61 20 72 65 | 61 6c 20 73 74 72 6f 6e |has a re|al stron|
|00002970| 67 20 6f 62 6a 65 63 74 | 69 6f 6e 2c 20 6c 65 74 |g object|ion, let|
|00002980| 27 73 20 64 6f 20 62 6c | 6f 63 6b 20 63 6f 6d 6d |'s do bl|ock comm|
|00002990| 65 6e 74 73 20 74 68 75 | 73 6c 79 3a 0a 58 0a 58 |ents thu|sly:.X.X|
|000029a0| 2f 2a 0a 58 20 2a 20 20 | 42 6c 6f 63 6b 20 63 6f |/*.X * |Block co|
|000029b0| 6d 6d 65 6e 74 73 20 69 | 6e 20 74 68 69 73 20 73 |mments i|n this s|
|000029c0| 74 79 6c 65 2e 0a 58 20 | 2a 2f 0a 58 0a 58 61 6e |tyle..X |*/.X.Xan|
|000029d0| 64 20 69 6e 64 65 6e 74 | 20 73 74 61 74 65 6d 65 |d indent| stateme|
|000029e0| 6e 74 73 20 69 6e 20 4b | 26 52 20 73 74 79 6c 65 |nts in K|&R style|
|000029f0| 2c 20 65 2e 67 2e 2c 0a | 58 0a 58 09 69 66 20 28 |, e.g.,.|X.X.if (|
|00002a00| 74 65 73 74 29 20 7b 0a | 58 09 20 20 20 20 74 68 |test) {.|X. th|
|00002a10| 65 6e 2d 70 61 72 74 3b | 0a 58 09 7d 20 65 6c 73 |en-part;|.X.} els|
|00002a20| 65 20 7b 0a 58 09 20 20 | 20 20 65 6c 73 65 2d 70 |e {.X. | else-p|
|00002a30| 61 72 74 3b 0a 58 09 7d | 0a 58 0a 58 49 20 73 75 |art;.X.}|.X.XI su|
|00002a40| 67 67 65 73 74 20 74 68 | 61 74 20 6d 75 6c 74 69 |ggest th|at multi|
|00002a50| 2d 77 6f 72 64 20 6e 61 | 6d 65 73 20 62 65 20 77 |-word na|mes be w|
|00002a60| 72 69 74 74 65 6e 20 69 | 6e 20 74 68 65 20 73 74 |ritten i|n the st|
|00002a70| 79 6c 65 20 6d 75 6c 74 | 69 5f 77 6f 72 64 5f 6e |yle mult|i_word_n|
|00002a80| 61 6d 65 0a 58 72 61 74 | 68 65 72 20 74 68 61 6e |ame.Xrat|her than|
|00002a90| 20 6d 75 6c 74 69 57 6f | 72 64 4e 61 6d 65 2c 20 | multiWo|rdName, |
|00002aa0| 62 75 74 20 49 20 61 6d | 20 6f 70 65 6e 20 74 6f |but I am| open to|
|00002ab0| 20 61 72 67 75 6d 65 6e | 74 20 6f 6e 20 74 68 69 | argumen|t on thi|
|00002ac0| 73 2e 0a 58 0a 58 0a 58 | 49 20 77 6f 75 6c 64 20 |s..X.X.X|I would |
|00002ad0| 6c 69 6b 65 20 74 6f 20 | 75 73 65 20 66 75 6e 63 |like to |use func|
|00002ae0| 74 69 6f 6e 20 70 72 6f | 74 6f 74 79 70 65 73 20 |tion pro|totypes |
|00002af0| 65 76 65 72 79 77 68 65 | 72 65 2c 20 61 6e 64 20 |everywhe|re, and |
|00002b00| 72 65 6c 79 20 6f 6e 20 | 61 75 74 6f 6d 61 74 69 |rely on |automati|
|00002b10| 63 0a 58 73 6f 75 72 63 | 65 20 63 6f 64 65 20 74 |c.Xsourc|e code t|
|00002b20| 72 61 6e 73 66 6f 72 6d | 61 74 69 6f 6e 20 74 6f |ransform|ation to|
|00002b30| 20 66 65 65 64 20 6e 6f | 6e 2d 41 4e 53 49 20 43 | feed no|n-ANSI C|
|00002b40| 20 63 6f 6d 70 69 6c 65 | 72 73 2e 20 20 54 68 65 | compile|rs. The|
|00002b50| 20 62 65 73 74 20 74 6f | 6f 6c 0a 58 49 20 68 61 | best to|ol.XI ha|
|00002b60| 76 65 20 73 6f 20 66 61 | 72 20 66 6f 75 6e 64 20 |ve so fa|r found |
|00002b70| 66 6f 72 20 74 68 69 73 | 20 69 73 20 27 61 6e 73 |for this| is 'ans|
|00002b80| 69 32 6b 6e 72 2e 63 27 | 2c 20 77 68 69 63 68 20 |i2knr.c'|, which |
|00002b90| 69 73 20 70 61 72 74 20 | 6f 66 20 47 68 6f 73 74 |is part |of Ghost|
|00002ba0| 73 63 72 69 70 74 2e 0a | 58 61 6e 73 69 32 6b 6e |script..|Xansi2kn|
|00002bb0| 72 20 69 73 20 6e 6f 74 | 20 76 65 72 79 20 62 72 |r is not| very br|
|00002bc0| 69 67 68 74 2c 20 73 6f | 20 69 74 20 69 6d 70 6f |ight, so| it impo|
|00002bd0| 73 65 73 20 61 20 66 6f | 72 6d 61 74 20 72 65 71 |ses a fo|rmat req|
|00002be0| 75 69 72 65 6d 65 6e 74 | 20 6f 6e 20 66 75 6e 63 |uirement| on func|
|00002bf0| 74 69 6f 6e 0a 58 64 65 | 63 6c 61 72 61 74 69 6f |tion.Xde|claratio|
|00002c00| 6e 73 3a 20 74 68 65 20 | 66 75 6e 63 74 69 6f 6e |ns: the |function|
|00002c10| 20 6e 61 6d 65 20 4d 55 | 53 54 20 42 45 47 49 4e | name MU|ST BEGIN|
|00002c20| 20 49 4e 20 43 4f 4c 55 | 4d 4e 20 31 2e 20 20 54 | IN COLU|MN 1. T|
|00002c30| 68 75 73 20 61 6c 6c 20 | 66 75 6e 63 74 69 6f 6e |hus all |function|
|00002c40| 73 0a 58 73 68 6f 75 6c | 64 20 62 65 20 77 72 69 |s.Xshoul|d be wri|
|00002c50| 74 74 65 6e 20 69 6e 20 | 74 68 65 20 66 6f 6c 6c |tten in |the foll|
|00002c60| 6f 77 69 6e 67 20 73 74 | 79 6c 65 3a 0a 58 0a 58 |owing st|yle:.X.X|
|00002c70| 73 74 61 74 69 63 20 69 | 6e 74 20 2a 0a 58 66 75 |static i|nt *.Xfu|
|00002c80| 6e 63 74 69 6f 6e 5f 6e | 61 6d 65 20 28 69 6e 74 |nction_n|ame (int|
|00002c90| 20 61 2c 20 63 68 61 72 | 20 2a 62 29 0a 58 7b 0a | a, char| *b).X{.|
|00002ca0| 58 20 20 20 20 63 6f 64 | 65 2e 2e 2e 0a 58 7d 0a |X cod|e....X}.|
|00002cb0| 58 0a 58 61 6e 73 69 32 | 6b 6e 72 20 77 6f 6e 27 |X.Xansi2|knr won'|
|00002cc0| 74 20 68 65 6c 70 20 77 | 69 74 68 20 6d 65 74 68 |t help w|ith meth|
|00002cd0| 6f 64 20 64 65 63 6c 61 | 72 61 74 69 6f 6e 73 20 |od decla|rations |
|00002ce0| 28 66 75 6e 63 74 69 6f | 6e 20 70 6f 69 6e 74 65 |(functio|n pointe|
|00002cf0| 72 73 20 69 6e 20 73 74 | 72 75 63 74 73 29 2e 0a |rs in st|ructs)..|
|00002d00| 58 49 20 73 75 67 67 65 | 73 74 20 77 65 20 75 73 |XI sugge|st we us|
|00002d10| 65 20 61 20 6d 61 63 72 | 6f 20 74 6f 20 64 65 63 |e a macr|o to dec|
|00002d20| 6c 61 72 65 20 6d 65 74 | 68 6f 64 20 70 6f 69 6e |lare met|hod poin|
|00002d30| 74 65 72 73 2c 20 73 6f | 6d 65 74 68 69 6e 67 20 |ters, so|mething |
|00002d40| 6c 69 6b 65 20 74 68 69 | 73 3a 0a 58 0a 58 23 69 |like thi|s:.X.X#i|
|00002d50| 66 64 65 66 20 50 52 4f | 54 4f 0a 58 23 64 65 66 |fdef PRO|TO.X#def|
|00002d60| 69 6e 65 20 4d 45 54 48 | 4f 44 28 74 79 70 65 2c |ine METH|OD(type,|
|00002d70| 6d 65 74 68 6f 64 6e 61 | 6d 65 2c 61 72 67 6c 69 |methodna|me,argli|
|00002d80| 73 74 29 20 20 74 79 70 | 65 20 28 2a 6d 65 74 68 |st) typ|e (*meth|
|00002d90| 6f 64 6e 61 6d 65 29 20 | 61 72 67 6c 69 73 74 0a |odname) |arglist.|
|00002da0| 58 23 65 6c 73 65 0a 58 | 23 64 65 66 69 6e 65 20 |X#else.X|#define |
|00002db0| 4d 45 54 48 4f 44 28 74 | 79 70 65 2c 6d 65 74 68 |METHOD(t|ype,meth|
|00002dc0| 6f 64 6e 61 6d 65 2c 61 | 72 67 6c 69 73 74 29 20 |odname,a|rglist) |
|00002dd0| 20 74 79 70 65 20 28 2a | 6d 65 74 68 6f 64 6e 61 | type (*|methodna|
|00002de0| 6d 65 29 20 28 29 0a 58 | 23 65 6e 64 69 66 0a 58 |me) ().X|#endif.X|
|00002df0| 0a 58 77 68 69 63 68 20 | 69 73 20 75 73 65 64 20 |.Xwhich |is used |
|00002e00| 6c 69 6b 65 20 74 68 69 | 73 3a 0a 58 0a 58 73 74 |like thi|s:.X.Xst|
|00002e10| 72 75 63 74 20 66 75 6e | 63 74 69 6f 6e 5f 70 6f |ruct fun|ction_po|
|00002e20| 69 6e 74 65 72 73 20 7b | 0a 58 09 4d 45 54 48 4f |inters {|.X.METHO|
|00002e30| 44 28 76 6f 69 64 2c 20 | 69 6e 69 74 5f 65 6e 74 |D(void, |init_ent|
|00002e40| 72 6f 70 79 5f 65 6e 63 | 6f 64 65 72 2c 20 28 66 |ropy_enc|oder, (f|
|00002e50| 75 6e 63 74 70 74 72 73 | 20 66 70 74 72 73 2c 20 |unctptrs| fptrs, |
|00002e60| 6a 70 61 72 6d 73 20 2a | 6a 70 29 29 3b 0a 58 09 |jparms *|jp));.X.|
|00002e70| 4d 45 54 48 4f 44 28 76 | 6f 69 64 2c 20 74 65 72 |METHOD(v|oid, ter|
|00002e80| 6d 5f 65 6e 74 72 6f 70 | 79 5f 65 6e 63 6f 64 65 |m_entrop|y_encode|
|00002e90| 72 2c 20 28 76 6f 69 64 | 29 29 3b 0a 58 7d 3b 0a |r, (void|));.X};.|
|00002ea0| 58 0a 58 4e 6f 74 65 20 | 74 68 65 20 73 65 74 20 |X.XNote |the set |
|00002eb0| 6f 66 20 70 61 72 65 6e | 74 68 65 73 65 73 20 73 |of paren|theses s|
|00002ec0| 75 72 72 6f 75 6e 64 69 | 6e 67 20 74 68 65 20 70 |urroundi|ng the p|
|00002ed0| 61 72 61 6d 65 74 65 72 | 20 6c 69 73 74 2e 0a 58 |arameter| list..X|
|00002ee0| 0a 58 41 20 73 69 6d 69 | 6c 61 72 20 73 6f 6c 75 |.XA simi|lar solu|
|00002ef0| 74 69 6f 6e 20 69 73 20 | 75 73 65 64 20 66 6f 72 |tion is |used for|
|00002f00| 20 65 78 74 65 72 6e 61 | 6c 20 66 75 6e 63 74 69 | externa|l functi|
|00002f10| 6f 6e 20 64 65 63 6c 61 | 72 61 74 69 6f 6e 73 20 |on decla|rations |
|00002f20| 28 73 65 65 20 74 68 65 | 20 50 50 0a 58 6d 61 63 |(see the| PP.Xmac|
|00002f30| 72 6f 20 69 6e 20 6a 70 | 65 67 64 61 74 61 2e 68 |ro in jp|egdata.h|
|00002f40| 29 2e 0a 58 0a 58 49 66 | 20 74 68 65 20 63 6f 64 |)..X.XIf| the cod|
|00002f50| 65 20 69 73 20 74 6f 20 | 77 6f 72 6b 20 6f 6e 20 |e is to |work on |
|00002f60| 6e 6f 6e 2d 41 4e 53 49 | 20 63 6f 6d 70 69 6c 65 |non-ANSI| compile|
|00002f70| 72 73 2c 20 79 6f 75 20 | 63 61 6e 6e 6f 74 20 72 |rs, you |cannot r|
|00002f80| 65 6c 79 20 6f 6e 20 61 | 20 70 72 6f 74 6f 74 79 |ely on a| prototy|
|00002f90| 70 65 0a 58 64 65 63 6c | 61 72 61 74 69 6f 6e 20 |pe.Xdecl|aration |
|00002fa0| 74 6f 20 63 6f 65 72 63 | 65 20 61 63 74 75 61 6c |to coerc|e actual|
|00002fb0| 20 70 61 72 61 6d 65 74 | 65 72 73 20 69 6e 74 6f | paramet|ers into|
|00002fc0| 20 74 68 65 20 72 69 67 | 68 74 20 74 79 70 65 73 | the rig|ht types|
|00002fd0| 2e 20 20 54 68 65 72 65 | 66 6f 72 65 2c 20 75 73 |. There|fore, us|
|00002fe0| 65 0a 58 65 78 70 6c 69 | 63 69 74 20 63 61 73 74 |e.Xexpli|cit cast|
|00002ff0| 73 20 6f 6e 20 61 63 74 | 75 61 6c 20 70 61 72 61 |s on act|ual para|
|00003000| 6d 65 74 65 72 73 20 77 | 68 65 6e 65 76 65 72 20 |meters w|henever |
|00003010| 74 68 65 20 61 63 74 75 | 61 6c 20 70 61 72 61 6d |the actu|al param|
|00003020| 65 74 65 72 20 74 79 70 | 65 20 69 73 20 6e 6f 74 |eter typ|e is not|
|00003030| 0a 58 69 64 65 6e 74 69 | 63 61 6c 20 74 6f 20 74 |.Xidenti|cal to t|
|00003040| 68 65 20 66 6f 72 6d 61 | 6c 20 70 61 72 61 6d 65 |he forma|l parame|
|00003050| 74 65 72 2e 20 20 42 65 | 77 61 72 65 20 6f 66 20 |ter. Be|ware of |
|00003060| 69 6d 70 6c 69 63 69 74 | 20 63 6f 6e 76 65 72 73 |implicit| convers|
|00003070| 69 6f 6e 73 20 74 6f 20 | 22 69 6e 74 22 2e 0a 58 |ions to |"int"..X|
|00003080| 0a 58 49 74 20 73 65 65 | 6d 73 20 74 68 65 72 65 |.XIt see|ms there|
|00003090| 20 61 72 65 20 73 6f 6d | 65 20 6e 6f 6e 2d 41 4e | are som|e non-AN|
|000030a0| 53 49 20 63 6f 6d 70 69 | 6c 65 72 73 20 69 6e 20 |SI compi|lers in |
|000030b0| 77 68 69 63 68 20 74 68 | 65 20 73 69 7a 65 6f 66 |which th|e sizeof|
|000030c0| 28 29 20 6f 70 65 72 61 | 74 6f 72 0a 58 69 73 20 |() opera|tor.Xis |
|000030d0| 64 65 66 69 6e 65 64 20 | 74 6f 20 72 65 74 75 72 |defined |to retur|
|000030e0| 6e 20 69 6e 74 2c 20 77 | 68 69 6c 65 20 73 69 7a |n int, w|hile siz|
|000030f0| 65 5f 74 20 69 73 20 64 | 65 66 69 6e 65 64 20 61 |e_t is d|efined a|
|00003100| 73 20 6c 6f 6e 67 2e 20 | 20 4e 65 65 64 6c 65 73 |s long. | Needles|
|00003110| 73 20 74 6f 20 73 61 79 | 2c 0a 58 74 68 69 73 20 |s to say|,.Xthis |
|00003120| 69 73 20 62 72 61 69 6e | 2d 64 61 6d 61 67 65 64 |is brain|-damaged|
|00003130| 2e 20 20 41 6c 77 61 79 | 73 20 75 73 65 20 74 68 |. Alway|s use th|
|00003140| 65 20 53 49 5a 45 4f 46 | 28 29 20 6d 61 63 72 6f |e SIZEOF|() macro|
|00003150| 20 69 6e 20 70 6c 61 63 | 65 20 6f 66 20 73 69 7a | in plac|e of siz|
|00003160| 65 6f 66 28 29 2c 0a 58 | 73 6f 20 74 68 61 74 20 |eof(),.X|so that |
|00003170| 74 68 65 20 72 65 73 75 | 6c 74 20 69 73 20 67 75 |the resu|lt is gu|
|00003180| 61 72 61 6e 74 65 65 64 | 20 74 6f 20 62 65 20 6f |aranteed| to be o|
|00003190| 66 20 74 79 70 65 20 73 | 69 7a 65 5f 74 2e 0a 58 |f type s|ize_t..X|
|000031a0| 0a 58 0a 58 57 65 20 63 | 61 6e 20 65 78 70 65 63 |.X.XWe c|an expec|
|000031b0| 74 20 74 68 61 74 20 74 | 68 65 20 4a 50 45 47 20 |t that t|he JPEG |
|000031c0| 63 6f 6d 70 72 65 73 73 | 6f 72 20 61 6e 64 20 64 |compress|or and d|
|000031d0| 65 63 6f 6d 70 72 65 73 | 73 6f 72 20 77 69 6c 6c |ecompres|sor will|
|000031e0| 20 62 65 20 69 6e 63 6f | 72 70 6f 72 61 74 65 64 | be inco|rporated|
|000031f0| 0a 58 69 6e 74 6f 20 6c | 61 72 67 65 72 20 70 72 |.Xinto l|arger pr|
|00003200| 6f 67 72 61 6d 73 2e 20 | 20 54 68 65 72 65 66 6f |ograms. | Therefo|
|00003210| 72 65 2c 20 74 68 65 20 | 66 6f 6c 6c 6f 77 69 6e |re, the |followin|
|00003220| 67 20 72 75 6c 65 73 20 | 61 72 65 20 69 6d 70 6f |g rules |are impo|
|00003230| 72 74 61 6e 74 3a 0a 58 | 0a 58 31 2e 20 41 76 6f |rtant:.X|.X1. Avo|
|00003240| 69 64 20 64 69 72 65 63 | 74 20 75 73 65 20 6f 66 |id direc|t use of|
|00003250| 20 61 6e 79 20 66 69 6c | 65 20 49 2f 4f 2c 20 22 | any fil|e I/O, "|
|00003260| 6d 61 6c 6c 6f 63 22 2c | 20 65 72 72 6f 72 20 72 |malloc",| error r|
|00003270| 65 70 6f 72 74 20 70 72 | 69 6e 74 6f 75 74 73 2c |eport pr|intouts,|
|00003280| 20 65 74 63 3b 0a 58 70 | 61 73 73 20 74 68 65 73 | etc;.Xp|ass thes|
|00003290| 65 20 74 68 72 6f 75 67 | 68 20 74 68 65 20 63 6f |e throug|h the co|
|000032a0| 6d 6d 6f 6e 20 72 6f 75 | 74 69 6e 65 73 20 70 72 |mmon rou|tines pr|
|000032b0| 6f 76 69 64 65 64 2e 0a | 58 0a 58 32 2e 20 41 73 |ovided..|X.X2. As|
|000032c0| 73 75 6d 65 20 74 68 61 | 74 20 74 68 65 20 4a 50 |sume tha|t the JP|
|000032d0| 45 47 20 63 6f 64 65 20 | 6d 61 79 20 62 65 20 69 |EG code |may be i|
|000032e0| 6e 76 6f 6b 65 64 20 6d | 6f 72 65 20 74 68 61 6e |nvoked m|ore than|
|000032f0| 20 6f 6e 63 65 20 70 65 | 72 20 70 72 6f 67 72 61 | once pe|r progra|
|00003300| 6d 20 72 75 6e 3b 0a 58 | 74 68 65 72 65 66 6f 72 |m run;.X|therefor|
|00003310| 65 2c 20 64 6f 20 6e 6f | 74 20 72 65 6c 79 20 6f |e, do no|t rely o|
|00003320| 6e 20 73 74 61 74 69 63 | 20 69 6e 69 74 69 61 6c |n static| initial|
|00003330| 69 7a 61 74 69 6f 6e 20 | 6f 66 20 76 61 72 69 61 |ization |of varia|
|00003340| 62 6c 65 73 2c 20 61 6e | 64 20 62 65 20 63 61 72 |bles, an|d be car|
|00003350| 65 66 75 6c 0a 58 74 6f | 20 72 65 6c 65 61 73 65 |eful.Xto| release|
|00003360| 20 61 6c 6c 20 61 6c 6c | 6f 63 61 74 65 64 20 73 | all all|ocated s|
|00003370| 74 6f 72 61 67 65 20 61 | 74 20 74 68 65 20 65 6e |torage a|t the en|
|00003380| 64 20 6f 66 20 70 72 6f | 63 65 73 73 69 6e 67 2e |d of pro|cessing.|
|00003390| 0a 58 0a 58 33 2e 20 4d | 69 6e 69 6d 69 7a 65 20 |.X.X3. M|inimize |
|000033a0| 67 6c 6f 62 61 6c 20 6e | 61 6d 65 73 70 61 63 65 |global n|amespace|
|000033b0| 20 70 6f 6c 6c 75 74 69 | 6f 6e 2e 20 20 46 75 6e | polluti|on. Fun|
|000033c0| 63 74 69 6f 6e 73 20 73 | 68 6f 75 6c 64 20 62 65 |ctions s|hould be|
|000033d0| 20 64 65 63 6c 61 72 65 | 64 20 73 74 61 74 69 63 | declare|d static|
|000033e0| 0a 58 77 68 65 72 65 76 | 65 72 20 70 6f 73 73 69 |.Xwherev|er possi|
|000033f0| 62 6c 65 2e 20 20 28 4e | 6f 74 65 20 74 68 61 74 |ble. (N|ote that|
|00003400| 20 6f 75 72 20 6d 65 74 | 68 6f 64 2d 62 61 73 65 | our met|hod-base|
|00003410| 64 20 63 61 6c 6c 69 6e | 67 20 63 6f 6e 76 65 6e |d callin|g conven|
|00003420| 74 69 6f 6e 73 20 68 65 | 6c 70 20 74 68 69 73 0a |tions he|lp this.|
|00003430| 58 61 20 6c 6f 74 3a 20 | 69 6e 20 6d 61 6e 79 20 |Xa lot: |in many |
|00003440| 6d 6f 64 75 6c 65 73 20 | 6f 6e 6c 79 20 74 68 65 |modules |only the|
|00003450| 20 6d 65 74 68 6f 64 2d | 73 65 6c 65 63 74 6f 72 | method-|selector|
|00003460| 20 66 75 6e 63 74 69 6f | 6e 20 77 69 6c 6c 20 65 | functio|n will e|
|00003470| 76 65 72 20 6e 65 65 64 | 20 74 6f 20 62 65 0a 58 |ver need| to be.X|
|00003480| 63 61 6c 6c 65 64 20 64 | 69 72 65 63 74 6c 79 2c |called d|irectly,|
|00003490| 20 73 6f 20 6f 6e 6c 79 | 20 74 68 61 74 20 66 75 | so only| that fu|
|000034a0| 6e 63 74 69 6f 6e 20 6e | 65 65 64 20 62 65 20 65 |nction n|eed be e|
|000034b0| 78 74 65 72 6e 61 6c 6c | 79 20 76 69 73 69 62 6c |xternall|y visibl|
|000034c0| 65 2e 29 20 20 41 6c 6c | 0a 58 67 6c 6f 62 61 6c |e.) All|.Xglobal|
|000034d0| 20 66 75 6e 63 74 69 6f | 6e 20 6e 61 6d 65 73 20 | functio|n names |
|000034e0| 73 68 6f 75 6c 64 20 62 | 65 67 69 6e 20 77 69 74 |should b|egin wit|
|000034f0| 68 20 22 6a 22 2c 20 61 | 6e 64 20 73 68 6f 75 6c |h "j", a|nd shoul|
|00003500| 64 20 62 65 20 75 6e 69 | 71 75 65 20 69 6e 20 74 |d be uni|que in t|
|00003510| 68 65 20 66 69 72 73 74 | 0a 58 73 69 78 20 63 68 |he first|.Xsix ch|
|00003520| 61 72 61 63 74 65 72 73 | 20 66 6f 72 20 70 6f 72 |aracters| for por|
|00003530| 74 61 62 69 6c 69 74 79 | 20 72 65 61 73 6f 6e 73 |tability| reasons|
|00003540| 2e 0a 58 44 6f 6e 27 74 | 20 75 73 65 20 67 6c 6f |..XDon't| use glo|
|00003550| 62 61 6c 20 76 61 72 69 | 61 62 6c 65 73 20 61 74 |bal vari|ables at|
|00003560| 20 61 6c 6c 3b 20 61 6e | 79 74 68 69 6e 67 20 74 | all; an|ything t|
|00003570| 68 61 74 20 6d 75 73 74 | 20 62 65 20 75 73 65 64 |hat must| be used|
|00003580| 20 69 6e 20 61 6e 6f 74 | 68 65 72 0a 58 6d 6f 64 | in anot|her.Xmod|
|00003590| 75 6c 65 20 73 68 6f 75 | 6c 64 20 62 65 20 70 75 |ule shou|ld be pu|
|000035a0| 74 20 69 6e 74 6f 20 70 | 61 72 61 6d 65 74 65 72 |t into p|arameter|
|000035b0| 73 20 28 74 68 65 72 65 | 27 6c 6c 20 62 65 20 73 |s (there|'ll be s|
|000035c0| 6f 6d 65 20 6c 61 72 67 | 65 20 73 74 72 75 63 74 |ome larg|e struct|
|000035d0| 73 20 70 61 73 73 65 64 | 0a 58 61 72 6f 75 6e 64 |s passed|.Xaround|
|000035e0| 20 66 6f 72 20 74 68 69 | 73 20 70 75 72 70 6f 73 | for thi|s purpos|
|000035f0| 65 29 2e 0a 58 0a 58 34 | 2e 20 53 6f 75 72 63 65 |e)..X.X4|. Source|
|00003600| 20 66 69 6c 65 20 6e 61 | 6d 65 73 20 73 68 6f 75 | file na|mes shou|
|00003610| 6c 64 20 61 6c 73 6f 20 | 62 65 67 69 6e 20 77 69 |ld also |begin wi|
|00003620| 74 68 20 22 6a 22 3b 20 | 72 65 6d 65 6d 62 65 72 |th "j"; |remember|
|00003630| 20 74 6f 20 6b 65 65 70 | 20 74 68 65 6d 20 74 6f | to keep| them to|
|00003640| 0a 58 65 69 67 68 74 20 | 63 68 61 72 61 63 74 65 |.Xeight |characte|
|00003650| 72 73 20 28 70 6c 75 73 | 20 22 2e 63 22 20 6f 72 |rs (plus| ".c" or|
|00003660| 20 22 2e 68 22 2c 20 65 | 74 63 29 20 74 6f 20 6d | ".h", e|tc) to m|
|00003670| 61 6b 65 20 6c 69 66 65 | 20 65 61 73 79 20 66 6f |ake life| easy fo|
|00003680| 72 20 4d 53 2d 44 4f 53 | 65 72 73 2e 0a 58 44 6f |r MS-DOS|ers..XDo|
|00003690| 20 6e 6f 74 20 70 75 74 | 20 63 6f 64 65 20 66 6f | not put| code fo|
|000036a0| 72 20 62 6f 74 68 20 63 | 6f 6d 70 72 65 73 73 69 |r both c|ompressi|
|000036b0| 6f 6e 20 61 6e 64 20 64 | 65 63 6f 6d 70 72 65 73 |on and d|ecompres|
|000036c0| 73 69 6f 6e 20 69 6e 74 | 6f 20 74 68 65 20 73 61 |sion int|o the sa|
|000036d0| 6d 65 20 73 6f 75 72 63 | 65 0a 58 66 69 6c 65 2e |me sourc|e.Xfile.|
|000036e0| 0a 45 4e 44 5f 4f 46 5f | 46 49 4c 45 0a 20 20 69 |.END_OF_|FILE. i|
|000036f0| 66 20 74 65 73 74 20 33 | 39 34 38 20 2d 6e 65 20 |f test 3|948 -ne |
|00003700| 60 77 63 20 2d 63 20 3c | 27 63 6f 64 69 6e 67 72 |`wc -c <|'codingr|
|00003710| 75 6c 65 73 27 60 3b 20 | 74 68 65 6e 0a 20 20 20 |ules'`; |then. |
|00003720| 20 65 63 68 6f 20 73 68 | 61 72 3a 20 5c 22 27 63 | echo sh|ar: \"'c|
|00003730| 6f 64 69 6e 67 72 75 6c | 65 73 27 5c 22 20 75 6e |odingrul|es'\" un|
|00003740| 70 61 63 6b 65 64 20 77 | 69 74 68 20 77 72 6f 6e |packed w|ith wron|
|00003750| 67 20 73 69 7a 65 21 0a | 20 20 66 69 0a 20 20 23 |g size!.| fi. #|
|00003760| 20 65 6e 64 20 6f 66 20 | 27 63 6f 64 69 6e 67 72 | end of |'codingr|
|00003770| 75 6c 65 73 27 0a 66 69 | 0a 69 66 20 74 65 73 74 |ules'.fi|.if test|
|00003780| 20 2d 66 20 27 6a 64 64 | 65 66 6c 74 73 2e 63 27 | -f 'jdd|eflts.c'|
|00003790| 20 2d 61 20 22 24 7b 31 | 7d 22 20 21 3d 20 22 2d | -a "${1|}" != "-|
|000037a0| 63 22 20 3b 20 74 68 65 | 6e 20 0a 20 20 65 63 68 |c" ; the|n . ech|
|000037b0| 6f 20 73 68 61 72 3a 20 | 57 69 6c 6c 20 6e 6f 74 |o shar: |Will not|
|000037c0| 20 63 6c 6f 62 62 65 72 | 20 65 78 69 73 74 69 6e | clobber| existin|
|000037d0| 67 20 66 69 6c 65 20 5c | 22 27 6a 64 64 65 66 6c |g file \|"'jddefl|
|000037e0| 74 73 2e 63 27 5c 22 0a | 65 6c 73 65 0a 20 20 65 |ts.c'\".|else. e|
|000037f0| 63 68 6f 20 73 68 61 72 | 3a 20 45 78 74 72 61 63 |cho shar|: Extrac|
|00003800| 74 69 6e 67 20 5c 22 27 | 6a 64 64 65 66 6c 74 73 |ting \"'|jddeflts|
|00003810| 2e 63 27 5c 22 20 5c 28 | 36 35 32 39 20 63 68 61 |.c'\" \(|6529 cha|
|00003820| 72 61 63 74 65 72 73 5c | 29 0a 20 20 73 65 64 20 |racters\|). sed |
|00003830| 22 73 2f 5e 58 2f 2f 22 | 20 3e 27 6a 64 64 65 66 |"s/^X//"| >'jddef|
|00003840| 6c 74 73 2e 63 27 20 3c | 3c 27 45 4e 44 5f 4f 46 |lts.c' <|<'END_OF|
|00003850| 5f 46 49 4c 45 27 0a 58 | 2f 2a 0a 58 20 2a 20 6a |_FILE'.X|/*.X * j|
|00003860| 64 64 65 66 6c 74 73 2e | 63 0a 58 20 2a 0a 58 20 |ddeflts.|c.X *.X |
|00003870| 2a 20 43 6f 70 79 72 69 | 67 68 74 20 28 43 29 20 |* Copyri|ght (C) |
|00003880| 31 39 39 31 2c 20 31 39 | 39 32 2c 20 54 68 6f 6d |1991, 19|92, Thom|
|00003890| 61 73 20 47 2e 20 4c 61 | 6e 65 2e 0a 58 20 2a 20 |as G. La|ne..X * |
|000038a0| 54 68 69 73 20 66 69 6c | 65 20 69 73 20 70 61 72 |This fil|e is par|
|000038b0| 74 20 6f 66 20 74 68 65 | 20 49 6e 64 65 70 65 6e |t of the| Indepen|
|000038c0| 64 65 6e 74 20 4a 50 45 | 47 20 47 72 6f 75 70 27 |dent JPE|G Group'|
|000038d0| 73 20 73 6f 66 74 77 61 | 72 65 2e 0a 58 20 2a 20 |s softwa|re..X * |
|000038e0| 46 6f 72 20 63 6f 6e 64 | 69 74 69 6f 6e 73 20 6f |For cond|itions o|
|000038f0| 66 20 64 69 73 74 72 69 | 62 75 74 69 6f 6e 20 61 |f distri|bution a|
|00003900| 6e 64 20 75 73 65 2c 20 | 73 65 65 20 74 68 65 20 |nd use, |see the |
|00003910| 61 63 63 6f 6d 70 61 6e | 79 69 6e 67 20 52 45 41 |accompan|ying REA|
|00003920| 44 4d 45 20 66 69 6c 65 | 2e 0a 58 20 2a 0a 58 20 |DME file|..X *.X |
|00003930| 2a 20 54 68 69 73 20 66 | 69 6c 65 20 63 6f 6e 74 |* This f|ile cont|
|00003940| 61 69 6e 73 20 6f 70 74 | 69 6f 6e 61 6c 20 64 65 |ains opt|ional de|
|00003950| 66 61 75 6c 74 2d 73 65 | 74 74 69 6e 67 20 63 6f |fault-se|tting co|
|00003960| 64 65 20 66 6f 72 20 74 | 68 65 20 4a 50 45 47 20 |de for t|he JPEG |
|00003970| 64 65 63 6f 6d 70 72 65 | 73 73 6f 72 2e 0a 58 20 |decompre|ssor..X |
|00003980| 2a 20 55 73 65 72 20 69 | 6e 74 65 72 66 61 63 65 |* User i|nterface|
|00003990| 73 20 64 6f 20 6e 6f 74 | 20 68 61 76 65 20 74 6f |s do not| have to|
|000039a0| 20 75 73 65 20 74 68 69 | 73 20 66 69 6c 65 2c 20 | use thi|s file, |
|000039b0| 62 75 74 20 74 68 6f 73 | 65 20 74 68 61 74 20 64 |but thos|e that d|
|000039c0| 6f 6e 27 74 20 75 73 65 | 20 69 74 0a 58 20 2a 20 |on't use| it.X * |
|000039d0| 6d 75 73 74 20 6b 6e 6f | 77 20 6d 6f 72 65 20 61 |must kno|w more a|
|000039e0| 62 6f 75 74 20 74 68 65 | 20 69 6e 6e 61 72 64 73 |bout the| innards|
|000039f0| 20 6f 66 20 74 68 65 20 | 4a 50 45 47 20 63 6f 64 | of the |JPEG cod|
|00003a00| 65 2e 0a 58 20 2a 2f 0a | 58 0a 58 23 69 6e 63 6c |e..X */.|X.X#incl|
|00003a10| 75 64 65 20 22 6a 69 6e | 63 6c 75 64 65 2e 68 22 |ude "jin|clude.h"|
|00003a20| 0a 58 0a 58 0a 58 2f 2a | 20 44 65 66 61 75 6c 74 |.X.X.X/*| Default|
|00003a30| 20 64 6f 2d 6e 6f 74 68 | 69 6e 67 20 70 72 6f 67 | do-noth|ing prog|
|00003a40| 72 65 73 73 20 6d 6f 6e | 69 74 6f 72 69 6e 67 20 |ress mon|itoring |
|00003a50| 72 6f 75 74 69 6e 65 2e | 0a 58 20 2a 20 54 68 69 |routine.|.X * Thi|
|00003a60| 73 20 63 61 6e 20 62 65 | 20 6f 76 65 72 72 69 64 |s can be| overrid|
|00003a70| 64 65 6e 20 62 79 20 61 | 20 75 73 65 72 20 69 6e |den by a| user in|
|00003a80| 74 65 72 66 61 63 65 20 | 74 68 61 74 20 77 69 73 |terface |that wis|
|00003a90| 68 65 73 20 74 6f 0a 58 | 20 2a 20 70 72 6f 76 69 |hes to.X| * provi|
|00003aa0| 64 65 20 70 72 6f 67 72 | 65 73 73 20 6d 6f 6e 69 |de progr|ess moni|
|00003ab0| 74 6f 72 69 6e 67 3b 20 | 6a 75 73 74 20 73 65 74 |toring; |just set|
|00003ac0| 20 6d 65 74 68 6f 64 73 | 2d 3e 70 72 6f 67 72 65 | methods|->progre|
|00003ad0| 73 73 5f 6d 6f 6e 69 74 | 6f 72 0a 58 20 2a 20 61 |ss_monit|or.X * a|
|00003ae0| 66 74 65 72 20 6a 5f 64 | 5f 64 65 66 61 75 6c 74 |fter j_d|_default|
|00003af0| 73 20 69 73 20 64 6f 6e | 65 2e 20 20 54 68 65 20 |s is don|e. The |
|00003b00| 72 6f 75 74 69 6e 65 20 | 77 69 6c 6c 20 62 65 20 |routine |will be |
|00003b10| 63 61 6c 6c 65 64 20 70 | 65 72 69 6f 64 69 63 61 |called p|eriodica|
|00003b20| 6c 6c 79 0a 58 20 2a 20 | 64 75 72 69 6e 67 20 74 |lly.X * |during t|
|00003b30| 68 65 20 64 65 63 6f 6d | 70 72 65 73 73 69 6f 6e |he decom|pression|
|00003b40| 20 70 72 6f 63 65 73 73 | 2e 0a 58 20 2a 0a 58 20 | process|..X *.X |
|00003b50| 2a 20 44 75 72 69 6e 67 | 20 61 6e 79 20 6f 6e 65 |* During| any one|
|00003b60| 20 70 61 73 73 2c 20 6c | 6f 6f 70 63 6f 75 6e 74 | pass, l|oopcount|
|00003b70| 65 72 20 69 6e 63 72 65 | 61 73 65 73 20 66 72 6f |er incre|ases fro|
|00003b80| 6d 20 30 20 75 70 20 74 | 6f 20 28 6e 6f 74 20 69 |m 0 up t|o (not i|
|00003b90| 6e 63 6c 75 64 69 6e 67 | 29 0a 58 20 2a 20 6c 6f |ncluding|).X * lo|
|00003ba0| 6f 70 6c 69 6d 69 74 3b | 20 74 68 65 20 73 74 65 |oplimit;| the ste|
|00003bb0| 70 20 73 69 7a 65 20 69 | 73 20 6e 6f 74 20 6e 65 |p size i|s not ne|
|00003bc0| 63 65 73 73 61 72 69 6c | 79 20 31 2e 20 20 42 6f |cessaril|y 1. Bo|
|00003bd0| 74 68 20 74 68 65 20 73 | 74 65 70 20 73 69 7a 65 |th the s|tep size|
|00003be0| 20 61 6e 64 0a 58 20 2a | 20 74 68 65 20 6c 69 6d | and.X *| the lim|
|00003bf0| 69 74 20 6d 61 79 20 64 | 69 66 66 65 72 20 62 65 |it may d|iffer be|
|00003c00| 74 77 65 65 6e 20 70 61 | 73 73 65 73 2e 20 20 54 |tween pa|sses. T|
|00003c10| 68 65 20 65 78 70 65 63 | 74 65 64 20 74 6f 74 61 |he expec|ted tota|
|00003c20| 6c 20 6e 75 6d 62 65 72 | 20 6f 66 20 70 61 73 73 |l number| of pass|
|00003c30| 65 73 0a 58 20 2a 20 69 | 73 20 69 6e 20 63 69 6e |es.X * i|s in cin|
|00003c40| 66 6f 2d 3e 74 6f 74 61 | 6c 5f 70 61 73 73 65 73 |fo->tota|l_passes|
|00003c50| 2c 20 61 6e 64 20 74 68 | 65 20 6e 75 6d 62 65 72 |, and th|e number|
|00003c60| 20 6f 66 20 70 61 73 73 | 65 73 20 61 6c 72 65 61 | of pass|es alrea|
|00003c70| 64 79 20 63 6f 6d 70 6c | 65 74 65 64 20 69 73 0a |dy compl|eted is.|
|00003c80| 58 20 2a 20 69 6e 20 63 | 69 6e 66 6f 2d 3e 63 6f |X * in c|info->co|
|00003c90| 6d 70 6c 65 74 65 64 5f | 70 61 73 73 65 73 2e 20 |mpleted_|passes. |
|00003ca0| 20 54 68 75 73 20 74 68 | 65 20 66 72 61 63 74 69 | Thus th|e fracti|
|00003cb0| 6f 6e 20 6f 66 20 77 6f | 72 6b 20 63 6f 6d 70 6c |on of wo|rk compl|
|00003cc0| 65 74 65 64 20 6d 61 79 | 20 62 65 0a 58 20 2a 20 |eted may| be.X * |
|00003cd0| 65 73 74 69 6d 61 74 65 | 64 20 61 73 0a 58 20 2a |estimate|d as.X *|
|00003ce0| 09 09 63 6f 6d 70 6c 65 | 74 65 64 5f 70 61 73 73 |..comple|ted_pass|
|00003cf0| 65 73 20 2b 20 28 6c 6f | 6f 70 63 6f 75 6e 74 65 |es + (lo|opcounte|
|00003d00| 72 2f 6c 6f 6f 70 6c 69 | 6d 69 74 29 0a 58 20 2a |r/loopli|mit).X *|
|00003d10| 09 09 2d 2d 2d 2d 2d 2d | 2d 2d 2d 2d 2d 2d 2d 2d |..------|--------|
|00003d20| 2d 2d 2d 2d 2d 2d 2d 2d | 2d 2d 2d 2d 2d 2d 2d 2d |--------|--------|
|00003d30| 2d 2d 2d 2d 2d 2d 2d 2d | 2d 2d 2d 2d 0a 58 20 2a |--------|----.X *|
|00003d40| 09 09 09 09 74 6f 74 61 | 6c 5f 70 61 73 73 65 73 |....tota|l_passes|
|00003d50| 0a 58 20 2a 20 69 67 6e | 6f 72 69 6e 67 20 74 68 |.X * ign|oring th|
|00003d60| 65 20 66 61 63 74 20 74 | 68 61 74 20 74 68 65 20 |e fact t|hat the |
|00003d70| 70 61 73 73 65 73 20 6d | 61 79 20 6e 6f 74 20 62 |passes m|ay not b|
|00003d80| 65 20 65 71 75 61 6c 20 | 61 6d 6f 75 6e 74 73 20 |e equal |amounts |
|00003d90| 6f 66 20 77 6f 72 6b 2e | 0a 58 20 2a 0a 58 20 2a |of work.|.X *.X *|
|00003da0| 20 57 68 65 6e 20 64 65 | 63 6f 6d 70 72 65 73 73 | When de|compress|
|00003db0| 69 6e 67 2c 20 74 68 65 | 20 74 6f 74 61 6c 5f 70 |ing, the| total_p|
|00003dc0| 61 73 73 65 73 20 66 69 | 67 75 72 65 20 69 73 20 |asses fi|gure is |
|00003dd0| 61 6e 20 65 73 74 69 6d | 61 74 65 20 74 68 61 74 |an estim|ate that|
|00003de0| 20 6d 61 79 20 62 65 0a | 58 20 2a 20 6f 6e 20 74 | may be.|X * on t|
|00003df0| 68 65 20 68 69 67 68 20 | 73 69 64 65 3b 20 63 6f |he high |side; co|
|00003e00| 6d 70 6c 65 74 65 64 5f | 70 61 73 73 65 73 20 77 |mpleted_|passes w|
|00003e10| 69 6c 6c 20 6a 75 6d 70 | 20 62 79 20 6d 6f 72 65 |ill jump| by more|
|00003e20| 20 74 68 61 6e 20 6f 6e | 65 20 69 66 20 73 6f 6d | than on|e if som|
|00003e30| 65 0a 58 20 2a 20 70 61 | 73 73 65 73 20 61 72 65 |e.X * pa|sses are|
|00003e40| 20 73 6b 69 70 70 65 64 | 2e 0a 58 20 2a 2f 0a 58 | skipped|..X */.X|
|00003e50| 0a 58 4d 45 54 48 4f 44 | 44 45 46 20 76 6f 69 64 |.XMETHOD|DEF void|
|00003e60| 0a 58 70 72 6f 67 72 65 | 73 73 5f 6d 6f 6e 69 74 |.Xprogre|ss_monit|
|00003e70| 6f 72 20 28 64 65 63 6f | 6d 70 72 65 73 73 5f 69 |or (deco|mpress_i|
|00003e80| 6e 66 6f 5f 70 74 72 20 | 63 69 6e 66 6f 2c 20 6c |nfo_ptr |cinfo, l|
|00003e90| 6f 6e 67 20 6c 6f 6f 70 | 63 6f 75 6e 74 65 72 2c |ong loop|counter,|
|00003ea0| 20 6c 6f 6e 67 20 6c 6f | 6f 70 6c 69 6d 69 74 29 | long lo|oplimit)|
|00003eb0| 0a 58 7b 0a 58 20 20 2f | 2a 20 64 6f 20 6e 6f 74 |.X{.X /|* do not|
|00003ec0| 68 69 6e 67 20 2a 2f 0a | 58 7d 0a 58 0a 58 0a 58 |hing */.|X}.X.X.X|
|00003ed0| 2f 2a 0a 58 20 2a 20 52 | 65 6c 6f 61 64 20 74 68 |/*.X * R|eload th|
|00003ee0| 65 20 69 6e 70 75 74 20 | 62 75 66 66 65 72 20 61 |e input |buffer a|
|00003ef0| 66 74 65 72 20 69 74 27 | 73 20 62 65 65 6e 20 65 |fter it'|s been e|
|00003f00| 6d 70 74 69 65 64 2c 20 | 61 6e 64 20 72 65 74 75 |mptied, |and retu|
|00003f10| 72 6e 20 74 68 65 20 6e | 65 78 74 20 62 79 74 65 |rn the n|ext byte|
|00003f20| 2e 0a 58 20 2a 20 53 65 | 65 20 74 68 65 20 4a 47 |..X * Se|e the JG|
|00003f30| 45 54 43 20 6d 61 63 72 | 6f 20 66 6f 72 20 63 61 |ETC macr|o for ca|
|00003f40| 6c 6c 69 6e 67 20 63 6f | 6e 64 69 74 69 6f 6e 73 |lling co|nditions|
|00003f50| 2e 20 20 4e 6f 74 65 20 | 69 6e 20 70 61 72 74 69 |. Note |in parti|
|00003f60| 63 75 6c 61 72 20 74 68 | 61 74 0a 58 20 2a 20 72 |cular th|at.X * r|
|00003f70| 65 61 64 5f 6a 70 65 67 | 5f 64 61 74 61 20 6d 61 |ead_jpeg|_data ma|
|00003f80| 79 20 4e 4f 54 20 72 65 | 74 75 72 6e 20 45 4f 46 |y NOT re|turn EOF|
|00003f90| 2e 20 20 49 66 20 6e 6f | 20 6d 6f 72 65 20 64 61 |. If no| more da|
|00003fa0| 74 61 20 69 73 20 61 76 | 61 69 6c 61 62 6c 65 2c |ta is av|ailable,|
|00003fb0| 20 69 74 20 6d 75 73 74 | 0a 58 20 2a 20 65 78 69 | it must|.X * exi|
|00003fc0| 74 20 76 69 61 20 45 52 | 52 45 58 49 54 2c 20 6f |t via ER|REXIT, o|
|00003fd0| 72 20 70 65 72 68 61 70 | 73 20 73 79 6e 74 68 65 |r perhap|s synthe|
|00003fe0| 73 69 7a 65 20 66 61 6b | 65 20 64 61 74 61 20 28 |size fak|e data (|
|00003ff0| 73 75 63 68 20 61 73 20 | 61 6e 20 52 53 54 20 6d |such as |an RST m|
|00004000| 61 72 6b 65 72 29 2e 0a | 58 20 2a 20 49 6e 20 74 |arker)..|X * In t|
|00004010| 68 65 20 70 72 65 73 65 | 6e 74 20 69 6d 70 6c 65 |he prese|nt imple|
|00004020| 6d 65 6e 74 61 74 69 6f | 6e 2c 20 77 65 20 69 6e |mentatio|n, we in|
|00004030| 73 65 72 74 20 61 6e 20 | 45 4f 49 20 6d 61 72 6b |sert an |EOI mark|
|00004040| 65 72 3b 20 74 68 69 73 | 20 6d 69 67 68 74 20 6e |er; this| might n|
|00004050| 6f 74 20 62 65 0a 58 20 | 2a 20 61 70 70 72 6f 70 |ot be.X |* approp|
|00004060| 72 69 61 74 65 20 66 6f | 72 20 6e 6f 6e 2d 4a 46 |riate fo|r non-JF|
|00004070| 49 46 20 66 69 6c 65 20 | 66 6f 72 6d 61 74 73 2c |IF file |formats,|
|00004080| 20 62 75 74 20 69 74 20 | 75 73 75 61 6c 6c 79 20 | but it |usually |
|00004090| 61 6c 6c 6f 77 73 20 75 | 73 20 74 6f 20 68 61 6e |allows u|s to han|
|000040a0| 64 6c 65 0a 58 20 2a 20 | 61 20 74 72 75 6e 63 61 |dle.X * |a trunca|
|000040b0| 74 65 64 20 4a 46 49 46 | 20 66 69 6c 65 2e 0a 58 |ted JFIF| file..X|
|000040c0| 20 2a 0a 58 20 2a 20 54 | 68 69 73 20 72 6f 75 74 | *.X * T|his rout|
|000040d0| 69 6e 65 20 63 61 6e 20 | 62 65 20 6f 76 65 72 72 |ine can |be overr|
|000040e0| 69 64 64 65 6e 20 62 79 | 20 74 68 65 20 73 79 73 |idden by| the sys|
|000040f0| 74 65 6d 2d 64 65 70 65 | 6e 64 65 6e 74 20 75 73 |tem-depe|ndent us|
|00004100| 65 72 20 69 6e 74 65 72 | 66 61 63 65 2c 0a 58 20 |er inter|face,.X |
|00004110| 2a 20 69 6e 20 63 61 73 | 65 20 74 68 65 20 64 61 |* in cas|e the da|
|00004120| 74 61 20 73 6f 75 72 63 | 65 20 69 73 20 6e 6f 74 |ta sourc|e is not|
|00004130| 20 61 20 73 74 64 69 6f | 20 73 74 72 65 61 6d 20 | a stdio| stream |
|00004140| 6f 72 20 73 6f 6d 65 20 | 6f 74 68 65 72 20 73 70 |or some |other sp|
|00004150| 65 63 69 61 6c 0a 58 20 | 2a 20 63 6f 6e 64 69 74 |ecial.X |* condit|
|00004160| 69 6f 6e 20 61 70 70 6c | 69 65 73 2e 20 20 4e 6f |ion appl|ies. No|
|00004170| 74 65 2c 20 68 6f 77 65 | 76 65 72 2c 20 74 68 61 |te, howe|ver, tha|
|00004180| 74 20 74 68 69 73 20 63 | 61 70 61 62 69 6c 69 74 |t this c|apabilit|
|00004190| 79 20 6f 6e 6c 79 20 61 | 70 70 6c 69 65 73 20 66 |y only a|pplies f|
|000041a0| 6f 72 0a 58 20 2a 20 4a | 46 49 46 20 6f 72 20 73 |or.X * J|FIF or s|
|000041b0| 69 6d 69 6c 61 72 20 73 | 65 72 69 61 6c 2d 61 63 |imilar s|erial-ac|
|000041c0| 63 65 73 73 20 4a 50 45 | 47 20 66 69 6c 65 20 66 |cess JPE|G file f|
|000041d0| 6f 72 6d 61 74 73 2e 20 | 20 54 68 65 20 69 6e 70 |ormats. | The inp|
|000041e0| 75 74 20 66 69 6c 65 20 | 63 6f 6e 74 72 6f 6c 0a |ut file |control.|
|000041f0| 58 20 2a 20 6d 6f 64 75 | 6c 65 20 66 6f 72 20 61 |X * modu|le for a|
|00004200| 20 72 61 6e 64 6f 6d 2d | 61 63 63 65 73 73 20 66 | random-|access f|
|00004210| 6f 72 6d 61 74 20 73 75 | 63 68 20 61 73 20 54 49 |ormat su|ch as TI|
|00004220| 46 46 2f 4a 50 45 47 20 | 77 6f 75 6c 64 20 6d 6f |FF/JPEG |would mo|
|00004230| 73 74 20 6c 69 6b 65 6c | 79 0a 58 20 2a 20 6f 76 |st likel|y.X * ov|
|00004240| 65 72 72 69 64 65 20 74 | 68 65 20 72 65 61 64 5f |erride t|he read_|
|00004250| 6a 70 65 67 5f 64 61 74 | 61 20 6d 65 74 68 6f 64 |jpeg_dat|a method|
|00004260| 20 77 69 74 68 20 69 74 | 73 20 6f 77 6e 20 72 6f | with it|s own ro|
|00004270| 75 74 69 6e 65 2e 0a 58 | 20 2a 2f 0a 58 0a 58 4d |utine..X| */.X.XM|
|00004280| 45 54 48 4f 44 44 45 46 | 20 69 6e 74 0a 58 72 65 |ETHODDEF| int.Xre|
|00004290| 61 64 5f 6a 70 65 67 5f | 64 61 74 61 20 28 64 65 |ad_jpeg_|data (de|
|000042a0| 63 6f 6d 70 72 65 73 73 | 5f 69 6e 66 6f 5f 70 74 |compress|_info_pt|
|000042b0| 72 20 63 69 6e 66 6f 29 | 0a 58 7b 0a 58 20 20 63 |r cinfo)|.X{.X c|
|000042c0| 69 6e 66 6f 2d 3e 6e 65 | 78 74 5f 69 6e 70 75 74 |info->ne|xt_input|
|000042d0| 5f 62 79 74 65 20 3d 20 | 63 69 6e 66 6f 2d 3e 69 |_byte = |cinfo->i|
|000042e0| 6e 70 75 74 5f 62 75 66 | 66 65 72 20 2b 20 4d 49 |nput_buf|fer + MI|
|000042f0| 4e 5f 55 4e 47 45 54 3b | 0a 58 0a 58 20 20 63 69 |N_UNGET;|.X.X ci|
|00004300| 6e 66 6f 2d 3e 62 79 74 | 65 73 5f 69 6e 5f 62 75 |nfo->byt|es_in_bu|
|00004310| 66 66 65 72 20 3d 20 28 | 69 6e 74 29 20 4a 46 52 |ffer = (|int) JFR|
|00004320| 45 41 44 28 63 69 6e 66 | 6f 2d 3e 69 6e 70 75 74 |EAD(cinf|o->input|
|00004330| 5f 66 69 6c 65 2c 0a 58 | 09 09 09 09 09 63 69 6e |_file,.X|.....cin|
|00004340| 66 6f 2d 3e 6e 65 78 74 | 5f 69 6e 70 75 74 5f 62 |fo->next|_input_b|
|00004350| 79 74 65 2c 0a 58 09 09 | 09 09 09 4a 50 45 47 5f |yte,.X..|...JPEG_|
|00004360| 42 55 46 5f 53 49 5a 45 | 29 3b 0a 58 20 20 0a 58 |BUF_SIZE|);.X .X|
|00004370| 20 20 69 66 20 28 63 69 | 6e 66 6f 2d 3e 62 79 74 | if (ci|nfo->byt|
|00004380| 65 73 5f 69 6e 5f 62 75 | 66 66 65 72 20 3c 3d 20 |es_in_bu|ffer <= |
|00004390| 30 29 20 7b 0a 58 20 20 | 20 20 57 41 52 4e 4d 53 |0) {.X | WARNMS|
|000043a0| 28 63 69 6e 66 6f 2d 3e | 65 6d 65 74 68 6f 64 73 |(cinfo->|emethods|
|000043b0| 2c 20 22 50 72 65 6d 61 | 74 75 72 65 20 45 4f 46 |, "Prema|ture EOF|
|000043c0| 20 69 6e 20 4a 50 45 47 | 20 66 69 6c 65 22 29 3b | in JPEG| file");|
|000043d0| 0a 58 20 20 20 20 63 69 | 6e 66 6f 2d 3e 6e 65 78 |.X ci|nfo->nex|
|000043e0| 74 5f 69 6e 70 75 74 5f | 62 79 74 65 5b 30 5d 20 |t_input_|byte[0] |
|000043f0| 3d 20 28 63 68 61 72 29 | 20 30 78 46 46 3b 0a 58 |= (char)| 0xFF;.X|
|00004400| 20 20 20 20 63 69 6e 66 | 6f 2d 3e 6e 65 78 74 5f | cinf|o->next_|
|00004410| 69 6e 70 75 74 5f 62 79 | 74 65 5b 31 5d 20 3d 20 |input_by|te[1] = |
|00004420| 28 63 68 61 72 29 20 30 | 78 44 39 3b 20 2f 2a 20 |(char) 0|xD9; /* |
|00004430| 45 4f 49 20 6d 61 72 6b | 65 72 20 2a 2f 0a 58 20 |EOI mark|er */.X |
|00004440| 20 20 20 63 69 6e 66 6f | 2d 3e 62 79 74 65 73 5f | cinfo|->bytes_|
|00004450| 69 6e 5f 62 75 66 66 65 | 72 20 3d 20 32 3b 0a 58 |in_buffe|r = 2;.X|
|00004460| 20 20 7d 0a 58 0a 58 20 | 20 72 65 74 75 72 6e 20 | }.X.X | return |
|00004470| 4a 47 45 54 43 28 63 69 | 6e 66 6f 29 3b 0a 58 7d |JGETC(ci|nfo);.X}|
|00004480| 0a 58 0a 58 0a 58 0a 58 | 2f 2a 20 44 65 66 61 75 |.X.X.X.X|/* Defau|
|00004490| 6c 74 20 70 61 72 61 6d | 65 74 65 72 20 73 65 74 |lt param|eter set|
|000044a0| 75 70 20 66 6f 72 20 64 | 65 63 6f 6d 70 72 65 73 |up for d|ecompres|
|000044b0| 73 69 6f 6e 2e 0a 58 20 | 2a 0a 58 20 2a 20 55 73 |sion..X |*.X * Us|
|000044c0| 65 72 20 69 6e 74 65 72 | 66 61 63 65 73 20 74 68 |er inter|faces th|
|000044d0| 61 74 20 64 6f 6e 27 74 | 20 63 68 6f 6f 73 65 20 |at don't| choose |
|000044e0| 74 6f 20 75 73 65 20 74 | 68 69 73 20 72 6f 75 74 |to use t|his rout|
|000044f0| 69 6e 65 20 6d 75 73 74 | 20 64 6f 20 74 68 65 69 |ine must| do thei|
|00004500| 72 0a 58 20 2a 20 6f 77 | 6e 20 73 65 74 75 70 20 |r.X * ow|n setup |
|00004510| 6f 66 20 61 6c 6c 20 74 | 68 65 73 65 20 70 61 72 |of all t|hese par|
|00004520| 61 6d 65 74 65 72 73 2e | 20 20 41 6c 74 65 72 6e |ameters.| Altern|
|00004530| 61 74 65 6c 79 2c 20 79 | 6f 75 20 63 61 6e 20 63 |ately, y|ou can c|
|00004540| 61 6c 6c 20 74 68 69 73 | 0a 58 20 2a 20 74 6f 20 |all this|.X * to |
|00004550| 65 73 74 61 62 6c 69 73 | 68 20 64 65 66 61 75 6c |establis|h defaul|
|00004560| 74 73 20 61 6e 64 20 74 | 68 65 6e 20 61 6c 74 65 |ts and t|hen alte|
|00004570| 72 20 70 61 72 61 6d 65 | 74 65 72 73 20 73 65 6c |r parame|ters sel|
|00004580| 65 63 74 69 76 65 6c 79 | 2e 20 20 54 68 69 73 0a |ectively|. This.|
|00004590| 58 20 2a 20 69 73 20 74 | 68 65 20 72 65 63 6f 6d |X * is t|he recom|
|000045a0| 6d 65 6e 64 65 64 20 61 | 70 70 72 6f 61 63 68 20 |mended a|pproach |
|000045b0| 73 69 6e 63 65 2c 20 69 | 66 20 77 65 20 61 64 64 |since, i|f we add|
|000045c0| 20 61 6e 79 20 6e 65 77 | 20 70 61 72 61 6d 65 74 | any new| paramet|
|000045d0| 65 72 73 2c 0a 58 20 2a | 20 79 6f 75 72 20 63 6f |ers,.X *| your co|
|000045e0| 64 65 20 77 69 6c 6c 20 | 73 74 69 6c 6c 20 77 6f |de will |still wo|
|000045f0| 72 6b 20 28 74 68 65 79 | 27 6c 6c 20 62 65 20 73 |rk (they|'ll be s|
|00004600| 65 74 20 74 6f 20 72 65 | 61 73 6f 6e 61 62 6c 65 |et to re|asonable|
|00004610| 20 64 65 66 61 75 6c 74 | 73 29 2e 0a 58 20 2a 0a | default|s)..X *.|
|00004620| 58 20 2a 20 73 74 61 6e | 64 61 72 64 5f 62 75 66 |X * stan|dard_buf|
|00004630| 66 65 72 69 6e 67 20 73 | 68 6f 75 6c 64 20 62 65 |fering s|hould be|
|00004640| 20 54 52 55 45 20 74 6f | 20 63 61 75 73 65 20 61 | TRUE to| cause a|
|00004650| 6e 20 69 6e 70 75 74 20 | 62 75 66 66 65 72 20 74 |n input |buffer t|
|00004660| 6f 20 62 65 20 61 6c 6c | 6f 63 61 74 65 64 0a 58 |o be all|ocated.X|
|00004670| 20 2a 20 28 74 68 65 20 | 6e 6f 72 6d 61 6c 20 63 | * (the |normal c|
|00004680| 61 73 65 29 3b 20 69 66 | 20 46 41 4c 53 45 2c 20 |ase); if| FALSE, |
|00004690| 74 68 65 20 75 73 65 72 | 20 69 6e 74 65 72 66 61 |the user| interfa|
|000046a0| 63 65 20 6d 75 73 74 20 | 70 72 6f 76 69 64 65 20 |ce must |provide |
|000046b0| 61 20 62 75 66 66 65 72 | 2e 0a 58 20 2a 20 54 68 |a buffer|..X * Th|
|000046c0| 69 73 20 6f 70 74 69 6f | 6e 20 69 73 20 6d 6f 73 |is optio|n is mos|
|000046d0| 74 20 75 73 65 66 75 6c | 20 69 6e 20 74 68 65 20 |t useful| in the |
|000046e0| 63 61 73 65 20 74 68 61 | 74 20 74 68 65 20 62 75 |case tha|t the bu|
|000046f0| 66 66 65 72 20 6d 75 73 | 74 20 6e 6f 74 20 62 65 |ffer mus|t not be|
|00004700| 20 66 72 65 65 64 0a 58 | 20 2a 20 61 74 20 74 68 | freed.X| * at th|
|00004710| 65 20 65 6e 64 20 6f 66 | 20 61 6e 20 69 6d 61 67 |e end of| an imag|
|00004720| 65 2e 20 20 28 46 6f 72 | 20 65 78 61 6d 70 6c 65 |e. (For| example|
|00004730| 2c 20 77 68 65 6e 20 72 | 65 61 64 69 6e 67 20 61 |, when r|eading a|
|00004740| 20 73 65 71 75 65 6e 63 | 65 20 6f 66 20 69 6d 61 | sequenc|e of ima|
|00004750| 67 65 73 0a 58 20 2a 20 | 66 72 6f 6d 20 61 20 73 |ges.X * |from a s|
|00004760| 69 6e 67 6c 65 20 66 69 | 6c 65 2c 20 74 68 65 20 |ingle fi|le, the |
|00004770| 72 65 6d 61 69 6e 69 6e | 67 20 64 61 74 61 20 69 |remainin|g data i|
|00004780| 6e 20 74 68 65 20 62 75 | 66 66 65 72 20 72 65 70 |n the bu|ffer rep|
|00004790| 72 65 73 65 6e 74 73 20 | 74 68 65 0a 58 20 2a 20 |resents |the.X * |
|000047a0| 73 74 61 72 74 20 6f 66 | 20 74 68 65 20 6e 65 78 |start of| the nex|
|000047b0| 74 20 69 6d 61 67 65 20 | 61 6e 64 20 6d 75 73 74 |t image |and must|
|000047c0| 6e 27 74 20 62 65 20 64 | 69 73 63 61 72 64 65 64 |n't be d|iscarded|
|000047d0| 2e 29 20 20 54 6f 20 68 | 61 6e 64 6c 65 20 74 68 |.) To h|andle th|
|000047e0| 69 73 2c 0a 58 20 2a 20 | 61 6c 6c 6f 63 61 74 65 |is,.X * |allocate|
|000047f0| 20 74 68 65 20 69 6e 70 | 75 74 20 62 75 66 66 65 | the inp|ut buffe|
|00004800| 72 20 79 6f 75 72 73 65 | 6c 66 20 61 74 20 73 74 |r yourse|lf at st|
|00004810| 61 72 74 75 70 2c 20 57 | 49 54 48 4f 55 54 20 75 |artup, W|ITHOUT u|
|00004820| 73 69 6e 67 20 61 6c 6c | 6f 63 5f 73 6d 61 6c 6c |sing all|oc_small|
|00004830| 0a 58 20 2a 20 28 70 72 | 6f 62 61 62 6c 79 20 61 |.X * (pr|obably a|
|00004840| 20 64 69 72 65 63 74 20 | 63 61 6c 6c 20 74 6f 20 | direct |call to |
|00004850| 6d 61 6c 6c 6f 63 28 29 | 20 69 6e 73 74 65 61 64 |malloc()| instead|
|00004860| 29 2e 20 20 54 68 65 6e | 20 70 61 73 73 20 46 41 |). Then| pass FA|
|00004870| 4c 53 45 20 6f 6e 20 65 | 61 63 68 0a 58 20 2a 20 |LSE on e|ach.X * |
|00004880| 63 61 6c 6c 20 74 6f 20 | 6a 5f 64 5f 64 65 66 61 |call to |j_d_defa|
|00004890| 75 6c 74 73 20 74 6f 20 | 65 6e 73 75 72 65 20 74 |ults to |ensure t|
|000048a0| 68 65 20 62 75 66 66 65 | 72 20 73 74 61 74 65 20 |he buffe|r state |
|000048b0| 69 73 20 6e 6f 74 20 6d | 6f 64 69 66 69 65 64 2e |is not m|odified.|
|000048c0| 0a 58 20 2a 0a 58 20 2a | 20 49 66 20 74 68 65 20 |.X *.X *| If the |
|000048d0| 73 6f 75 72 63 65 20 6f | 66 20 74 68 65 20 4a 50 |source o|f the JP|
|000048e0| 45 47 20 64 61 74 61 20 | 69 73 20 6e 6f 74 20 61 |EG data |is not a|
|000048f0| 20 73 74 64 69 6f 20 73 | 74 72 65 61 6d 2c 20 6f | stdio s|tream, o|
|00004900| 76 65 72 72 69 64 65 20 | 74 68 65 0a 58 20 2a 20 |verride |the.X * |
|00004910| 72 65 61 64 5f 6a 70 65 | 67 5f 64 61 74 61 20 6d |read_jpe|g_data m|
|00004920| 65 74 68 6f 64 20 77 69 | 74 68 20 79 6f 75 72 20 |ethod wi|th your |
|00004930| 6f 77 6e 20 72 6f 75 74 | 69 6e 65 20 61 66 74 65 |own rout|ine afte|
|00004940| 72 20 63 61 6c 6c 69 6e | 67 20 6a 5f 64 5f 64 65 |r callin|g j_d_de|
|00004950| 66 61 75 6c 74 73 2e 0a | 58 20 2a 20 59 6f 75 20 |faults..|X * You |
|00004960| 63 61 6e 20 73 74 69 6c | 6c 20 75 73 65 20 74 68 |can stil|l use th|
|00004970| 65 20 73 74 61 6e 64 61 | 72 64 20 62 75 66 66 65 |e standa|rd buffe|
|00004980| 72 20 69 66 20 69 74 27 | 73 20 61 70 70 72 6f 70 |r if it'|s approp|
|00004990| 72 69 61 74 65 2e 0a 58 | 20 2a 0a 58 20 2a 20 43 |riate..X| *.X * C|
|000049a0| 41 55 54 49 4f 4e 3a 20 | 69 66 20 79 6f 75 20 77 |AUTION: |if you w|
|000049b0| 61 6e 74 20 74 6f 20 64 | 65 63 6f 6d 70 72 65 73 |ant to d|ecompres|
|000049c0| 73 20 6d 75 6c 74 69 70 | 6c 65 20 69 6d 61 67 65 |s multip|le image|
|000049d0| 73 20 70 65 72 20 72 75 | 6e 2c 20 69 74 27 73 20 |s per ru|n, it's |
|000049e0| 6e 65 63 65 73 73 61 72 | 79 0a 58 20 2a 20 74 6f |necessar|y.X * to|
|000049f0| 20 63 61 6c 6c 20 6a 5f | 64 5f 64 65 66 61 75 6c | call j_|d_defaul|
|00004a00| 74 73 20 62 65 66 6f 72 | 65 20 2a 65 61 63 68 2a |ts befor|e *each*|
|00004a10| 20 63 61 6c 6c 20 74 6f | 20 6a 70 65 67 5f 64 65 | call to| jpeg_de|
|00004a20| 63 6f 6d 70 72 65 73 73 | 2c 20 73 69 6e 63 65 20 |compress|, since |
|00004a30| 73 75 62 73 69 64 69 61 | 72 79 0a 58 20 2a 20 73 |subsidia|ry.X * s|
|00004a40| 74 72 75 63 74 75 72 65 | 73 20 6c 69 6b 65 20 74 |tructure|s like t|
|00004a50| 68 65 20 71 75 61 6e 74 | 69 7a 61 74 69 6f 6e 20 |he quant|ization |
|00004a60| 74 61 62 6c 65 73 20 61 | 72 65 20 61 75 74 6f 6d |tables a|re autom|
|00004a70| 61 74 69 63 61 6c 6c 79 | 20 66 72 65 65 64 20 64 |atically| freed d|
|00004a80| 75 72 69 6e 67 0a 58 20 | 2a 20 63 6c 65 61 6e 75 |uring.X |* cleanu|
|00004a90| 70 2e 0a 58 20 2a 2f 0a | 58 0a 58 47 4c 4f 42 41 |p..X */.|X.XGLOBA|
|00004aa0| 4c 20 76 6f 69 64 0a 58 | 6a 5f 64 5f 64 65 66 61 |L void.X|j_d_defa|
|00004ab0| 75 6c 74 73 20 28 64 65 | 63 6f 6d 70 72 65 73 73 |ults (de|compress|
|00004ac0| 5f 69 6e 66 6f 5f 70 74 | 72 20 63 69 6e 66 6f 2c |_info_pt|r cinfo,|
|00004ad0| 20 62 6f 6f 6c 65 61 6e | 20 73 74 61 6e 64 61 72 | boolean| standar|
|00004ae0| 64 5f 62 75 66 66 65 72 | 69 6e 67 29 0a 58 2f 2a |d_buffer|ing).X/*|
|00004af0| 20 4e 42 3a 20 74 68 65 | 20 65 78 74 65 72 6e 61 | NB: the| externa|
|00004b00| 6c 20 6d 65 74 68 6f 64 | 73 20 6d 75 73 74 20 61 |l method|s must a|
|00004b10| 6c 72 65 61 64 79 20 62 | 65 20 73 65 74 20 75 70 |lready b|e set up|
|00004b20| 2e 20 2a 2f 0a 58 7b 0a | 58 20 20 73 68 6f 72 74 |. */.X{.|X short|
|00004b30| 20 69 3b 0a 58 0a 58 20 | 20 2f 2a 20 49 6e 69 74 | i;.X.X | /* Init|
|00004b40| 69 61 6c 69 7a 65 20 70 | 6f 69 6e 74 65 72 73 20 |ialize p|ointers |
|00004b50| 61 73 20 6e 65 65 64 65 | 64 20 74 6f 20 6d 61 72 |as neede|d to mar|
|00004b60| 6b 20 73 74 75 66 66 20 | 75 6e 61 6c 6c 6f 63 61 |k stuff |unalloca|
|00004b70| 74 65 64 2e 20 2a 2f 0a | 58 20 20 2f 2a 20 4f 75 |ted. */.|X /* Ou|
|00004b80| 74 65 72 20 61 70 70 6c | 69 63 61 74 69 6f 6e 20 |ter appl|ication |
|00004b90| 6d 61 79 20 66 69 6c 6c | 20 69 6e 20 64 65 66 61 |may fill| in defa|
|00004ba0| 75 6c 74 20 74 61 62 6c | 65 73 20 66 6f 72 20 61 |ult tabl|es for a|
|00004bb0| 62 62 72 65 76 69 61 74 | 65 64 20 66 69 6c 65 73 |bbreviat|ed files|
|00004bc0| 2e 2e 2e 20 2a 2f 0a 58 | 20 20 63 69 6e 66 6f 2d |... */.X| cinfo-|
|00004bd0| 3e 63 6f 6d 70 5f 69 6e | 66 6f 20 3d 20 4e 55 4c |>comp_in|fo = NUL|
|00004be0| 4c 3b 0a 58 20 20 66 6f | 72 20 28 69 20 3d 20 30 |L;.X fo|r (i = 0|
|00004bf0| 3b 20 69 20 3c 20 4e 55 | 4d 5f 51 55 41 4e 54 5f |; i < NU|M_QUANT_|
|00004c00| 54 42 4c 53 3b 20 69 2b | 2b 29 0a 58 20 20 20 20 |TBLS; i+|+).X |
|00004c10| 63 69 6e 66 6f 2d 3e 71 | 75 61 6e 74 5f 74 62 6c |cinfo->q|uant_tbl|
|00004c20| 5f 70 74 72 73 5b 69 5d | 20 3d 20 4e 55 4c 4c 3b |_ptrs[i]| = NULL;|
|00004c30| 0a 58 20 20 66 6f 72 20 | 28 69 20 3d 20 30 3b 20 |.X for |(i = 0; |
|00004c40| 69 20 3c 20 4e 55 4d 5f | 48 55 46 46 5f 54 42 4c |i < NUM_|HUFF_TBL|
|00004c50| 53 3b 20 69 2b 2b 29 20 | 7b 0a 58 20 20 20 20 63 |S; i++) |{.X c|
|00004c60| 69 6e 66 6f 2d 3e 64 63 | 5f 68 75 66 66 5f 74 62 |info->dc|_huff_tb|
|00004c70| 6c 5f 70 74 72 73 5b 69 | 5d 20 3d 20 4e 55 4c 4c |l_ptrs[i|] = NULL|
|00004c80| 3b 0a 58 20 20 20 20 63 | 69 6e 66 6f 2d 3e 61 63 |;.X c|info->ac|
|00004c90| 5f 68 75 66 66 5f 74 62 | 6c 5f 70 74 72 73 5b 69 |_huff_tb|l_ptrs[i|
|00004ca0| 5d 20 3d 20 4e 55 4c 4c | 3b 0a 58 20 20 7d 0a 58 |] = NULL|;.X }.X|
|00004cb0| 20 20 63 69 6e 66 6f 2d | 3e 63 6f 6c 6f 72 6d 61 | cinfo-|>colorma|
|00004cc0| 70 20 3d 20 4e 55 4c 4c | 3b 0a 58 0a 58 20 20 2f |p = NULL|;.X.X /|
|00004cd0| 2a 20 44 65 66 61 75 6c | 74 20 74 6f 20 52 47 42 |* Defaul|t to RGB|
|00004ce0| 20 6f 75 74 70 75 74 20 | 2a 2f 0a 58 20 20 2f 2a | output |*/.X /*|
|00004cf0| 20 55 49 20 63 61 6e 20 | 6f 76 65 72 72 69 64 65 | UI can |override|
|00004d00| 20 62 79 20 63 68 61 6e | 67 69 6e 67 20 6f 75 74 | by chan|ging out|
|00004d10| 5f 63 6f 6c 6f 72 5f 73 | 70 61 63 65 20 2a 2f 0a |_color_s|pace */.|
|00004d20| 58 20 20 63 69 6e 66 6f | 2d 3e 6f 75 74 5f 63 6f |X cinfo|->out_co|
|00004d30| 6c 6f 72 5f 73 70 61 63 | 65 20 3d 20 43 53 5f 52 |lor_spac|e = CS_R|
|00004d40| 47 42 3b 0a 58 20 20 63 | 69 6e 66 6f 2d 3e 6a 70 |GB;.X c|info->jp|
|00004d50| 65 67 5f 63 6f 6c 6f 72 | 5f 73 70 61 63 65 20 3d |eg_color|_space =|
|00004d60| 20 43 53 5f 55 4e 4b 4e | 4f 57 4e 3b 0a 58 20 20 | CS_UNKN|OWN;.X |
|00004d70| 2f 2a 20 53 65 74 74 69 | 6e 67 20 61 6e 79 20 6f |/* Setti|ng any o|
|00004d80| 74 68 65 72 20 76 61 6c | 75 65 20 69 6e 20 6a 70 |ther val|ue in jp|
|00004d90| 65 67 5f 63 6f 6c 6f 72 | 5f 73 70 61 63 65 20 6f |eg_color|_space o|
|00004da0| 76 65 72 72 69 64 65 73 | 20 68 65 75 72 69 73 74 |verrides| heurist|
|00004db0| 69 63 73 20 69 6e 20 2a | 2f 0a 58 20 20 2f 2a 20 |ics in *|/.X /* |
|00004dc0| 6a 72 64 6a 66 69 66 2e | 63 2e 20 20 54 68 61 74 |jrdjfif.|c. That|
|00004dd0| 20 6d 69 67 68 74 20 62 | 65 20 75 73 65 66 75 6c | might b|e useful|
|00004de0| 20 77 68 65 6e 20 72 65 | 61 64 69 6e 67 20 6e 6f | when re|ading no|
|00004df0| 6e 2d 4a 46 49 46 20 4a | 50 45 47 20 66 69 6c 65 |n-JFIF J|PEG file|
|00004e00| 73 2c 20 2a 2f 0a 58 20 | 20 2f 2a 20 62 75 74 20 |s, */.X | /* but |
|00004e10| 6f 72 64 69 6e 61 72 69 | 6c 79 20 74 68 65 20 55 |ordinari|ly the U|
|00004e20| 49 20 73 68 6f 75 6c 64 | 6e 27 74 20 63 68 61 6e |I should|n't chan|
|00004e30| 67 65 20 69 74 2e 20 2a | 2f 0a 58 20 20 0a 58 20 |ge it. *|/.X .X |
|00004e40| 20 2f 2a 20 44 65 66 61 | 75 6c 74 20 74 6f 20 6e | /* Defa|ult to n|
|00004e50| 6f 20 67 61 6d 6d 61 20 | 63 6f 72 72 65 63 74 69 |o gamma |correcti|
|00004e60| 6f 6e 20 6f 66 20 6f 75 | 74 70 75 74 20 2a 2f 0a |on of ou|tput */.|
|00004e70| 58 20 20 63 69 6e 66 6f | 2d 3e 6f 75 74 70 75 74 |X cinfo|->output|
|00004e80| 5f 67 61 6d 6d 61 20 3d | 20 31 2e 30 3b 0a 58 20 |_gamma =| 1.0;.X |
|00004e90| 20 0a 58 20 20 2f 2a 20 | 44 65 66 61 75 6c 74 20 | .X /* |Default |
|00004ea0| 74 6f 20 6e 6f 20 63 6f | 6c 6f 72 20 71 75 61 6e |to no co|lor quan|
|00004eb0| 74 69 7a 61 74 69 6f 6e | 20 2a 2f 0a 58 20 20 63 |tization| */.X c|
|00004ec0| 69 6e 66 6f 2d 3e 71 75 | 61 6e 74 69 7a 65 5f 63 |info->qu|antize_c|
|00004ed0| 6f 6c 6f 72 73 20 3d 20 | 46 41 4c 53 45 3b 0a 58 |olors = |FALSE;.X|
|00004ee0| 20 20 2f 2a 20 62 75 74 | 20 73 65 74 20 72 65 61 | /* but| set rea|
|00004ef0| 73 6f 6e 61 62 6c 65 20 | 64 65 66 61 75 6c 74 20 |sonable |default |
|00004f00| 70 61 72 61 6d 65 74 65 | 72 73 20 66 6f 72 20 71 |paramete|rs for q|
|00004f10| 75 61 6e 74 69 7a 61 74 | 69 6f 6e 2c 20 2a 2f 0a |uantizat|ion, */.|
|00004f20| 58 20 20 2f 2a 20 73 6f | 20 74 68 61 74 20 74 75 |X /* so| that tu|
|00004f30| 72 6e 69 6e 67 20 6f 6e | 20 71 75 61 6e 74 69 7a |rning on| quantiz|
|00004f40| 65 5f 63 6f 6c 6f 72 73 | 20 69 73 20 73 75 66 66 |e_colors| is suff|
|00004f50| 69 63 69 65 6e 74 20 74 | 6f 20 64 6f 20 73 6f 6d |icient t|o do som|
|00004f60| 65 74 68 69 6e 67 20 75 | 73 65 66 75 6c 20 2a 2f |ething u|seful */|
|00004f70| 0a 58 20 20 63 69 6e 66 | 6f 2d 3e 74 77 6f 5f 70 |.X cinf|o->two_p|
|00004f80| 61 73 73 5f 71 75 61 6e | 74 69 7a 65 20 3d 20 54 |ass_quan|tize = T|
|00004f90| 52 55 45 3b 0a 58 20 20 | 63 69 6e 66 6f 2d 3e 75 |RUE;.X |cinfo->u|
|00004fa0| 73 65 5f 64 69 74 68 65 | 72 69 6e 67 20 3d 20 54 |se_dithe|ring = T|
|00004fb0| 52 55 45 3b 0a 58 20 20 | 63 69 6e 66 6f 2d 3e 64 |RUE;.X |cinfo->d|
|00004fc0| 65 73 69 72 65 64 5f 6e | 75 6d 62 65 72 5f 6f 66 |esired_n|umber_of|
|00004fd0| 5f 63 6f 6c 6f 72 73 20 | 3d 20 32 35 36 3b 0a 58 |_colors |= 256;.X|
|00004fe0| 20 20 0a 58 20 20 2f 2a | 20 44 65 66 61 75 6c 74 | .X /*| Default|
|00004ff0| 20 74 6f 20 6e 6f 20 73 | 6d 6f 6f 74 68 69 6e 67 | to no s|moothing|
|00005000| 20 2a 2f 0a 58 20 20 63 | 69 6e 66 6f 2d 3e 64 6f | */.X c|info->do|
|00005010| 5f 62 6c 6f 63 6b 5f 73 | 6d 6f 6f 74 68 69 6e 67 |_block_s|moothing|
|00005020| 20 3d 20 46 41 4c 53 45 | 3b 0a 58 20 20 63 69 6e | = FALSE|;.X cin|
|00005030| 66 6f 2d 3e 64 6f 5f 70 | 69 78 65 6c 5f 73 6d 6f |fo->do_p|ixel_smo|
|00005040| 6f 74 68 69 6e 67 20 3d | 20 46 41 4c 53 45 3b 0a |othing =| FALSE;.|
|00005050| 58 20 20 0a 58 20 20 2f | 2a 20 41 6c 6c 6f 63 61 |X .X /|* Alloca|
|00005060| 74 65 20 6d 65 6d 6f 72 | 79 20 66 6f 72 20 69 6e |te memor|y for in|
|00005070| 70 75 74 20 62 75 66 66 | 65 72 2c 20 75 6e 6c 65 |put buff|er, unle|
|00005080| 73 73 20 6f 75 74 65 72 | 20 61 70 70 6c 69 63 61 |ss outer| applica|
|00005090| 74 69 6f 6e 20 70 72 6f | 76 69 64 65 73 20 69 74 |tion pro|vides it|
|000050a0| 2e 20 2a 2f 0a 58 20 20 | 69 66 20 28 73 74 61 6e |. */.X |if (stan|
|000050b0| 64 61 72 64 5f 62 75 66 | 66 65 72 69 6e 67 29 20 |dard_buf|fering) |
|000050c0| 7b 0a 58 20 20 20 20 63 | 69 6e 66 6f 2d 3e 69 6e |{.X c|info->in|
|000050d0| 70 75 74 5f 62 75 66 66 | 65 72 20 3d 20 28 63 68 |put_buff|er = (ch|
|000050e0| 61 72 20 2a 29 20 28 2a | 63 69 6e 66 6f 2d 3e 65 |ar *) (*|cinfo->e|
|000050f0| 6d 65 74 68 6f 64 73 2d | 3e 61 6c 6c 6f 63 5f 73 |methods-|>alloc_s|
|00005100| 6d 61 6c 6c 29 0a 58 09 | 09 09 09 09 28 28 73 69 |mall).X.|....((si|
|00005110| 7a 65 5f 74 29 20 28 4a | 50 45 47 5f 42 55 46 5f |ze_t) (J|PEG_BUF_|
|00005120| 53 49 5a 45 20 2b 20 4d | 49 4e 5f 55 4e 47 45 54 |SIZE + M|IN_UNGET|
|00005130| 29 29 3b 0a 58 20 20 20 | 20 63 69 6e 66 6f 2d 3e |));.X | cinfo->|
|00005140| 62 79 74 65 73 5f 69 6e | 5f 62 75 66 66 65 72 20 |bytes_in|_buffer |
|00005150| 3d 20 30 3b 09 2f 2a 20 | 69 6e 69 74 69 61 6c 69 |= 0;./* |initiali|
|00005160| 7a 65 20 62 75 66 66 65 | 72 20 74 6f 20 65 6d 70 |ze buffe|r to emp|
|00005170| 74 79 20 2a 2f 0a 58 20 | 20 7d 0a 58 0a 58 20 20 |ty */.X | }.X.X |
|00005180| 2f 2a 20 49 6e 73 74 61 | 6c 6c 20 73 74 61 6e 64 |/* Insta|ll stand|
|00005190| 61 72 64 20 62 75 66 66 | 65 72 2d 72 65 6c 6f 61 |ard buff|er-reloa|
|000051a0| 64 69 6e 67 20 6d 65 74 | 68 6f 64 20 28 6f 75 74 |ding met|hod (out|
|000051b0| 65 72 20 63 6f 64 65 20 | 6d 61 79 20 6f 76 65 72 |er code |may over|
|000051c0| 72 69 64 65 29 2e 20 2a | 2f 0a 58 20 20 63 69 6e |ride). *|/.X cin|
|000051d0| 66 6f 2d 3e 6d 65 74 68 | 6f 64 73 2d 3e 72 65 61 |fo->meth|ods->rea|
|000051e0| 64 5f 6a 70 65 67 5f 64 | 61 74 61 20 3d 20 72 65 |d_jpeg_d|ata = re|
|000051f0| 61 64 5f 6a 70 65 67 5f | 64 61 74 61 3b 0a 58 0a |ad_jpeg_|data;.X.|
|00005200| 58 20 20 2f 2a 20 49 6e | 73 74 61 6c 6c 20 64 65 |X /* In|stall de|
|00005210| 66 61 75 6c 74 20 64 6f | 2d 6e 6f 74 68 69 6e 67 |fault do|-nothing|
|00005220| 20 70 72 6f 67 72 65 73 | 73 20 6d 6f 6e 69 74 6f | progres|s monito|
|00005230| 72 69 6e 67 20 6d 65 74 | 68 6f 64 2e 20 2a 2f 0a |ring met|hod. */.|
|00005240| 58 20 20 63 69 6e 66 6f | 2d 3e 6d 65 74 68 6f 64 |X cinfo|->method|
|00005250| 73 2d 3e 70 72 6f 67 72 | 65 73 73 5f 6d 6f 6e 69 |s->progr|ess_moni|
|00005260| 74 6f 72 20 3d 20 70 72 | 6f 67 72 65 73 73 5f 6d |tor = pr|ogress_m|
|00005270| 6f 6e 69 74 6f 72 3b 0a | 58 7d 0a 45 4e 44 5f 4f |onitor;.|X}.END_O|
|00005280| 46 5f 46 49 4c 45 0a 20 | 20 69 66 20 74 65 73 74 |F_FILE. | if test|
|00005290| 20 36 35 32 39 20 2d 6e | 65 20 60 77 63 20 2d 63 | 6529 -n|e `wc -c|
|000052a0| 20 3c 27 6a 64 64 65 66 | 6c 74 73 2e 63 27 60 3b | <'jddef|lts.c'`;|
|000052b0| 20 74 68 65 6e 0a 20 20 | 20 20 65 63 68 6f 20 73 | then. | echo s|
|000052c0| 68 61 72 3a 20 5c 22 27 | 6a 64 64 65 66 6c 74 73 |har: \"'|jddeflts|
|000052d0| 2e 63 27 5c 22 20 75 6e | 70 61 63 6b 65 64 20 77 |.c'\" un|packed w|
|000052e0| 69 74 68 20 77 72 6f 6e | 67 20 73 69 7a 65 21 0a |ith wron|g size!.|
|000052f0| 20 20 66 69 0a 20 20 23 | 20 65 6e 64 20 6f 66 20 | fi. #| end of |
|00005300| 27 6a 64 64 65 66 6c 74 | 73 2e 63 27 0a 66 69 0a |'jddeflt|s.c'.fi.|
|00005310| 69 66 20 74 65 73 74 20 | 2d 66 20 27 6a 6d 65 6d |if test |-f 'jmem|
|00005320| 6e 61 6d 65 2e 63 27 20 | 2d 61 20 22 24 7b 31 7d |name.c' |-a "${1}|
|00005330| 22 20 21 3d 20 22 2d 63 | 22 20 3b 20 74 68 65 6e |" != "-c|" ; then|
|00005340| 20 0a 20 20 65 63 68 6f | 20 73 68 61 72 3a 20 57 | . echo| shar: W|
|00005350| 69 6c 6c 20 6e 6f 74 20 | 63 6c 6f 62 62 65 72 20 |ill not |clobber |
|00005360| 65 78 69 73 74 69 6e 67 | 20 66 69 6c 65 20 5c 22 |existing| file \"|
|00005370| 27 6a 6d 65 6d 6e 61 6d | 65 2e 63 27 5c 22 0a 65 |'jmemnam|e.c'\".e|
|00005380| 6c 73 65 0a 20 20 65 63 | 68 6f 20 73 68 61 72 3a |lse. ec|ho shar:|
|00005390| 20 45 78 74 72 61 63 74 | 69 6e 67 20 5c 22 27 6a | Extract|ing \"'j|
|000053a0| 6d 65 6d 6e 61 6d 65 2e | 63 27 5c 22 20 5c 28 37 |memname.|c'\" \(7|
|000053b0| 37 37 39 20 63 68 61 72 | 61 63 74 65 72 73 5c 29 |779 char|acters\)|
|000053c0| 0a 20 20 73 65 64 20 22 | 73 2f 5e 58 2f 2f 22 20 |. sed "|s/^X//" |
|000053d0| 3e 27 6a 6d 65 6d 6e 61 | 6d 65 2e 63 27 20 3c 3c |>'jmemna|me.c' <<|
|000053e0| 27 45 4e 44 5f 4f 46 5f | 46 49 4c 45 27 0a 58 2f |'END_OF_|FILE'.X/|
|000053f0| 2a 0a 58 20 2a 20 6a 6d | 65 6d 6e 61 6d 65 2e 63 |*.X * jm|emname.c|
|00005400| 20 20 28 6a 6d 65 6d 73 | 79 73 2e 63 29 0a 58 20 | (jmems|ys.c).X |
|00005410| 2a 0a 58 20 2a 20 43 6f | 70 79 72 69 67 68 74 20 |*.X * Co|pyright |
|00005420| 28 43 29 20 31 39 39 32 | 2c 20 54 68 6f 6d 61 73 |(C) 1992|, Thomas|
|00005430| 20 47 2e 20 4c 61 6e 65 | 2e 0a 58 20 2a 20 54 68 | G. Lane|..X * Th|
|00005440| 69 73 20 66 69 6c 65 20 | 69 73 20 70 61 72 74 20 |is file |is part |
|00005450| 6f 66 20 74 68 65 20 49 | 6e 64 65 70 65 6e 64 65 |of the I|ndepende|
|00005460| 6e 74 20 4a 50 45 47 20 | 47 72 6f 75 70 27 73 20 |nt JPEG |Group's |
|00005470| 73 6f 66 74 77 61 72 65 | 2e 0a 58 20 2a 20 46 6f |software|..X * Fo|
|00005480| 72 20 63 6f 6e 64 69 74 | 69 6f 6e 73 20 6f 66 20 |r condit|ions of |
|00005490| 64 69 73 74 72 69 62 75 | 74 69 6f 6e 20 61 6e 64 |distribu|tion and|
|000054a0| 20 75 73 65 2c 20 73 65 | 65 20 74 68 65 20 61 63 | use, se|e the ac|
|000054b0| 63 6f 6d 70 61 6e 79 69 | 6e 67 20 52 45 41 44 4d |companyi|ng READM|
|000054c0| 45 20 66 69 6c 65 2e 0a | 58 20 2a 0a 58 20 2a 20 |E file..|X *.X * |
|000054d0| 54 68 69 73 20 66 69 6c | 65 20 70 72 6f 76 69 64 |This fil|e provid|
|000054e0| 65 73 20 61 20 67 65 6e | 65 72 69 63 20 69 6d 70 |es a gen|eric imp|
|000054f0| 6c 65 6d 65 6e 74 61 74 | 69 6f 6e 20 6f 66 20 74 |lementat|ion of t|
|00005500| 68 65 20 73 79 73 74 65 | 6d 2d 64 65 70 65 6e 64 |he syste|m-depend|
|00005510| 65 6e 74 0a 58 20 2a 20 | 70 6f 72 74 69 6f 6e 20 |ent.X * |portion |
|00005520| 6f 66 20 74 68 65 20 4a | 50 45 47 20 6d 65 6d 6f |of the J|PEG memo|
|00005530| 72 79 20 6d 61 6e 61 67 | 65 72 2e 20 20 54 68 69 |ry manag|er. Thi|
|00005540| 73 20 69 6d 70 6c 65 6d | 65 6e 74 61 74 69 6f 6e |s implem|entation|
|00005550| 20 61 73 73 75 6d 65 73 | 20 74 68 61 74 0a 58 20 | assumes| that.X |
|00005560| 2a 20 79 6f 75 20 6d 75 | 73 74 20 65 78 70 6c 69 |* you mu|st expli|
|00005570| 63 69 74 6c 79 20 63 6f | 6e 73 74 72 75 63 74 20 |citly co|nstruct |
|00005580| 61 20 6e 61 6d 65 20 66 | 6f 72 20 65 61 63 68 20 |a name f|or each |
|00005590| 74 65 6d 70 20 66 69 6c | 65 2e 0a 58 20 2a 20 41 |temp fil|e..X * A|
|000055a0| 6c 73 6f 2c 20 74 68 65 | 20 70 72 6f 62 6c 65 6d |lso, the| problem|
|000055b0| 20 6f 66 20 64 65 74 65 | 72 6d 69 6e 69 6e 67 20 | of dete|rmining |
|000055c0| 74 68 65 20 61 6d 6f 75 | 6e 74 20 6f 66 20 6d 65 |the amou|nt of me|
|000055d0| 6d 6f 72 79 20 61 76 61 | 69 6c 61 62 6c 65 0a 58 |mory ava|ilable.X|
|000055e0| 20 2a 20 69 73 20 73 68 | 6f 76 65 64 20 6f 6e 74 | * is sh|oved ont|
|000055f0| 6f 20 74 68 65 20 75 73 | 65 72 2e 0a 58 20 2a 2f |o the us|er..X */|
|00005600| 0a 58 0a 58 23 69 6e 63 | 6c 75 64 65 20 22 6a 69 |.X.X#inc|lude "ji|
|00005610| 6e 63 6c 75 64 65 2e 68 | 22 0a 58 23 69 6e 63 6c |nclude.h|".X#incl|
|00005620| 75 64 65 20 22 6a 6d 65 | 6d 73 79 73 2e 68 22 0a |ude "jme|msys.h".|
|00005630| 58 0a 58 23 69 66 64 65 | 66 20 49 4e 43 4c 55 44 |X.X#ifde|f INCLUD|
|00005640| 45 53 5f 41 52 45 5f 41 | 4e 53 49 0a 58 23 69 6e |ES_ARE_A|NSI.X#in|
|00005650| 63 6c 75 64 65 20 3c 73 | 74 64 6c 69 62 2e 68 3e |clude <s|tdlib.h>|
|00005660| 09 09 2f 2a 20 74 6f 20 | 64 65 63 6c 61 72 65 20 |../* to |declare |
|00005670| 6d 61 6c 6c 6f 63 28 29 | 2c 20 66 72 65 65 28 29 |malloc()|, free()|
|00005680| 20 2a 2f 0a 58 23 65 6c | 73 65 0a 58 65 78 74 65 | */.X#el|se.Xexte|
|00005690| 72 6e 20 76 6f 69 64 20 | 2a 20 6d 61 6c 6c 6f 63 |rn void |* malloc|
|000056a0| 20 50 50 28 28 73 69 7a | 65 5f 74 20 73 69 7a 65 | PP((siz|e_t size|
|000056b0| 29 29 3b 0a 58 65 78 74 | 65 72 6e 20 76 6f 69 64 |));.Xext|ern void|
|000056c0| 20 66 72 65 65 20 50 50 | 28 28 76 6f 69 64 20 2a | free PP|((void *|
|000056d0| 70 74 72 29 29 3b 0a 58 | 23 65 6e 64 69 66 0a 58 |ptr));.X|#endif.X|
|000056e0| 0a 58 23 69 66 6e 64 65 | 66 20 53 45 45 4b 5f 53 |.X#ifnde|f SEEK_S|
|000056f0| 45 54 09 09 2f 2a 20 70 | 72 65 2d 41 4e 53 49 20 |ET../* p|re-ANSI |
|00005700| 73 79 73 74 65 6d 73 20 | 6d 61 79 20 6e 6f 74 20 |systems |may not |
|00005710| 64 65 66 69 6e 65 20 74 | 68 69 73 3b 20 2a 2f 0a |define t|his; */.|
|00005720| 58 23 64 65 66 69 6e 65 | 20 53 45 45 4b 5f 53 45 |X#define| SEEK_SE|
|00005730| 54 20 20 30 09 09 2f 2a | 20 69 66 20 6e 6f 74 2c |T 0../*| if not,|
|00005740| 20 61 73 73 75 6d 65 20 | 30 20 69 73 20 63 6f 72 | assume |0 is cor|
|00005750| 72 65 63 74 20 2a 2f 0a | 58 23 65 6e 64 69 66 0a |rect */.|X#endif.|
|00005760| 58 0a 58 23 69 66 64 65 | 66 20 44 4f 4e 54 5f 55 |X.X#ifde|f DONT_U|
|00005770| 53 45 5f 42 5f 4d 4f 44 | 45 09 09 2f 2a 20 64 65 |SE_B_MOD|E../* de|
|00005780| 66 69 6e 65 20 6d 6f 64 | 65 20 70 61 72 61 6d 65 |fine mod|e parame|
|00005790| 74 65 72 73 20 66 6f 72 | 20 66 6f 70 65 6e 28 29 |ters for| fopen()|
|000057a0| 20 2a 2f 0a 58 23 64 65 | 66 69 6e 65 20 52 45 41 | */.X#de|fine REA|
|000057b0| 44 5f 42 49 4e 41 52 59 | 09 22 72 22 0a 58 23 64 |D_BINARY|."r".X#d|
|000057c0| 65 66 69 6e 65 20 52 57 | 5f 42 49 4e 41 52 59 09 |efine RW|_BINARY.|
|000057d0| 22 77 2b 22 0a 58 23 65 | 6c 73 65 0a 58 23 64 65 |"w+".X#e|lse.X#de|
|000057e0| 66 69 6e 65 20 52 45 41 | 44 5f 42 49 4e 41 52 59 |fine REA|D_BINARY|
|000057f0| 09 22 72 62 22 0a 58 23 | 64 65 66 69 6e 65 20 52 |."rb".X#|define R|
|00005800| 57 5f 42 49 4e 41 52 59 | 09 22 77 2b 62 22 0a 58 |W_BINARY|."w+b".X|
|00005810| 23 65 6e 64 69 66 0a 58 | 0a 58 0a 58 73 74 61 74 |#endif.X|.X.Xstat|
|00005820| 69 63 20 65 78 74 65 72 | 6e 61 6c 5f 6d 65 74 68 |ic exter|nal_meth|
|00005830| 6f 64 73 5f 70 74 72 20 | 6d 65 74 68 6f 64 73 3b |ods_ptr |methods;|
|00005840| 20 2f 2a 20 73 61 76 65 | 64 20 66 6f 72 20 61 63 | /* save|d for ac|
|00005850| 63 65 73 73 20 74 6f 20 | 65 72 72 6f 72 5f 65 78 |cess to |error_ex|
|00005860| 69 74 20 2a 2f 0a 58 0a | 58 73 74 61 74 69 63 20 |it */.X.|Xstatic |
|00005870| 6c 6f 6e 67 20 74 6f 74 | 61 6c 5f 75 73 65 64 3b |long tot|al_used;|
|00005880| 09 09 2f 2a 20 74 6f 74 | 61 6c 20 6d 65 6d 6f 72 |../* tot|al memor|
|00005890| 79 20 72 65 71 75 65 73 | 74 65 64 20 73 6f 20 66 |y reques|ted so f|
|000058a0| 61 72 20 2a 2f 0a 58 0a | 58 0a 58 2f 2a 0a 58 20 |ar */.X.|X.X/*.X |
|000058b0| 2a 20 53 65 6c 65 63 74 | 69 6f 6e 20 6f 66 20 61 |* Select|ion of a|
|000058c0| 20 66 69 6c 65 20 6e 61 | 6d 65 20 66 6f 72 20 61 | file na|me for a|
|000058d0| 20 74 65 6d 70 6f 72 61 | 72 79 20 66 69 6c 65 2e | tempora|ry file.|
|000058e0| 0a 58 20 2a 20 54 68 69 | 73 20 69 73 20 73 79 73 |.X * Thi|s is sys|
|000058f0| 74 65 6d 2d 64 65 70 65 | 6e 64 65 6e 74 21 0a 58 |tem-depe|ndent!.X|
|00005900| 20 2a 0a 58 20 2a 20 54 | 68 65 20 63 6f 64 65 20 | *.X * T|he code |
|00005910| 61 73 20 67 69 76 65 6e | 20 69 73 20 73 75 69 74 |as given| is suit|
|00005920| 61 62 6c 65 20 66 6f 72 | 20 6d 6f 73 74 20 55 6e |able for| most Un|
|00005930| 69 78 20 73 79 73 74 65 | 6d 73 2c 20 61 6e 64 20 |ix syste|ms, and |
|00005940| 69 74 20 69 73 20 65 61 | 73 69 6c 79 0a 58 20 2a |it is ea|sily.X *|
|00005950| 20 6d 6f 64 69 66 69 65 | 64 20 66 6f 72 20 6d 6f | modifie|d for mo|
|00005960| 73 74 20 6e 6f 6e 2d 55 | 6e 69 78 20 73 79 73 74 |st non-U|nix syst|
|00005970| 65 6d 73 2e 20 20 53 6f | 6d 65 20 6e 6f 74 65 73 |ems. So|me notes|
|00005980| 3a 0a 58 20 2a 20 20 31 | 2e 20 20 54 68 65 20 74 |:.X * 1|. The t|
|00005990| 65 6d 70 20 66 69 6c 65 | 20 69 73 20 63 72 65 61 |emp file| is crea|
|000059a0| 74 65 64 20 69 6e 20 74 | 68 65 20 64 69 72 65 63 |ted in t|he direc|
|000059b0| 74 6f 72 79 20 6e 61 6d | 65 64 20 62 79 20 54 45 |tory nam|ed by TE|
|000059c0| 4d 50 5f 44 49 52 45 43 | 54 4f 52 59 2e 0a 58 20 |MP_DIREC|TORY..X |
|000059d0| 2a 20 20 20 20 20 20 54 | 68 65 20 64 65 66 61 75 |* T|he defau|
|000059e0| 6c 74 20 76 61 6c 75 65 | 20 69 73 20 2f 75 73 72 |lt value| is /usr|
|000059f0| 2f 74 6d 70 2c 20 77 68 | 69 63 68 20 69 73 20 74 |/tmp, wh|ich is t|
|00005a00| 68 65 20 63 6f 6e 76 65 | 6e 74 69 6f 6e 61 6c 20 |he conve|ntional |
|00005a10| 70 6c 61 63 65 20 66 6f | 72 0a 58 20 2a 20 20 20 |place fo|r.X * |
|00005a20| 20 20 20 63 72 65 61 74 | 69 6e 67 20 6c 61 72 67 | creat|ing larg|
|00005a30| 65 20 74 65 6d 70 20 66 | 69 6c 65 73 20 6f 6e 20 |e temp f|iles on |
|00005a40| 55 6e 69 78 2e 20 20 4f | 6e 20 6f 74 68 65 72 20 |Unix. O|n other |
|00005a50| 73 79 73 74 65 6d 73 20 | 79 6f 75 27 6c 6c 20 70 |systems |you'll p|
|00005a60| 72 6f 62 61 62 6c 79 0a | 58 20 2a 20 20 20 20 20 |robably.|X * |
|00005a70| 20 77 61 6e 74 20 74 6f | 20 63 68 61 6e 67 65 20 | want to| change |
|00005a80| 74 68 65 20 66 69 6c 65 | 20 6c 6f 63 61 74 69 6f |the file| locatio|
|00005a90| 6e 2e 20 20 59 6f 75 20 | 63 61 6e 20 64 6f 20 74 |n. You |can do t|
|00005aa0| 68 69 73 20 62 79 20 65 | 64 69 74 69 6e 67 20 74 |his by e|diting t|
|00005ab0| 68 65 0a 58 20 2a 20 20 | 20 20 20 20 23 64 65 66 |he.X * | #def|
|00005ac0| 69 6e 65 2c 20 6f 72 20 | 62 79 20 64 65 66 69 6e |ine, or |by defin|
|00005ad0| 69 6e 67 20 54 45 4d 50 | 5f 44 49 52 45 43 54 4f |ing TEMP|_DIRECTO|
|00005ae0| 52 59 20 69 6e 20 43 46 | 4c 41 47 53 20 69 6e 20 |RY in CF|LAGS in |
|00005af0| 74 68 65 20 4d 61 6b 65 | 66 69 6c 65 2e 0a 58 20 |the Make|file..X |
|00005b00| 2a 20 20 20 20 20 20 46 | 6f 72 20 65 78 61 6d 70 |* F|or examp|
|00005b10| 6c 65 2c 20 79 6f 75 20 | 6d 69 67 68 74 20 73 61 |le, you |might sa|
|00005b20| 79 0a 58 20 2a 20 20 20 | 20 20 20 20 20 20 20 43 |y.X * | C|
|00005b30| 46 4c 41 47 53 3d 20 2e | 2e 2e 20 27 2d 44 54 45 |FLAGS= .|.. '-DTE|
|00005b40| 4d 50 5f 44 49 52 45 43 | 54 4f 52 59 3d 22 2f 74 |MP_DIREC|TORY="/t|
|00005b50| 6d 70 2f 22 27 0a 58 20 | 2a 20 20 20 20 20 20 4e |mp/"'.X |* N|
|00005b60| 6f 74 65 20 74 68 61 74 | 20 64 6f 75 62 6c 65 20 |ote that| double |
|00005b70| 71 75 6f 74 65 73 20 61 | 72 65 20 6e 65 65 64 65 |quotes a|re neede|
|00005b80| 64 20 69 6e 20 74 68 65 | 20 74 65 78 74 20 6f 66 |d in the| text of|
|00005b90| 20 74 68 65 20 6d 61 63 | 72 6f 2e 0a 58 20 2a 20 | the mac|ro..X * |
|00005ba0| 20 20 20 20 20 57 69 74 | 68 20 6d 6f 73 74 20 6d | Wit|h most m|
|00005bb0| 61 6b 65 20 73 79 73 74 | 65 6d 73 20 79 6f 75 20 |ake syst|ems you |
|00005bc0| 68 61 76 65 20 74 6f 20 | 70 75 74 20 73 69 6e 67 |have to |put sing|
|00005bd0| 6c 65 20 71 75 6f 74 65 | 73 20 61 72 6f 75 6e 64 |le quote|s around|
|00005be0| 20 74 68 65 0a 58 20 2a | 20 20 20 20 20 20 2d 44 | the.X *| -D|
|00005bf0| 20 63 6f 6e 73 74 72 75 | 63 74 20 74 6f 20 70 72 | constru|ct to pr|
|00005c00| 65 73 65 72 76 65 20 74 | 68 65 20 64 6f 75 62 6c |eserve t|he doubl|
|00005c10| 65 20 71 75 6f 74 65 73 | 2e 0a 58 20 2a 09 28 41 |e quotes|..X *.(A|
|00005c20| 6d 69 67 61 20 53 41 53 | 20 43 20 68 61 73 20 74 |miga SAS| C has t|
|00005c30| 72 6f 75 62 6c 65 20 77 | 69 74 68 20 22 3a 22 20 |rouble w|ith ":" |
|00005c40| 61 6e 64 20 73 75 63 68 | 20 69 6e 20 63 6f 6d 6d |and such| in comm|
|00005c50| 61 6e 64 2d 6c 69 6e 65 | 20 6f 70 74 69 6f 6e 73 |and-line| options|
|00005c60| 2c 0a 58 20 2a 09 73 6f | 20 77 65 27 76 65 20 70 |,.X *.so| we've p|
|00005c70| 75 74 20 69 6e 20 61 20 | 73 70 65 63 69 61 6c 20 |ut in a |special |
|00005c80| 63 61 73 65 20 66 6f 72 | 20 74 68 65 20 70 72 65 |case for| the pre|
|00005c90| 66 65 72 72 65 64 20 41 | 6d 69 67 61 20 74 65 6d |ferred A|miga tem|
|00005ca0| 70 20 64 69 72 65 63 74 | 6f 72 79 2e 29 0a 58 20 |p direct|ory.).X |
|00005cb0| 2a 0a 58 20 2a 20 20 32 | 2e 20 20 49 66 20 79 6f |*.X * 2|. If yo|
|00005cc0| 75 20 6e 65 65 64 20 74 | 6f 20 63 68 61 6e 67 65 |u need t|o change|
|00005cd0| 20 74 68 65 20 66 69 6c | 65 20 6e 61 6d 65 20 61 | the fil|e name a|
|00005ce0| 73 20 77 65 6c 6c 20 61 | 73 20 69 74 73 20 6c 6f |s well a|s its lo|
|00005cf0| 63 61 74 69 6f 6e 2c 0a | 58 20 2a 20 20 20 20 20 |cation,.|X * |
|00005d00| 20 79 6f 75 20 63 61 6e | 20 6f 76 65 72 72 69 64 | you can| overrid|
|00005d10| 65 20 74 68 65 20 54 45 | 4d 50 5f 46 49 4c 45 5f |e the TE|MP_FILE_|
|00005d20| 4e 41 4d 45 20 6d 61 63 | 72 6f 2e 20 20 28 4e 6f |NAME mac|ro. (No|
|00005d30| 74 65 20 74 68 61 74 20 | 74 68 69 73 20 69 73 0a |te that |this is.|
|00005d40| 58 20 2a 20 20 20 20 20 | 20 61 63 74 75 61 6c 6c |X * | actuall|
|00005d50| 79 20 61 20 70 72 69 6e | 74 66 20 66 6f 72 6d 61 |y a prin|tf forma|
|00005d60| 74 20 73 74 72 69 6e 67 | 3b 20 69 74 20 6d 75 73 |t string|; it mus|
|00005d70| 74 20 63 6f 6e 74 61 69 | 6e 20 25 73 20 61 6e 64 |t contai|n %s and|
|00005d80| 20 25 64 2e 29 0a 58 20 | 2a 20 20 20 20 20 20 46 | %d.).X |* F|
|00005d90| 65 77 20 70 65 6f 70 6c | 65 20 73 68 6f 75 6c 64 |ew peopl|e should|
|00005da0| 20 6e 65 65 64 20 74 6f | 20 64 6f 20 74 68 69 73 | need to| do this|
|00005db0| 2e 0a 58 20 2a 0a 58 20 | 2a 20 20 33 2e 20 20 6d |..X *.X |* 3. m|
|00005dc0| 6b 74 65 6d 70 28 29 20 | 69 73 20 75 73 65 64 20 |ktemp() |is used |
|00005dd0| 74 6f 20 65 6e 73 75 72 | 65 20 74 68 61 74 20 6d |to ensur|e that m|
|00005de0| 75 6c 74 69 70 6c 65 20 | 70 72 6f 63 65 73 73 65 |ultiple |processe|
|00005df0| 73 20 72 75 6e 6e 69 6e | 67 0a 58 20 2a 20 20 20 |s runnin|g.X * |
|00005e00| 20 20 20 73 69 6d 75 6c | 74 61 6e 65 6f 75 73 6c | simul|taneousl|
|00005e10| 79 20 77 6f 6e 27 74 20 | 73 65 6c 65 63 74 20 74 |y won't |select t|
|00005e20| 68 65 20 73 61 6d 65 20 | 66 69 6c 65 20 6e 61 6d |he same |file nam|
|00005e30| 65 73 2e 20 20 49 66 20 | 79 6f 75 72 20 73 79 73 |es. If |your sys|
|00005e40| 74 65 6d 0a 58 20 2a 20 | 20 20 20 20 20 64 6f 65 |tem.X * | doe|
|00005e50| 73 6e 27 74 20 68 61 76 | 65 20 6d 6b 74 65 6d 70 |sn't hav|e mktemp|
|00005e60| 28 29 2c 20 64 65 66 69 | 6e 65 20 4e 4f 5f 4d 4b |(), defi|ne NO_MK|
|00005e70| 54 45 4d 50 20 74 6f 20 | 64 6f 20 69 74 20 74 68 |TEMP to |do it th|
|00005e80| 65 20 68 61 72 64 20 77 | 61 79 2e 0a 58 20 2a 0a |e hard w|ay..X *.|
|00005e90| 58 20 2a 20 20 34 2e 20 | 20 59 6f 75 20 70 72 6f |X * 4. | You pro|
|00005ea0| 62 61 62 6c 79 20 77 61 | 6e 74 20 74 6f 20 64 65 |bably wa|nt to de|
|00005eb0| 66 69 6e 65 20 4e 45 45 | 44 5f 53 49 47 4e 41 4c |fine NEE|D_SIGNAL|
|00005ec0| 5f 43 41 54 43 48 45 52 | 20 73 6f 20 74 68 61 74 |_CATCHER| so that|
|00005ed0| 20 6a 63 6d 61 69 6e 2f | 6a 64 6d 61 69 6e 0a 58 | jcmain/|jdmain.X|
|00005ee0| 20 2a 20 20 20 20 20 20 | 77 69 6c 6c 20 63 61 75 | * |will cau|
|00005ef0| 73 65 20 74 68 65 20 74 | 65 6d 70 20 66 69 6c 65 |se the t|emp file|
|00005f00| 73 20 74 6f 20 62 65 20 | 72 65 6d 6f 76 65 64 20 |s to be |removed |
|00005f10| 69 66 20 79 6f 75 20 73 | 74 6f 70 20 74 68 65 20 |if you s|top the |
|00005f20| 70 72 6f 67 72 61 6d 20 | 65 61 72 6c 79 2e 0a 58 |program |early..X|
|00005f30| 20 2a 2f 0a 58 0a 58 23 | 69 66 6e 64 65 66 20 54 | */.X.X#|ifndef T|
|00005f40| 45 4d 50 5f 44 49 52 45 | 43 54 4f 52 59 09 09 2f |EMP_DIRE|CTORY../|
|00005f50| 2a 20 73 6f 20 63 61 6e | 20 6f 76 65 72 72 69 64 |* so can| overrid|
|00005f60| 65 20 66 72 6f 6d 20 4d | 61 6b 65 66 69 6c 65 20 |e from M|akefile |
|00005f70| 2a 2f 0a 58 23 69 66 64 | 65 66 20 41 4d 49 47 41 |*/.X#ifd|ef AMIGA|
|00005f80| 0a 58 23 64 65 66 69 6e | 65 20 54 45 4d 50 5f 44 |.X#defin|e TEMP_D|
|00005f90| 49 52 45 43 54 4f 52 59 | 20 20 22 4a 50 45 47 54 |IRECTORY| "JPEGT|
|00005fa0| 4d 50 3a 22 20 20 2f 2a | 20 72 65 63 6f 6d 6d 65 |MP:" /*| recomme|
|00005fb0| 6e 64 65 64 20 73 65 74 | 74 69 6e 67 20 66 6f 72 |nded set|ting for|
|00005fc0| 20 41 6d 69 67 61 20 2a | 2f 0a 58 23 65 6c 73 65 | Amiga *|/.X#else|
|00005fd0| 0a 58 23 64 65 66 69 6e | 65 20 54 45 4d 50 5f 44 |.X#defin|e TEMP_D|
|00005fe0| 49 52 45 43 54 4f 52 59 | 20 20 22 2f 75 73 72 2f |IRECTORY| "/usr/|
|00005ff0| 74 6d 70 2f 22 20 2f 2a | 20 72 65 63 6f 6d 6d 65 |tmp/" /*| recomme|
|00006000| 6e 64 65 64 20 73 65 74 | 74 69 6e 67 20 66 6f 72 |nded set|ting for|
|00006010| 20 55 6e 69 78 20 2a 2f | 0a 58 23 65 6e 64 69 66 | Unix */|.X#endif|
|00006020| 0a 58 23 65 6e 64 69 66 | 0a 58 0a 58 73 74 61 74 |.X#endif|.X.Xstat|
|00006030| 69 63 20 69 6e 74 20 6e | 65 78 74 5f 66 69 6c 65 |ic int n|ext_file|
|00006040| 5f 6e 75 6d 3b 09 2f 2a | 20 74 6f 20 64 69 73 74 |_num;./*| to dist|
|00006050| 69 6e 67 75 69 73 68 20 | 61 6d 6f 6e 67 20 73 65 |inguish |among se|
|00006060| 76 65 72 61 6c 20 74 65 | 6d 70 20 66 69 6c 65 73 |veral te|mp files|
|00006070| 20 2a 2f 0a 58 0a 58 23 | 69 66 64 65 66 20 4e 4f | */.X.X#|ifdef NO|
|00006080| 5f 4d 4b 54 45 4d 50 0a | 58 0a 58 23 69 66 6e 64 |_MKTEMP.|X.X#ifnd|
|00006090| 65 66 20 54 45 4d 50 5f | 46 49 4c 45 5f 4e 41 4d |ef TEMP_|FILE_NAM|
|000060a0| 45 09 09 2f 2a 20 73 6f | 20 63 61 6e 20 6f 76 65 |E../* so| can ove|
|000060b0| 72 72 69 64 65 20 66 72 | 6f 6d 20 4d 61 6b 65 66 |rride fr|om Makef|
|000060c0| 69 6c 65 20 2a 2f 0a 58 | 23 64 65 66 69 6e 65 20 |ile */.X|#define |
|000060d0| 54 45 4d 50 5f 46 49 4c | 45 5f 4e 41 4d 45 20 20 |TEMP_FIL|E_NAME |
|000060e0| 22 25 73 4a 50 47 25 30 | 33 64 2e 54 4d 50 22 0a |"%sJPG%0|3d.TMP".|
|000060f0| 58 23 65 6e 64 69 66 0a | 58 0a 58 4c 4f 43 41 4c |X#endif.|X.XLOCAL|
|00006100| 20 76 6f 69 64 0a 58 73 | 65 6c 65 63 74 5f 66 69 | void.Xs|elect_fi|
|00006110| 6c 65 5f 6e 61 6d 65 20 | 28 63 68 61 72 20 2a 20 |le_name |(char * |
|00006120| 66 6e 61 6d 65 29 0a 58 | 7b 0a 58 20 20 46 49 4c |fname).X|{.X FIL|
|00006130| 45 20 2a 20 74 66 69 6c | 65 3b 0a 58 0a 58 20 20 |E * tfil|e;.X.X |
|00006140| 2f 2a 20 4b 65 65 70 20 | 67 65 6e 65 72 61 74 69 |/* Keep |generati|
|00006150| 6e 67 20 66 69 6c 65 20 | 6e 61 6d 65 73 20 74 69 |ng file |names ti|
|00006160| 6c 6c 20 77 65 20 66 69 | 6e 64 20 6f 6e 65 20 74 |ll we fi|nd one t|
|00006170| 68 61 74 27 73 20 6e 6f | 74 20 69 6e 20 75 73 65 |hat's no|t in use|
|00006180| 20 2a 2f 0a 58 20 20 66 | 6f 72 20 28 3b 3b 29 20 | */.X f|or (;;) |
|00006190| 7b 0a 58 20 20 20 20 6e | 65 78 74 5f 66 69 6c 65 |{.X n|ext_file|
|000061a0| 5f 6e 75 6d 2b 2b 3b 09 | 09 2f 2a 20 61 64 76 61 |_num++;.|./* adva|
|000061b0| 6e 63 65 20 63 6f 75 6e | 74 65 72 20 2a 2f 0a 58 |nce coun|ter */.X|
|000061c0| 20 20 20 20 73 70 72 69 | 6e 74 66 28 66 6e 61 6d | spri|ntf(fnam|
|000061d0| 65 2c 20 54 45 4d 50 5f | 46 49 4c 45 5f 4e 41 4d |e, TEMP_|FILE_NAM|
|000061e0| 45 2c 20 54 45 4d 50 5f | 44 49 52 45 43 54 4f 52 |E, TEMP_|DIRECTOR|
|000061f0| 59 2c 20 6e 65 78 74 5f | 66 69 6c 65 5f 6e 75 6d |Y, next_|file_num|
|00006200| 29 3b 0a 58 20 20 20 20 | 69 66 20 28 28 74 66 69 |);.X |if ((tfi|
|00006210| 6c 65 20 3d 20 66 6f 70 | 65 6e 28 66 6e 61 6d 65 |le = fop|en(fname|
|00006220| 2c 20 52 45 41 44 5f 42 | 49 4e 41 52 59 29 29 20 |, READ_B|INARY)) |
|00006230| 3d 3d 20 4e 55 4c 4c 29 | 0a 58 20 20 20 20 20 20 |== NULL)|.X |
|00006240| 62 72 65 61 6b 3b 0a 58 | 20 20 20 20 66 63 6c 6f |break;.X| fclo|
|00006250| 73 65 28 74 66 69 6c 65 | 29 3b 09 09 2f 2a 20 6f |se(tfile|);../* o|
|00006260| 6f 70 73 2c 20 69 74 27 | 73 20 74 68 65 72 65 3b |ops, it'|s there;|
|00006270| 20 63 6c 6f 73 65 20 74 | 66 69 6c 65 20 26 20 74 | close t|file & t|
|00006280| 72 79 20 61 67 61 69 6e | 20 2a 2f 0a 58 20 20 7d |ry again| */.X }|
|00006290| 0a 58 7d 0a 58 0a 58 23 | 65 6c 73 65 20 2f 2a 20 |.X}.X.X#|else /* |
|000062a0| 21 20 4e 4f 5f 4d 4b 54 | 45 4d 50 20 2a 2f 0a 58 |! NO_MKT|EMP */.X|
|000062b0| 0a 58 2f 2a 20 4e 6f 74 | 65 20 74 68 61 74 20 6d |.X/* Not|e that m|
|000062c0| 6b 74 65 6d 70 28 29 20 | 72 65 71 75 69 72 65 73 |ktemp() |requires|
|000062d0| 20 74 68 65 20 69 6e 69 | 74 69 61 6c 20 66 69 6c | the ini|tial fil|
|000062e0| 65 6e 61 6d 65 20 74 6f | 20 65 6e 64 20 69 6e 20 |ename to| end in |
|000062f0| 73 69 78 20 58 27 73 20 | 2a 2f 0a 58 23 69 66 6e |six X's |*/.X#ifn|
|00006300| 64 65 66 20 54 45 4d 50 | 5f 46 49 4c 45 5f 4e 41 |def TEMP|_FILE_NA|
|00006310| 4d 45 09 09 2f 2a 20 73 | 6f 20 63 61 6e 20 6f 76 |ME../* s|o can ov|
|00006320| 65 72 72 69 64 65 20 66 | 72 6f 6d 20 4d 61 6b 65 |erride f|rom Make|
|00006330| 66 69 6c 65 20 2a 2f 0a | 58 23 64 65 66 69 6e 65 |file */.|X#define|
|00006340| 20 54 45 4d 50 5f 46 49 | 4c 45 5f 4e 41 4d 45 20 | TEMP_FI|LE_NAME |
|00006350| 20 22 25 73 4a 50 47 25 | 64 58 58 58 58 58 58 22 | "%sJPG%|dXXXXXX"|
|00006360| 0a 58 23 65 6e 64 69 66 | 0a 58 0a 58 4c 4f 43 41 |.X#endif|.X.XLOCA|
|00006370| 4c 20 76 6f 69 64 0a 58 | 73 65 6c 65 63 74 5f 66 |L void.X|select_f|
|00006380| 69 6c 65 5f 6e 61 6d 65 | 20 28 63 68 61 72 20 2a |ile_name| (char *|
|00006390| 20 66 6e 61 6d 65 29 0a | 58 7b 0a 58 20 20 6e 65 | fname).|X{.X ne|
|000063a0| 78 74 5f 66 69 6c 65 5f | 6e 75 6d 2b 2b 3b 09 09 |xt_file_|num++;..|
|000063b0| 2f 2a 20 61 64 76 61 6e | 63 65 20 63 6f 75 6e 74 |/* advan|ce count|
|000063c0| 65 72 20 2a 2f 0a 58 20 | 20 73 70 72 69 6e 74 66 |er */.X | sprintf|
|000063d0| 28 66 6e 61 6d 65 2c 20 | 54 45 4d 50 5f 46 49 4c |(fname, |TEMP_FIL|
|000063e0| 45 5f 4e 41 4d 45 2c 20 | 54 45 4d 50 5f 44 49 52 |E_NAME, |TEMP_DIR|
|000063f0| 45 43 54 4f 52 59 2c 20 | 6e 65 78 74 5f 66 69 6c |ECTORY, |next_fil|
+--------+-------------------------+-------------------------+--------+--------+
Only 25.0 KB of data is shown above.