Internet File Formats 1995.Pdf
Total Page:16
File Type:pdf, Size:1020Kb
For PCs, Macintosh, and UNIX + Your complete guide to understanding and using Internet files + Provides inside information on the major file formats + Includes the best .u.u•v for working Internet files I CORIOLIS GROUP nm Kientzle BOOKS ormats mats Tim. Kientzle IJ CORIOLIS GROUP BOOKS Publisher Keith Weiskamp Editorial Director Jeff Duntemann Managing Editor Ron Pronk Editor Diane Cook Cover Design Gary Smith and Bradley Grannis Interior Design Tim Kientzle Layout Production Tim Kientzle CD Production Anthony Potts Trademarks: Cenain names used in this book are trademarks, registered trademarks, or trade names of their respective owners. Text Copyright © 1995 The Coriolis Group, Inc. All rights under copyright reserved. No part of this book may be reproduced, stored, or transmitted by any means, mechanical, electronic, or otherwise, without the express written consent of the publisher. Distributed to the book trade by IDG Books Worldwide, Inc. All rights reserved. Reproduction or translation of any part of this work beyond that permitted by section 107 or 108 or the 1976 United States Copyright Act without the written permission of the copyright owner is unlawful. Requests for permission or further information should be addressed to: The Coriolis Group, 7339 E. Acoma Drive, Suite 7, Scottsdale, Arizona 85260. This book was produced using 151EX2e and dvips typesetting software on FreeBSD 2.0R The text fonts are Adobe Garamond and Computer Modern Typewriter; headings are in Adobe Helvetica and Monotype Arial. Library of Congress Cataloging-in-Publication Data Kientzle, Tim Internet File Formats/Tim Kientzle p. em. Includes bibliography and index. ISBN 1-883577-56-X: $39.99 Printed in the United States of America 10 9 8 7 6 54 3 2 :r.q ..~~-~)!· .-. Acknowledgments Many people have generously contributed to the production of this book, among them: Jeff Duntemann and Keith Weiskamp suggested the idea for this book. Tom Lippincott read and critiqued some of the early chapters. Diane Cook's watchful red pen corrected many slips and blunders. Anthony Potts' enthusiastic gathering made the accompanying CD-ROM a useful ac companiment. The staff at Dr. Dobb's gave me the time and encouragement to finish. But most importantly, Beth brought me innumerable ice cream sandwiches when I needed them most. Contents 1 The Great Melting Pot 1 lnternetworking . 1 Bulletin Board Systems 2 Greater lnternetopolis . 3 Sticking to the Big Streets 4 About Standards . 4 2 Researching File Formats 7 Identifying the Format of a File . 7 Using the Files . 9 File Formats on the World Wide Web . 9 Other File Format Resources . 11 General Research on the Internet . 14 Part One Text and Document Formats 3 About Text 19 Character Sets 20 Names and Numbers . 21 A Subtlety . ..... 22 Why Bother? 23 Markup ...... 24 vii viii • Contents Logical vs. Physical Markup 24 Preserving Markup . 26 4 HTML 29 Universal Resource Locators .. 30 About Domain Names . 33 About HTTP ..... 35 HTTP URL Modifiers . 37 An HTML Primer . 39 Tags and Elements . 40 Structure of an HTML Document . 41 HTMLHead ... 41 Paragraphs 43 Headings .... 43 Text Styles . 44 Special Characters 44 Links and Anchors 45 Graphics 47 Forms .... 48 Tables .... 50 Mathematics 50 HTML Style Guidelines . 53 More Information 57 5 1FX and 1flFX 59 IDE)( ..... 61 Other 1FX Variants . 62 Recognizing lEX and IDE)( Files 62 Using 1FX and IDE)( Files . 64 A IDE)( Primer . 66 Preamble . 66 Paragraphs 68 Headings .. 69 Text Styles 69 Special Characters 70 Graphics and Figures ...... 71 Tables .......... 72 Contents • ix Mathematics 74 More Information 75 6 SGML 77 An International Standard Markup Language . 78 More Information . 80 7 TROFF 81 Using TROFF Files 82 A TROFF Primer 84 Paragraphs 85 Text Styles 85 Headings .. 86 Graphics and Figures . 88 Tables .... 88 Mathematics 90 More Information 91 8 PostScript 93 Recognizing PostScript Files . 94 PostScript Font Files . 95 Type 3 Fonts . 96 Type 1 Fonts .... 96 Other Font Types 97 Other Font-Related Files . 98 Structured PostScript Files .... 98 Encapsulated PostScript . 100 Encapsulated PostScript Previews. 100 EPSI Previews . 101 Macintosh Previews . 101 TIFF and Windows Metafile Previews . 101 PostScript Dialects . 101 Hints for Handling PostScript . 103 Legal Issues . 104 Strengths and Weaknesses 105 More Information . 106 x • Contents 9 PDF (Acrobat) 109 Using PDF ....... 110 How PDF Works . 110 Strengths and Weaknesses Ill PDF vs. PostScript .. 112 Alternatives to PDF 112 More Information 112 10 Word Processors 113 More Information 114 Part Two Graphics Formats 11 About Graphics 117 Color and Resolution . 118 Kinds of Colors . 119 Kinds of Images . 121 Compression . 122 One Size Doesn't Fit All 122 Lossy Compression . 123 More Information . 124 12 ASCII Graphics 125 How to Use ASCII Graphics 125 More Information . 128 13 GIF 129 When to Use GIF 130 Recognizing GIF Files . 131 How to Use GIF . 131 Legal Issues . 132 How GIF Works . 132 GIF Header 133 G IF Terminator 134 GIF Image .... 134 Contents • xi GIF Extension Blocks . 135 Comment Extension . 135 Text Extension . 135 Graphics Control Extension . 136 Application Extension 137 More Information . 137 14 PNG 139 When to Use PNG 140 How PNG Works . 140 PNG Signature . 141 PNG Chunks .. 141 Image Header Chunk 143 Picture Information Chunks 143 Image Data .... 145 Optional Chunks .. 146 End-of-Data Chunk 146 More Information 147 15 TIFF 149 When to Use TIFF 149 Strengths and Weaknesses 150 How TIFF Works . 151 TIFF Header . 152 TIFF Image ... 153 TIFF Image Data . 153 More Information . 156 16 )PEG OFIF) 157 When to Use JPEG . 158 How to Use JPEG . 159 Recognizing JPEG and JFIF Files 160 How JFIF Works . 161 How JPEG Compression Works . 163 Color Model . 164 Subsampling . 164 Discrete Cosine Transform . 164 xii • Contents Quantization . 165 Compression . 166 Future Lossy Compression Methods . 167 Lossless JPEG . 167 More Information . 168 17 VRML 169 How to Use VRML 170 How VRML Works 171 More Information 174 18 Other Formats 177 XBMandXPM 177 BMP .. 178 PICT ....... 178 IFF ........ 178 PBM, PGM, PPM, and PNM . 179 Part Three Compression and Archiving Formats 19 About Archiving and Compression 183 About Archiving . 183 A Brief History of Compression . 184 Compression Isn't Perfect . 187 A Note About Encryption . 190 Which is Best? . 190 More Information 191 20 TAR 193 How to Use TAR 194 How TAR Works 195 More Information 198 21 Compress 199 How to Use Compress . 200 How Compress Works . 200 Contents • xiii More Information 204 22 ARC 205 How to Use ARC 206 How ARC Works 206 More Information 208 23 ZIP 209 How to Use PKZIP/ZIP . 210 ZIP File Format . 212 ZIP's Compression Algorithms 216 How Shrinking Works . 217 How Reducing Works . 218 How Imploding Works . 218 How Deflation Works 219 Drawbacks to ZIP . 220 More Information 221 24 GZIP 223 How to Use GZIP/GUNZIP 223 How GZIP Works . 224 About the Free Software Foundation 226 More Information 226 25 SHAR 227 How to Use SHAR 228 How SHAR Works 228 More Information 230 26 zoo 231 How to Use ZOO . 231 Using Generations 232 How ZOO Works . 233 Recovering Damaged ZOO Archives 238 ZOO's Compression Methods . 239 More Information . 239 xiv • Contents 27 Stuffit 241 How Stufflt Works . 242 More Information 244 28 Other Formats 247 SEA, SFX and EXE 247 AR] ..... 248 LHNLZH .. 249 RAR ..... 249 AR ...... 249 Pack and Compact . 250 Squeeze ....... 250 CompactPro ... 250 WEB Compression 250 Part Four Encoding Formats 29 About Encoding 255 30 UUEncode 257 When to Use UUEncode . 257 How to Use UUEncode and UUDecode 258 How UUEncode Works 259 UUEncode Program . 260 UUDecode Program . 261 31 XXEncode 263 How to Use XXEncode 263 When to Use XXEncode . 264 How XXEncode Works . 264 XXEncode and XXDecode Programs 264 32 BtoA 267 When to Use BtoA 267 How to Use BtoA 268 How BtoA Works . 268 Contents • xv More Information 270 33 MIME 271 When to Use MIME 272 How MIME Works . 273 MIME Content Types 273 More Complex Messages . 275 Encoding .. 278 Security ..... 279 More Information 279 34 BinHex 281 How to Use BinHex . 282 How BinHex Works . 282 BinHex Variants . 284 More Information . 284 Part Five Sound Formats 35 About Sound 289 Playing Sound . 290 External Synthesizers .. 290 FM Synthesis ..... 291 Sampled Sounds . 291 Digital Signal Processors 292 High-Quality Sound on Low-Quality Hardware . 292 Storing Sound . 292 Silence Encoding . 293 JL-Law and A-Law Compression 293 DPCM and ADPCM . 294 More Advanced Techniques 295 More Information . 296 36 AU 297 More Information 298 xvi • Contents 37 WAVE 299 How RIFF Works 299 WAVEForm ... 300 WAVE PCM Data Storage . 300 Additional Chunk Types . 302 38 Other Formats 305 MIDI 305 MOD ...... 306 IFF ........ 307 AIFF .. 307 Part Six Movie Formats 39 About Video 311 Real-Time Compression . 311 Compressing in Space and Time . 312 Rate Limiting . 314 Replaceable Codecs .. 315 Audio and Other Data . 315 More Information 316 40 AVI 317 How AVI Works . 318 RIFF AVI Form . 318 LIST hdrl Form 319 LIST movi Form 319 LIST rec Form 320 41 QuickTime 321 How QuickTime Works . 322 Single-Fork File Format . 324 moov Atom 325 trak Atom .......... 325 mdiaAtom 326 Contents • xvii More Information 326 42 MPEG 327 How to Use MPEG 328 How MPEG Video Works . 330 General Issues . 331 !-Frames .. 332 P-Frames ... 332 B-Frames ... 333 How MPEG Audio Works . 334 More Information . 335 Appendices A About the CD-ROM 339 About Shareware . ....... ..... 339 CD-ROM Organization .. .... 340 Text ...... 342 Graphics ... .... 345 Compression . ..... .... 350 Encoding .. 352 Sound ..... 353 Video . ....... 355 B About Files 357 Definition of a File ..... 357 What Files Are Made Of. ....... 358 How Files Get Around . 359 About Text and Binary . 359 c About File Formats 361 What a File Format Does .