home *** CD-ROM | disk | FTP | other *** search
open in:
MacOS 8.1
|
Win98
|
DOS
view JSON data
|
view as text
This file was processed as: LaTeX Document
(document/latex).
You can browse this item here: tex
Confidence | Program | Detection | Match Type | Support
|
---|
100%
| dexvert
| LaTeX Document (document/latex)
| magic
| Supported |
1%
| dexvert
| Text File (text/txt)
| fallback
| Supported |
100%
| file
| LaTeX document text
| default
| |
99%
| file
| LaTeX document, ASCII text
| default
| |
100%
| checkBytes
| Printable ASCII
| default
| |
100%
| perlTextCheck
| Likely Text (Perl)
| default
| |
100%
| siegfried
| fmt/281 LaTeX (Subdocument)
| default
| |
100%
| detectItEasy
| Format: plain text[LF]
| default (weak)
|
|
hex view+--------+-------------------------+-------------------------+--------+--------+
|00000000| 5c 73 65 63 74 69 6f 6e | 7b 53 74 61 6e 64 61 72 |\section|{Standar|
|00000010| 64 20 6d 6f 64 75 6c 65 | 20 5c 73 65 63 74 63 6f |d module| \sectco|
|00000020| 64 65 7b 69 6d 67 68 64 | 72 7d 7d 0a 5c 73 74 6d |de{imghd|r}}.\stm|
|00000030| 6f 64 69 6e 64 65 78 7b | 69 6d 67 68 64 72 7d 0a |odindex{|imghdr}.|
|00000040| 0a 54 68 65 20 5c 63 6f | 64 65 7b 69 6d 67 68 64 |.The \co|de{imghd|
|00000050| 72 7d 20 6d 6f 64 75 6c | 65 20 64 65 74 65 72 6d |r} modul|e determ|
|00000060| 69 6e 65 73 20 74 68 65 | 20 74 79 70 65 20 6f 66 |ines the| type of|
|00000070| 20 69 6d 61 67 65 20 63 | 6f 6e 74 61 69 6e 65 64 | image c|ontained|
|00000080| 20 69 6e 20 61 0a 66 69 | 6c 65 20 6f 72 20 62 79 | in a.fi|le or by|
|00000090| 74 65 20 73 74 72 65 61 | 6d 2e 0a 0a 54 68 65 20 |te strea|m...The |
|000000a0| 5c 63 6f 64 65 7b 69 6d | 67 68 64 72 7d 20 6d 6f |\code{im|ghdr} mo|
|000000b0| 64 75 6c 65 20 64 65 66 | 69 6e 65 73 20 74 68 65 |dule def|ines the|
|000000c0| 20 66 6f 6c 6c 6f 77 69 | 6e 67 20 66 75 6e 63 74 | followi|ng funct|
|000000d0| 69 6f 6e 3a 0a 0a 5c 72 | 65 6e 65 77 63 6f 6d 6d |ion:..\r|enewcomm|
|000000e0| 61 6e 64 7b 5c 69 6e 64 | 65 78 73 75 62 69 74 65 |and{\ind|exsubite|
|000000f0| 6d 7d 7b 28 69 6e 20 6d | 6f 64 75 6c 65 20 69 6d |m}{(in m|odule im|
|00000100| 67 68 64 72 29 7d 0a 0a | 5c 62 65 67 69 6e 7b 66 |ghdr)}..|\begin{f|
|00000110| 75 6e 63 64 65 73 63 7d | 7b 77 68 61 74 7d 7b 66 |uncdesc}|{what}{f|
|00000120| 69 6c 65 6e 61 6d 65 5c | 6f 70 74 69 6f 6e 61 6c |ilename\|optional|
|00000130| 7b 5c 2c 20 68 7d 7d 0a | 54 65 73 74 73 20 74 68 |{\, h}}.|Tests th|
|00000140| 65 20 69 6d 61 67 65 20 | 64 61 74 61 20 63 6f 6e |e image |data con|
|00000150| 74 61 69 6e 65 64 20 69 | 6e 20 74 68 65 20 66 69 |tained i|n the fi|
|00000160| 6c 65 20 6e 61 6d 65 64 | 20 62 79 20 5c 76 61 72 |le named| by \var|
|00000170| 7b 66 69 6c 65 6e 61 6d | 65 7d 2c 0a 61 6e 64 20 |{filenam|e},.and |
|00000180| 72 65 74 75 72 6e 73 20 | 61 20 73 74 72 69 6e 67 |returns |a string|
|00000190| 20 64 65 73 63 72 69 62 | 69 6e 67 20 74 68 65 20 | describ|ing the |
|000001a0| 69 6d 61 67 65 20 74 79 | 70 65 2e 20 20 49 66 20 |image ty|pe. If |
|000001b0| 6f 70 74 69 6f 6e 61 6c | 20 5c 76 61 72 7b 68 7d |optional| \var{h}|
|000001c0| 0a 69 73 20 70 72 6f 76 | 69 64 65 64 2c 20 74 68 |.is prov|ided, th|
|000001d0| 65 20 5c 76 61 72 7b 66 | 69 6c 65 6e 61 6d 65 7d |e \var{f|ilename}|
|000001e0| 20 69 73 20 69 67 6e 6f | 72 65 64 20 61 6e 64 20 | is igno|red and |
|000001f0| 5c 76 61 72 7b 68 7d 20 | 69 73 20 61 73 73 75 6d |\var{h} |is assum|
|00000200| 65 64 20 74 6f 0a 63 6f | 6e 74 61 69 6e 20 74 68 |ed to.co|ntain th|
|00000210| 65 20 62 79 74 65 20 73 | 74 72 65 61 6d 20 74 6f |e byte s|tream to|
|00000220| 20 74 65 73 74 2e 0a 5c | 65 6e 64 7b 66 75 6e 63 | test..\|end{func|
|00000230| 64 65 73 63 7d 0a 0a 54 | 68 65 20 66 6f 6c 6c 6f |desc}..T|he follo|
|00000240| 77 69 6e 67 20 69 6d 61 | 67 65 20 74 79 70 65 73 |wing ima|ge types|
|00000250| 20 61 72 65 20 72 65 63 | 6f 67 6e 69 7a 65 64 2c | are rec|ognized,|
|00000260| 20 61 73 20 6c 69 73 74 | 65 64 20 62 65 6c 6f 77 | as list|ed below|
|00000270| 20 77 69 74 68 20 74 68 | 65 0a 72 65 74 75 72 6e | with th|e.return|
|00000280| 20 76 61 6c 75 65 20 66 | 72 6f 6d 20 5c 63 6f 64 | value f|rom \cod|
|00000290| 65 7b 77 68 61 74 7d 3a | 0a 0a 5c 62 65 67 69 6e |e{what}:|..\begin|
|000002a0| 7b 65 6e 75 6d 65 72 61 | 74 65 7d 0a 5c 69 74 65 |{enumera|te}.\ite|
|000002b0| 6d 5b 60 60 72 67 62 27 | 27 5d 20 53 47 49 20 49 |m[``rgb'|'] SGI I|
|000002c0| 6d 67 4c 69 62 20 46 69 | 6c 65 73 0a 0a 5c 69 74 |mgLib Fi|les..\it|
|000002d0| 65 6d 5b 60 60 67 69 66 | 27 27 5d 20 47 49 46 20 |em[``gif|''] GIF |
|000002e0| 38 37 61 20 61 6e 64 20 | 38 39 61 20 46 69 6c 65 |87a and |89a File|
|000002f0| 73 0a 0a 5c 69 74 65 6d | 5b 60 60 70 62 6d 27 27 |s..\item|[``pbm''|
|00000300| 5d 20 50 6f 72 74 61 62 | 6c 65 20 42 69 74 6d 61 |] Portab|le Bitma|
|00000310| 70 20 46 69 6c 65 73 0a | 0a 5c 69 74 65 6d 5b 60 |p Files.|.\item[`|
|00000320| 60 70 67 6d 27 27 5d 20 | 50 6f 72 74 61 62 6c 65 |`pgm''] |Portable|
|00000330| 20 47 72 61 79 6d 61 70 | 20 46 69 6c 65 73 0a 0a | Graymap| Files..|
|00000340| 5c 69 74 65 6d 5b 60 60 | 70 70 6d 27 27 5d 20 50 |\item[``|ppm''] P|
|00000350| 6f 72 74 61 62 6c 65 20 | 50 69 78 6d 61 70 20 46 |ortable |Pixmap F|
|00000360| 69 6c 65 73 0a 0a 5c 69 | 74 65 6d 5b 60 60 74 69 |iles..\i|tem[``ti|
|00000370| 66 66 27 27 5d 20 54 49 | 46 46 20 46 69 6c 65 73 |ff''] TI|FF Files|
|00000380| 0a 0a 5c 69 74 65 6d 5b | 60 60 72 61 73 74 27 27 |..\item[|``rast''|
|00000390| 5d 20 53 75 6e 20 52 61 | 73 74 65 72 20 46 69 6c |] Sun Ra|ster Fil|
|000003a0| 65 73 0a 0a 5c 69 74 65 | 6d 5b 60 60 78 62 6d 27 |es..\ite|m[``xbm'|
|000003b0| 27 5d 20 58 20 42 69 74 | 6d 61 70 20 46 69 6c 65 |'] X Bit|map File|
|000003c0| 73 0a 0a 5c 69 74 65 6d | 5b 60 60 6a 70 65 67 27 |s..\item|[``jpeg'|
|000003d0| 27 5d 20 4a 50 45 47 20 | 64 61 74 61 20 69 6e 20 |'] JPEG |data in |
|000003e0| 4a 49 46 46 20 66 6f 72 | 6d 61 74 0a 5c 65 6e 64 |JIFF for|mat.\end|
|000003f0| 7b 65 6e 75 6d 65 72 61 | 74 65 7d 0a 0a 59 6f 75 |{enumera|te}..You|
|00000400| 20 63 61 6e 20 65 78 74 | 65 6e 64 20 74 68 65 20 | can ext|end the |
|00000410| 6c 69 73 74 20 6f 66 20 | 66 69 6c 65 20 74 79 70 |list of |file typ|
|00000420| 65 73 20 5c 63 6f 64 65 | 7b 69 6d 67 68 64 72 7d |es \code|{imghdr}|
|00000430| 20 63 61 6e 20 72 65 63 | 6f 67 6e 69 7a 65 20 62 | can rec|ognize b|
|00000440| 79 0a 61 70 70 65 6e 64 | 69 6e 67 20 74 6f 20 74 |y.append|ing to t|
|00000450| 68 69 73 20 76 61 72 69 | 61 62 6c 65 3a 0a 0a 5c |his vari|able:..\|
|00000460| 62 65 67 69 6e 7b 64 61 | 74 61 64 65 73 63 7d 7b |begin{da|tadesc}{|
|00000470| 74 65 73 74 73 7d 0a 41 | 20 6c 69 73 74 20 6f 66 |tests}.A| list of|
|00000480| 20 66 75 6e 63 74 69 6f | 6e 73 20 70 65 72 66 6f | functio|ns perfo|
|00000490| 72 6d 69 6e 67 20 74 68 | 65 20 69 6e 64 69 76 69 |rming th|e indivi|
|000004a0| 64 75 61 6c 20 74 65 73 | 74 73 2e 20 20 45 61 63 |dual tes|ts. Eac|
|000004b0| 68 20 66 75 6e 63 74 69 | 6f 6e 0a 74 61 6b 65 73 |h functi|on.takes|
|000004c0| 20 74 77 6f 20 61 72 67 | 75 6d 65 6e 74 73 3a 20 | two arg|uments: |
|000004d0| 74 68 65 20 62 79 74 65 | 2d 73 74 72 65 61 6d 20 |the byte|-stream |
|000004e0| 61 6e 64 20 61 6e 20 6f | 70 65 6e 20 66 69 6c 65 |and an o|pen file|
|000004f0| 2d 6c 69 6b 65 20 6f 62 | 6a 65 63 74 2e 0a 57 68 |-like ob|ject..Wh|
|00000500| 65 6e 20 5c 63 6f 64 65 | 7b 77 68 61 74 28 29 7d |en \code|{what()}|
|00000510| 20 69 73 20 63 61 6c 6c | 65 64 20 77 69 74 68 20 | is call|ed with |
|00000520| 61 20 62 79 74 65 2d 73 | 74 72 65 61 6d 2c 20 74 |a byte-s|tream, t|
|00000530| 68 65 20 66 69 6c 65 2d | 6c 69 6b 65 0a 6f 62 6a |he file-|like.obj|
|00000540| 65 63 74 20 77 69 6c 6c | 20 62 65 20 5c 63 6f 64 |ect will| be \cod|
|00000550| 65 7b 4e 6f 6e 65 7d 2e | 0a 0a 54 68 65 20 74 65 |e{None}.|..The te|
|00000560| 73 74 20 66 75 6e 63 74 | 69 6f 6e 20 73 68 6f 75 |st funct|ion shou|
|00000570| 6c 64 20 72 65 74 75 72 | 6e 20 61 20 73 74 72 69 |ld retur|n a stri|
|00000580| 6e 67 20 64 65 73 63 72 | 69 62 69 6e 67 20 74 68 |ng descr|ibing th|
|00000590| 65 20 69 6d 61 67 65 20 | 74 79 70 65 20 69 66 0a |e image |type if.|
|000005a0| 74 68 65 20 74 65 73 74 | 20 73 75 63 63 65 65 64 |the test| succeed|
|000005b0| 65 64 2c 20 6f 72 20 5c | 63 6f 64 65 7b 4e 6f 6e |ed, or \|code{Non|
|000005c0| 65 7d 20 69 66 20 69 74 | 20 66 61 69 6c 65 64 2e |e} if it| failed.|
|000005d0| 0a 5c 65 6e 64 7b 64 61 | 74 61 64 65 73 63 7d 0a |.\end{da|tadesc}.|
|000005e0| 0a 45 78 61 6d 70 6c 65 | 3a 0a 0a 5c 62 65 67 69 |.Example|:..\begi|
|000005f0| 6e 7b 76 65 72 62 61 74 | 69 6d 7d 0a 3e 3e 3e 20 |n{verbat|im}.>>> |
|00000600| 69 6d 70 6f 72 74 20 69 | 6d 67 68 64 72 0a 3e 3e |import i|mghdr.>>|
|00000610| 3e 20 69 6d 67 68 64 72 | 2e 77 68 61 74 28 27 2f |> imghdr|.what('/|
|00000620| 74 6d 70 2f 62 61 73 73 | 2e 67 69 66 27 29 0a 27 |tmp/bass|.gif').'|
|00000630| 67 69 66 27 0a 5c 65 6e | 64 7b 76 65 72 62 61 74 |gif'.\en|d{verbat|
|00000640| 69 6d 7d 0a | |im}. | |
+--------+-------------------------+-------------------------+--------+--------+