ViewVC Help
View File | Revision Log | Show Annotations | Download File | View Changeset | Root Listing
root/src/trunk/contrib/file/magic/Magdir/images
(Generate patch)

Comparing trunk/contrib/file/magic/Magdir/images (file contents):
Revision 11007 by laffer1, Mon Jun 30 11:58:43 2014 UTC vs.
Revision 11008 by laffer1, Fri Jun 15 22:27:44 2018 UTC

# Line 1 | Line 1
1  
2   #------------------------------------------------------------------------------
3 < # $File: images,v 1.91 2014/04/30 21:41:02 christos Exp $
3 > # $File: images,v 1.126 2017/06/11 22:25:44 christos Exp $
4   # images:  file(1) magic for image formats (see also "iff", and "c-lang" for
5   # XPM bitmaps)
6   #
# Line 12 | Line 12
12  
13   # Targa - matches `povray', `ppmtotga' and `xv' outputs
14   # by Philippe De Muyter <phdm@macqel.be>
15 + # URL: http://justsolve.archiveteam.org/wiki/TGA
16 + # Reference: http://www.dca.fee.unicamp.br/~martino/disciplinas/ea978/tgaffs.pdf
17 + # Update: Joerg Jenderek
18   # at 2, byte ImgType must be 1, 2, 3, 9, 10 or 11
19 + #       ,32 or 33 (both not observed)
20   # at 1, byte CoMapType must be 1 if ImgType is 1 or 9, 0 otherwise
21 + #       or theoretically 2-128 reserved for use by Truevision or 128-255 may be used for developer applications
22   # at 3, leshort Index is 0 for povray, ppmtotga and xv outputs
23   # `xv' recognizes only a subset of the following (RGB with pixelsize = 24)
24   # `tgatoppm' recognizes a superset (Index may be anything)
25 < 1       belong&0xfff7ffff       0x01010000      Targa image data - Map
26 < !:strength + 2
27 < >2      byte&8                  8               - RLE
28 < >12     leshort                 >0              %d x
29 < >14     leshort                 >0              %d
30 < 1       belong&0xfff7ffff       0x00020000      Targa image data - RGB
31 < !:strength + 2
32 < >2      byte&8                  8               - RLE
33 < >12     leshort                 >0              %d x
34 < >14     leshort                 >0              %d
35 < 1       belong&0xfff7ffff       0x00030000      Targa image data - Mono
36 < !:strength + 2
37 < >2      byte&8                  8               - RLE
38 < >12     leshort                 >0              %d x
39 < >14     leshort                 >0              %d
25 > #
26 > # test of Color Map Type 0~no 1~color map
27 > # and Image Type 1 2 3 9 10 11 32 33
28 > # and Color Map Entry Size 0 15 16 24 32
29 > 0       ubequad&0x00FeC400000000C0      0
30 > # skip more garbage by looking for positive image type
31 > >2      ubyte                   >0
32 > # skip some compiled terminfo by looking for image type less equal 33
33 > >>2     ubyte                   <34
34 > # skip arches.3200 , Finder.Root , Slp.1 by looking for low pixel sizes 15 16 24 32
35 > >>>16   ubyte                   <33
36 > # skip more by looking for pixel size 0Fh 10h 18h 20h
37 > >>>>16  ubyte&0xC0              0x00
38 > # Color Map
39 > >>>>>1  belong&0xfff7ffff       0x01010000
40 > >>>>>>0         use             tga-image
41 > >>>>>1  belong&0xfff7ffff       0x00020000
42 > >>>>>>0         use             tga-image
43 > >>>>>1  belong&0xfff7ffff       0x00030000
44 > >>>>>>0         use             tga-image
45 > >>>>>1  default                 x
46 > # skip 260-16.ico by looking for no color map
47 > >>>>>>1 ubyte                   0
48 > # implies no first map entry
49 > >>>>>>>3        uleshort                0
50 > >>>>>>>>0       use             tga-image
51 > #       display tga bitmap image information
52 > 0       name                            tga-image
53 > >2      ubyte           <34             Targa image data
54 > !:mime  image/x-tga
55 > !:apple ????TPIC
56 > # normal extension .tga but some Truevision products used others:
57 > # tpic (Apple),icb (Image Capture Board),vda (Video Display Adapter),vst (NuVista),win (UNSURE about that)
58 > !:ext   tga/tpic/icb/vda/vst
59 > # image type 1 2 3 9 10 11 32 33
60 > >2      ubyte&0xF7      1               - Map
61 > >2      ubyte&0xF7      2               - RGB
62 > # alpha channel
63 > >>17    ubyte&0x0F      >0              \bA
64 > >2      ubyte&0xF7      3               - Mono
65 > # type not found, but by http://www.fileformat.info/format/tga/corion.htm
66 > # Compressed color-mapped data, using Huffman, Delta, and runlength encoding
67 > >2      ubyte           32              - Color
68 > # Compressed color-mapped data, using Huffman, Delta, and RLE. 4-pass quadtree- type process
69 > >2      ubyte           33              - Color
70 > # Color Map Type 0~no 1~color map
71 > >1      ubyte           1               (
72 > # first color map entry, 0 normal
73 > >>3     uleshort        >0              \b%d-
74 > # color map length 0 2 1dh 3bh d9h 100h
75 > >>5     uleshort        x               \b%d)
76 > # 8~run length encoding bit
77 > >2      ubyte&0x08      8               - RLE
78 > # gimp can create big pictures!
79 > >12     uleshort        >0              %d x
80 > >12     uleshort        =0              65536 x
81 > # image height. 0 interpreted as 65536
82 > >14     uleshort        >0              %d
83 > >14     uleshort        =0              65536
84 > # Image Pixel Size 15 16 24 32
85 > >16     ubyte           x               x %d
86 > # X origin of image. 0 normal
87 > >8      uleshort        >0              +%d
88 > # Y origin of image. 0 normal; positive for top
89 > >10     uleshort        >0              +%d
90 > # Image descriptor: bits 3-0 give the alpha channel depth, bits 5-4 give direction
91 > >17     ubyte&0x0F      >0              - %d-bit alpha
92 > # bits 5-4 give direction. normal bottom left
93 > >17     ubyte           &0x20           - top
94 > #>17    ubyte           ^0x20           - bottom
95 > >17     ubyte           &0x10           - right
96 > #>17    ubyte           ^0x10           - left
97 > # some info say other bits 6-7 should be zero
98 > # but data storage interleave by http://www.fileformat.info/format/tga/corion.htm
99 > # 00 - no interleave;01 - even/odd interleave; 10 - four way interleave; 11 - reserved
100 > #>17    ubyte&0xC0      0x00            - no interleave
101 > >17     ubyte&0xC0      0x40            - interleave
102 > >17     ubyte&0xC0      0x80            - four way interleave
103 > >17     ubyte&0xC0      0xC0            - reserved
104 > # positive length implies identification field
105 > >0      ubyte           >0
106 > >>18    string          x               "%s"
107 > # last 18 bytes of newer tga file footer signature
108 > >18     search/4261301/s        TRUEVISION-XFILE.\0
109 > # extension area offset if not 0
110 > >>&-8           ulelong                 >0
111 > # length of the extension area. normal 495 for version 2.0
112 > >>>(&-4.l)      uleshort                0x01EF
113 > # AuthorName[41]
114 > >>>>&0          string                  >\0             - author "%-.40s"
115 > # Comment[324]=4 * 80 null terminated
116 > >>>>&41         string                  >\0             - comment "%-.80s"
117 > # date
118 > >>>>&365        ubequad&0xffffFFFFffff0000      !0
119 > # Day
120 > >>>>>&-6                uleshort                x               %d
121 > # Month
122 > >>>>>&-8                uleshort                x               \b-%d
123 > # Year
124 > >>>>>&-4                uleshort                x               \b-%d
125 > # time
126 > >>>>&371        ubequad&0xffffFFFFffff0000      !0
127 > # hour
128 > >>>>>&-8                uleshort                x               %d
129 > # minutes
130 > >>>>>&-6                uleshort                x               \b:%.2d
131 > # second
132 > >>>>>&-4                uleshort                x               \b:%.2d
133 > # JobName[41]
134 > >>>>&377                string                  >\0             - job "%-.40s"
135 > # JobHour Jobminute Jobsecond
136 > >>>>&418        ubequad&0xffffFFFFffff0000      !0
137 > >>>>>&-8                uleshort                x               %d
138 > >>>>>&-6                uleshort                x               \b:%.2d
139 > >>>>>&-4                uleshort                x               \b:%.2d
140 > # SoftwareId[41]
141 > >>>>&424                string                  >\0             - %-.40s
142 > # SoftwareVersionNumber
143 > >>>>&424        ubyte                           >0
144 > >>>>>&40                uleshort/100            x               %d
145 > >>>>>&40                uleshort%100            x               \b.%d
146 > # VersionLetter
147 > >>>>>&42                ubyte                   >0x20           \b%c
148 > # KeyColor
149 > >>>>&468                ulelong                 >0              - keycolor 0x%8.8x
150 > # Denominator of Pixel ratio. 0~no pixel aspect
151 > >>>>&474        uleshort                        >0
152 > # Numerator
153 > >>>>>&-4                uleshort                >0              - aspect %d
154 > >>>>>&-2                uleshort                x               \b/%d
155 > # Denominator of Gamma ratio. 0~no Gamma value
156 > >>>>&478        uleshort                        >0
157 > # Numerator
158 > >>>>>&-4                uleshort                >0              - gamma %d
159 > >>>>>&-2                uleshort                x               \b/%d
160 > # ColorOffset
161 > #>>>>&480       ulelong                 x               - col offset 0x%8.8x
162 > # StampOffset
163 > #>>>>&484       ulelong                 x               - stamp offset 0x%8.8x
164 > # ScanOffset
165 > #>>>>&488       ulelong                 x               - scan offset 0x%8.8x
166 > # AttributesType
167 > #>>>>&492       ubyte                   x               - Attributes 0x%x
168 > ## EndOfTGA
169  
170   # PBMPLUS images
171   # The next byte following the magic is always whitespace.
172   # strength is changed to try these patterns before "x86 boot sector"
173 < 0       search/1        P1              
174 < >3      regex           =[0-9]{0,50}\ [0-9]{0,50}               Netpbm PBM image text
175 < >3      regex           =[0-9]{1,50}\           \b, size = %sx
176 < >>3     regex           =\ [0-9]{1,50}  \b%s
173 > 0       name            netpbm
174 > >3      regex/s         =[0-9]{1,50}\ [0-9]{1,50}       Netpbm image data
175 > >>&0    regex           =[0-9]{1,50}                    \b, size = %s x
176 > >>>&0   regex           =[0-9]{1,50}                    \b %s
177 >
178 > 0       search/1        P1
179 > >0      regex/4         P1[\040\t\f\r\n]
180 > >>0     use             netpbm
181 > >>>0    string          x       \b, bitmap
182   !:strength + 45
183   !:mime  image/x-portable-bitmap
184 < 0       search/1        P2              
185 < >3      regex           =[0-9]{0,50}\ [0-9]{0,50}               Netpbm PGM image text
186 < >3      regex           =[0-9]{1,50}\           \b, size = %sx
187 < >>3     regex           =\ [0-9]{1,50}  \b%s
184 >
185 > 0       search/1        P2
186 > >0      regex/4         P2[\040\t\f\r\n]
187 > >>0     use             netpbm
188 > >>>0    string          x       \b, greymap
189   !:strength + 45
190   !:mime  image/x-portable-greymap
191 +
192   0       search/1        P3
193 < >3      regex           =[0-9]{0,50}\ [0-9]{0,50}               Netpbm PPM image text
194 < >3      regex           =[0-9]{1,50}\           \b, size = %sx
195 < >>3     regex           =\ [0-9]{1,50}  \b%s
193 > >0      regex/4         P3[\040\t\f\r\n]
194 > >>0     use             netpbm
195 > >>>0    string          x       \b, pixmap
196   !:strength + 45
197   !:mime  image/x-portable-pixmap
198 < 0       string          P4              
199 < >3      regex           =[0-9]{0,50}\ [0-9]{0,50}               Netpbm PBM "rawbits" image data
200 < >3      regex           =[0-9]{1,50}\           \b, size = %sx
201 < >>3     regex           =\ [0-9]{1,50}  \b%s
198 >
199 > 0       string          P4
200 > >0      regex/4         P4[\040\t\f\r\n]
201 > >>0     use             netpbm
202 > >>>0    string          x       \b, rawbits, bitmap
203   !:strength + 45
204   !:mime  image/x-portable-bitmap
205 < 0       string          P5              
206 < >3      regex           =[0-9]{0,50}\ [0-9]{0,50}               Netpbm PGM "rawbits" image data
207 < >3      regex           =[0-9]{1,50}\           \b, size = %sx
208 < >>3     regex           =\ [0-9]{1,50}  \b%s
205 >
206 > 0       string          P5
207 > >0      regex/4         P5[\040\t\f\r\n]
208 > >>0     use             netpbm
209 > >>>0    string          x       \b, rawbits, greymap
210   !:strength + 45
211   !:mime  image/x-portable-greymap
212 < 0       string          P6              
213 < >3      regex           =[0-9]{0,50}\ [0-9]{0,50}               Netpbm PPM "rawbits" image data
214 < >3      regex           =[0-9]{1,50}\           \b, size = %sx
215 < >>3     regex           =\ [0-9]{1,50}  \b%s
212 >
213 > 0       string          P6
214 > >0      regex/4         P6[\040\t\f\r\n]
215 > >>0     use             netpbm
216 > >>>0    string          x       \b, rawbits, pixmap
217   !:strength + 45
218   !:mime  image/x-portable-pixmap
219 +
220   0       string          P7              Netpbm PAM image file
221   !:mime  image/x-portable-pixmap
222  
# Line 115 | Line 260
260   # never changed.  The TIFF specification recommends testing for it.
261   0       string          MM\x00\x2a      TIFF image data, big-endian
262   !:mime  image/tiff
263 + >(4.L)  use             \^tiff_ifd
264   0       string          II\x2a\x00      TIFF image data, little-endian
265   !:mime  image/tiff
266 + >(4.l)  use             tiff_ifd
267  
268 + 0       name            tiff_ifd
269 + >0      leshort         x               \b, direntries=%d
270 + >2      use             tiff_entry
271 +
272 + 0       name            tiff_entry
273 + # NewSubFileType
274 + >0      leshort         0xfe
275 + >>12    use             tiff_entry
276 + >0      leshort         0x100
277 + >>4     lelong          1
278 + >>>12   use             tiff_entry
279 + >>>8    leshort         x               \b, width=%d
280 + >0      leshort         0x101
281 + >>4     lelong          1
282 + >>>8    leshort         x               \b, height=%d
283 + >>>12   use             tiff_entry
284 + >0      leshort         0x102
285 + >>8     leshort         x               \b, bps=%d
286 + >>12    use             tiff_entry
287 + >0      leshort         0x103
288 + >>4     lelong          1               \b, compression=
289 + >>>8    leshort         1               \bnone
290 + >>>8    leshort         2               \bhuffman
291 + >>>8    leshort         3               \bbi-level group 3
292 + >>>8    leshort         4               \bbi-level group 4
293 + >>>8    leshort         5               \bLZW
294 + >>>8    leshort         6               \bJPEG (old)
295 + >>>8    leshort         7               \bJPEG
296 + >>>8    leshort         8               \bdeflate
297 + >>>8    leshort         9               \bJBIG, ITU-T T.85
298 + >>>8    leshort         0xa             \bJBIG, ITU-T T.43
299 + >>>8    leshort         0x7ffe          \bNeXT RLE 2-bit
300 + >>>8    leshort         0x8005          \bPackBits (Macintosh RLE)
301 + >>>8    leshort         0x8029          \bThunderscan RLE
302 + >>>8    leshort         0x807f          \bRasterPadding (CT or MP)
303 + >>>8    leshort         0x8080          \bRLE (Line Work)
304 + >>>8    leshort         0x8081          \bRLE (High-Res Cont-Tone)
305 + >>>8    leshort         0x8082          \bRLE (Binary Line Work)
306 + >>>8    leshort         0x80b2          \bDeflate (PKZIP)
307 + >>>8    leshort         0x80b3          \bKodak DCS
308 + >>>8    leshort         0x8765          \bJBIG
309 + >>>8    leshort         0x8798          \bJPEG2000
310 + >>>8    leshort         0x8799          \bNikon NEF Compressed
311 + >>>8    default         x
312 + >>>>8   leshort         x               \b(unknown 0x%x)
313 + >>>12   use             tiff_entry
314 + >0      leshort         0x106           \b, PhotometricIntepretation=
315 + >>8     clear           x
316 + >>8     leshort         0               \bWhiteIsZero
317 + >>8     leshort         1               \bBlackIsZero
318 + >>8     leshort         2               \bRGB
319 + >>8     leshort         3               \bRGB Palette
320 + >>8     leshort         4               \bTransparency Mask
321 + >>8     leshort         5               \bCMYK
322 + >>8     leshort         6               \bYCbCr
323 + >>8     leshort         8               \bCIELab
324 + >>8     default         x
325 + >>>8    leshort         x               \b(unknown=0x%x)
326 + >>12    use             tiff_entry
327 + # FillOrder
328 + >0      leshort         0x10a
329 + >>4     lelong          1
330 + >>>12   use             tiff_entry
331 + # DocumentName
332 + >0      leshort         0x10d
333 + >>(8.l) string          x               \b, name=%s
334 + >>>12   use             tiff_entry
335 + # ImageDescription
336 + >0      leshort         0x10e
337 + >>(8.l) string          x               \b, description=%s
338 + >>>12   use             tiff_entry
339 + # Make
340 + >0      leshort         0x10f
341 + >>(8.l) string          x               \b, manufacturer=%s
342 + >>>12   use             tiff_entry
343 + # Model
344 + >0      leshort         0x110
345 + >>(8.l) string          x               \b, model=%s
346 + >>>12   use             tiff_entry
347 + # StripOffsets
348 + >0      leshort         0x111
349 + >>12    use             tiff_entry
350 + # Orientation
351 + >0      leshort         0x112           \b, orientation=
352 + >>8     leshort         1               \bupper-left
353 + >>8     leshort         3               \blower-right
354 + >>8     leshort         6               \bupper-right
355 + >>8     leshort         8               \blower-left
356 + >>8     leshort         9               \bundefined
357 + >>8     default         x
358 + >>>8    leshort         x               \b[*%d*]
359 + >>12    use             tiff_entry
360 + # XResolution
361 + >0      leshort         0x11a
362 + >>8     lelong          x               \b, xresolution=%d
363 + >>12    use             tiff_entry
364 + # YResolution
365 + >0      leshort         0x11b
366 + >>8     lelong          x               \b, yresolution=%d
367 + >>12    use             tiff_entry
368 + # ResolutionUnit
369 + >0      leshort         0x128
370 + >>8     leshort         x               \b, resolutionunit=%d
371 + >>12    use             tiff_entry
372 + # Software
373 + >0      leshort         0x131
374 + >>(8.l) string          x               \b, software=%s
375 + >>12    use             tiff_entry
376 + # Datetime
377 + >0      leshort         0x132
378 + >>(8.l) string          x               \b, datetime=%s
379 + >>12    use             tiff_entry
380 + # HostComputer
381 + >0      leshort         0x13c
382 + >>(8.l) string          x               \b, hostcomputer=%s
383 + >>12    use             tiff_entry
384 + # WhitePoint
385 + >0      leshort         0x13e
386 + >>12    use             tiff_entry
387 + # PrimaryChromaticities
388 + >0      leshort         0x13f
389 + >>12    use             tiff_entry
390 + # YCbCrCoefficients
391 + >0      leshort         0x211
392 + >>12    use             tiff_entry
393 + # YCbCrPositioning
394 + >0      leshort         0x213
395 + >>12    use             tiff_entry
396 + # ReferenceBlackWhite
397 + >0      leshort         0x214
398 + >>12    use             tiff_entry
399 + # Copyright
400 + >0      leshort         0x8298
401 + >>(8.l) string          x               \b, copyright=%s
402 + >>12    use             tiff_entry
403 + # ExifOffset
404 + >0      leshort         0x8769
405 + >>12    use             tiff_entry
406 + # GPS IFD
407 + >0      leshort         0x8825          \b, GPS-Data
408 + >>12    use             tiff_entry
409 +
410 + #>0     leshort         x               \b, unknown=0x%x
411 + #>>12   use             tiff_entry
412 +
413   0       string          MM\x00\x2b      Big TIFF image data, big-endian
414   !:mime  image/tiff
415   0       string          II\x2b\x00      Big TIFF image data, little-endian
# Line 127 | Line 419
419   # (Greg Roelofs, newt@uchicago.edu)
420   # (Albert Cahalan, acahalan@cs.uml.edu)
421   #
422 < # 137 P N G \r \n ^Z \n [4-byte length] H E A D [HEAD data] [HEAD crc] ...
422 > # 137 P N G \r \n ^Z \n [4-byte length] I H D R [HEAD data] [HEAD crc] ...
423   #
424 < 0       string          \x89PNG\x0d\x0a\x1a\x0a         PNG image data
424 >
425 > # IHDR parser
426 > 0       name            png-ihdr
427 > >0      belong          x               \b, %d x
428 > >4      belong          x               %d,
429 > >8      byte            x               %d-bit
430 > >9      byte            0               grayscale,
431 > >9      byte            2               \b/color RGB,
432 > >9      byte            3               colormap,
433 > >9      byte            4               gray+alpha,
434 > >9      byte            6               \b/color RGBA,
435 > #>10    byte            0               deflate/32K,
436 > >12     byte            0               non-interlaced
437 > >12     byte            1               interlaced
438 >
439 > # Standard PNG image.
440 > 0       string          \x89PNG\x0d\x0a\x1a\x0a\x00\x00\x00\x0DIHDR     PNG image data
441   !:mime  image/png
442 < >16     belong          x               \b, %d x
443 < >20     belong          x               %d,
136 < >24     byte            x               %d-bit
137 < >25     byte            0               grayscale,
138 < >25     byte            2               \b/color RGB,
139 < >25     byte            3               colormap,
140 < >25     byte            4               gray+alpha,
141 < >25     byte            6               \b/color RGBA,
142 < #>26    byte            0               deflate/32K,
143 < >28     byte            0               non-interlaced
144 < >28     byte            1               interlaced
442 > !:strength +10
443 > >16     use             png-ihdr
444  
445 + # Apple CgBI PNG image.
446 + 0       string          \x89PNG\x0d\x0a\x1a\x0a\x00\x00\x00\x04CgBI
447 + >24     string          \x00\x00\x00\x0DIHDR    PNG image data (CgBI)
448 + !:mime  image/png
449 + !:strength +10
450 + >>32    use             png-ihdr
451 +
452   # possible GIF replacements; none yet released!
453   # (Greg Roelofs, newt@uchicago.edu)
454   #
# Line 151 | Line 457
457   !:mime  image/x-unknown
458   #
459   # GRR 950115:  this is Jeremy Wohl's Free Graphics Format (better):
460 < #                                      
460 > #
461   0       string          FGF95a          FGF image (GIF+deflate beta)
462   !:mime  image/x-unknown
463   #
464   # GRR 950115:  this is Thomas Boutell's Portable Bitmap Format proposal
465   # (best; not yet implemented):
466 < #                                      
466 > #
467   0       string          PBF             PBF image (deflate compression)
468   !:mime  image/x-unknown
469  
# Line 241 | Line 547
547   # http://www.blackfiveservices.co.uk/awbmtools.shtml
548   # http://biosgfx.narod.ru/v3/
549   # http://biosgfx.narod.ru/abr-2/
550 < 0       string          AWBM            
550 > 0       string          AWBM
551   >4      leshort         <1981           Award BIOS bitmap
552   !:mime  image/x-award-bmp
553   # image width is a multiple of 4
554 < >>4     leshort&0x0003  0              
554 > >>4     leshort&0x0003  0
555   >>>4            leshort x               \b, %d
556   >>>6            leshort x               x %d
557   >>4     leshort&0x0003  >0              \b,
558 < >>>4    leshort&0x0003  =1              
558 > >>>4    leshort&0x0003  =1
559   >>>>4           leshort x               %d+3
560 < >>>4    leshort&0x0003  =2              
560 > >>>4    leshort&0x0003  =2
561   >>>>4           leshort x               %d+2
562 < >>>4    leshort&0x0003  =3              
562 > >>>4    leshort&0x0003  =3
563   >>>>4           leshort x               %d+1
564   >>>6            leshort x               x %d
565   # at offset 8 starts imagedata followed by "RGB " marker
# Line 393 | Line 699
699   0       beshort         0x1010          PEX Binary Archive
700  
701   # DICOM medical imaging data
702 + # URL:          https://en.wikipedia.org/wiki/DICOM#Data_format
703 + # Note:         "dcm" is the official file name extension
704 + #               XnView mention also "dc3" and "acr" as file name extension
705   128     string  DICM                    DICOM medical imaging data
706   !:mime  application/dicom
707 + !:ext dcm/dicom/dic
708  
709   # XWD - X Window Dump file.
710   #   As described in /usr/X11R6/include/X11/XWDFile.h
# Line 473 | Line 783
783   # http://web.archive.org/web/20100206055706/http://www.qzx.com/pc-gpe/pcx.txt
784   # GRR: original test was still too general as it catches xbase examples T5.DBT,T6.DBT with 0xa000000
785   # test for bytes 0x0a,version byte (0,2,3,4,5),compression byte flag(0,1), bit depth (>0) of PCX or T5.DBT,T6.DBT
786 < 0       ubelong&0xffF8fe00      0x0a000000      
787 < # for PCX bit depth > 0
788 < >3      ubyte           >0      
786 > 0       ubelong&0xffF8fe00      0x0a000000
787 > # for PCX bit depth > 0
788 > >3      ubyte           >0
789   # test for valid versions
790 < >>1     ubyte           <6      
790 > >>1     ubyte           <6
791   >>>1    ubyte           !1      PCX
792   !:mime  image/x-pcx
793   #!:mime image/pcx
# Line 533 | Line 843
843   >25     string  >\0     dated %.14s
844  
845   # GEM Image: Version 1, Headerlen 8 (Wolfram Kleff)
846 < 0       belong          0x00010008      GEM Image data
847 < >12     beshort         x               %d x
848 < >14     beshort         x               %d,
849 < >4      beshort         x               %d planes,
850 < >8      beshort         x               %d x
851 < >10     beshort         x               %d pixelsize
846 > # Format variations from: Bernd Nuernberger <bernd.nuernberger@web.de>
847 > # Update: Joerg Jenderek
848 > # See http://fileformats.archiveteam.org/wiki/GEM_Raster
849 > # For variations, also see:
850 > #    http://www.seasip.info/Gem/ff_img.html (Ventura)
851 > #    http://www.atari-wiki.com/?title=IMG_file (XIMG, STTT)
852 > #    http://www.fileformat.info/format/gemraster/spec/index.htm (XIMG, STTT)
853 > #    http://sylvana.net/1stguide/1STGUIDE.ENG (TIMG)
854 > 0       beshort     0x0001
855 > # header_size
856 > >2      beshort     0x0008
857 > >>0     use gem_info
858 > >2      beshort     0x0009
859 > >>0     use gem_info
860 > # no example for NOSIG
861 > >2      beshort     24
862 > >>0     use gem_info
863 > # no example for HYPERPAINT
864 > >2      beshort     25
865 > >>0     use gem_info
866 > 16      string      XIMG\0
867 > >0      use gem_info
868 > # no example
869 > 16      string      STTT\0\x10
870 > >0      use gem_info
871 > # no example or description
872 > 16      string      TIMG\0
873 > >0      use gem_info
874  
875 + 0   name        gem_info
876 + # version is 2 for some XIMG and 1 for all others
877 + >0      beshort         <0x0003         GEM
878 + # http://www.snowstone.org.uk/riscos/mimeman/mimemap.txt
879 + !:mime  image/x-gem
880 + # header_size 24 25 27 59 779 words for colored bitmaps
881 + >>2     beshort         >9
882 + >>>16   string          STTT\0\x10      STTT
883 + >>>16   string          TIMG\0          TIMG
884 + # HYPERPAINT or NOSIG variant
885 + >>>16   string          \0\x80
886 + >>>>2   beshort         =24             NOSIG
887 + >>>>2   beshort         !24             HYPERPAINT
888 + # NOSIG or XIMG variant
889 + >>>16   default         x
890 + >>>>16  string          !XIMG\0         NOSIG
891 + >>16    string          =XIMG\0         XIMG Image data
892 + !:ext   img/ximg
893 + # to avoid Warning: Current entry does not yet have a description for adding a EXTENSION type
894 + >>16    string          !XIMG\0         Image data
895 + !:ext   img
896 + # header_size is 9 for Ventura files and 8 for other GEM Paint files
897 + >>2     beshort         9               (Ventura)
898 + #>>2    beshort         8               (Paint)
899 + >>12    beshort         x               %d x
900 + >>14    beshort         x               %d,
901 + # 1 4 8
902 + >>4     beshort         x               %d planes,
903 + # in tenths of a millimetre
904 + >>8     beshort         x               %d x
905 + >>10    beshort         x               %d pixelsize
906 + # pattern_size 1-8. 2 for GEM Paint
907 + >>6     beshort         !2              \b, pattern size %d
908 +
909   # GEM Metafile (Wolfram Kleff)
910   0       lelong          0x0018FFFF      GEM Metafile data
911   >4      leshort         x               version %d
# Line 827 | Line 1193
1193   !:mime  image/x-polar-monitor-bitmap
1194  
1195   # From: Rick Richardson <rickrich@gmail.com>
1196 + # updated by: Joerg Jenderek
1197 + # URL: http://techmods.net/nuvi/
1198   0       string  GARMIN\ BITMAP\ 01      Garmin Bitmap file
1199 + # extension is also used for
1200 + # Sony SRF raw image (image/x-sony-srf)
1201 + # SRF map
1202 + # Terragen Surface Map (http://www.planetside.co.uk/terragen)
1203 + # FileLocator Pro search criteria file (http://www.mythicsoft.com/filelocatorpro)
1204 + !:ext srf
1205 + #!:mime image/x-garmin-srf
1206 + # version 1.00,2.00,2.10,2.40,2.50
1207 + >0x2f   string          >0              \b, version %4.4s
1208 + # width (2880,2881,3240)
1209 + >0x55   uleshort        >0              \b, %dx
1210 + # height (80,90)
1211 + >>0x53  uleshort        x               \b%d
1212  
1213   # Type: Ulead Photo Explorer5 (.pe5)
1214   # URL:  http://www.jisyo.com/cgibin/view.cgi?EXT=pe5 (Japanese)
# Line 891 | Line 1272
1272   # From: "Tano M. Fotang" <mfotang@quanteq.com>
1273   0       string  \x46\x4d\x52\x00        ISO/IEC 19794-2 Format Minutiae Record (FMR)
1274  
1275 < # WEBP https://developers.google.com/speed/webp/docs/riff_container
1276 < 0       string  RIFF
1277 < >8      string  WEBP    Web/P image data
1278 < >>4     lelong  x       \b, %d bytes
1275 > # doc: http://www.shikino.co.jp/eng/products/images/FLOWER.jpg.zip
1276 > # example: http://www.shikino.co.jp/eng/products/images/FLOWER.wdp.zip
1277 > 90      bequad          0x574D50484F544F00      JPEG-XR Image
1278 > >98     byte&0x08       =0x08                   \b, hard tiling
1279 > >99     byte&0x80       =0x80                   \b, tiling present
1280 > >99     byte&0x40       =0x40                   \b, codestream present
1281 > >99     byte&0x38       x                       \b, spatial xform=
1282 > >99     byte&0x38       0x00                    \bTL
1283 > >99     byte&0x38       0x08                    \bBL
1284 > >99     byte&0x38       0x10                    \bTR
1285 > >99     byte&0x38       0x18                    \bBR
1286 > >99     byte&0x38       0x20                    \bBT
1287 > >99     byte&0x38       0x28                    \bRB
1288 > >99     byte&0x38       0x30                    \bLT
1289 > >99     byte&0x38       0x38                    \bLB
1290 > >100    byte&0x80       =0x80                   \b, short header
1291 > >>102   beshort+1       x                       \b, %d
1292 > >>104   beshort+1       x                       \bx%d
1293 > >100    byte&0x80       =0x00                   \b, long header
1294 > >>102   belong+1        x                       \b, %x
1295 > >>106   belong+1        x                       \bx%x
1296 > >101    beshort&0xf     x                       \b, bitdepth=
1297 > >>101   beshort&0xf     0x0                     \b1-WHITE=1
1298 > >>101   beshort&0xf     0x1                     \b8
1299 > >>101   beshort&0xf     0x2                     \b16
1300 > >>101   beshort&0xf     0x3                     \b16-SIGNED
1301 > >>101   beshort&0xf     0x4                     \b16-FLOAT
1302 > >>101   beshort&0xf     0x5                     \b(reserved 5)
1303 > >>101   beshort&0xf     0x6                     \b32-SIGNED
1304 > >>101   beshort&0xf     0x7                     \b32-FLOAT
1305 > >>101   beshort&0xf     0x8                     \b5
1306 > >>101   beshort&0xf     0x9                     \b10
1307 > >>101   beshort&0xf     0xa                     \b5-6-5
1308 > >>101   beshort&0xf     0xb                     \b(reserved %d)
1309 > >>101   beshort&0xf     0xc                     \b(reserved %d)
1310 > >>101   beshort&0xf     0xd                     \b(reserved %d)
1311 > >>101   beshort&0xf     0xe                     \b(reserved %d)
1312 > >>101   beshort&0xf     0xf                     \b1-BLACK=1
1313 > >101    beshort&0xf0    x                       \b, colorfmt=
1314 > >>101   beshort&0xf0    0x00                    \bYONLY
1315 > >>101   beshort&0xf0    0x10                    \bYUV240
1316 > >>101   beshort&0xf0    0x20                    \bYWV422
1317 > >>101   beshort&0xf0    0x30                    \bYWV444
1318 > >>101   beshort&0xf0    0x40                    \bCMYK
1319 > >>101   beshort&0xf0    0x50                    \bCMYKDIRECT
1320 > >>101   beshort&0xf0    0x60                    \bNCOMPONENT
1321 > >>101   beshort&0xf0    0x70                    \bRGB
1322 > >>101   beshort&0xf0    0x80                    \bRGBE
1323 > >>101   beshort&0xf0    >0x80                   \b(reserved 0x%x)
1324 >
1325 > # From: Johan van der Knijff <johan.vanderknijff@kb.nl>
1326 > #
1327 > # BPG (Better Portable Graphics) format
1328 > # http://bellard.org/bpg/
1329 > # http://fileformats.archiveteam.org/wiki/BPG
1330 > #
1331 > 0       string  \x42\x50\x47\xFB        BPG (Better Portable Graphics)
1332 > !:mime  image/bpg
1333 >
1334 > # From: Joerg Jenderek
1335 > # URL: https://en.wikipedia.org/wiki/Apple_Icon_Image_format
1336 > 0       string          icns            Mac OS X icon
1337 > !:mime  image/x-icns
1338 > !:apple ????icns
1339 > !:ext icns
1340 > >4      ubelong         >0
1341 > # file size
1342 > >>4     ubelong         x               \b, %d bytes
1343 > # icon type
1344 > >>8     string          x               \b, "%4.4s" type
1345 >
1346 > # TIM images
1347 > 0               lelong          0x00000010      TIM image,
1348 > >4              lelong          0x8             4-Bit,
1349 > >4              lelong          0x9             8-Bit,
1350 > >4              lelong          0x2             15-Bit,
1351 > >4              lelong          0x3             24-Bit,
1352 > >4              lelong          &8
1353 > >>(8.l+12)      leshort         x               Pixel at (%d,
1354 > >>(8.l+14)      leshort         x               \b%d)
1355 > >>(8.l+16)      leshort         x               Size=%dx
1356 > >>(8.l+18)      leshort         x               \b%d,
1357 > >>4             lelong          0x8             16 CLUT Entries at
1358 > >>4             lelong          0x9             256 CLUT Entries at
1359 > >>12            leshort         x               (%d,
1360 > >>14            leshort         x               \b%d)
1361 > >4              lelong          ^8
1362 > >>12            leshort         x               Pixel at (%d,
1363 > >>14            leshort         x               \b%d)
1364 > >>16            leshort         x               Size=%dx
1365 > >>18            leshort         x               \b%d
1366 >
1367 > # MDEC streams
1368 > 0               lelong          0x80010160      MDEC video stream,
1369 > >16             leshort         x               %dx
1370 > >18             leshort         x               \b%d
1371 > #>8             lelong          x               %d frames
1372 > #>4             leshort         x               secCount=%d;
1373 > #>6             leshort         x               nSectors=%d;
1374 > #>12            lelong          x               frameSize=%d;
1375 >
1376 > # BS encoded bitstreams
1377 > 2               leshort         0x3800          BS image,
1378 > >6              leshort         x               Version %d,
1379 > >4              leshort         x               Quantization %d,
1380 > >0              leshort         x               (Decompresses to %d words)
1381 >
1382 > # Type: farbfeld image.
1383 > # Url: http://tools.suckless.org/farbfeld/
1384 > # From: Ian D. Scott <ian@iandouglasscott.com>
1385 > #
1386 > 0               string          farbfeld        farbfeld image data,
1387 > >8              ubelong         x               %dx
1388 > >12             ubelong         x               \b%d
1389 >
1390 > # Type: Sega PVR image.
1391 > # From: David Korth <gerbilsoft@gerbilsoft.com>
1392 > # References:
1393 > # - http://fabiensanglard.net/Mykaruga/tools/segaPVRFormat.txt
1394 > # - https://github.com/yazgoo/pvrx2png
1395 > # - https://github.com/nickworonekin/puyotools
1396 >
1397 > # Sega PVR header.
1398 > 0       name    sega-pvr-image-header
1399 > >0x0C   leshort x       %d x
1400 > >0x0E   leshort x       %d
1401 > # Image format.
1402 > >0x08   byte    0       \b, ARGB1555
1403 > >0x08   byte    1       \b, RGB565
1404 > >0x08   byte    2       \b, ARGB4444
1405 > >0x08   byte    3       \b, YUV442
1406 > >0x08   byte    4       \b, Bump
1407 > >0x08   byte    5       \b, 4bpp
1408 > >0x08   byte    6       \b, 8bpp
1409 > # Image data type.
1410 > >0x09   byte    0x01    \b, square twiddled
1411 > >0x09   byte    0x02    \b, square twiddled & mipmap
1412 > >0x09   byte    0x03    \b, VQ
1413 > >0x09   byte    0x04    \b, VQ & mipmap
1414 > >0x09   byte    0x05    \b, 8-bit CLUT twiddled
1415 > >0x09   byte    0x06    \b, 4-bit CLUT twiddled
1416 > >0x09   byte    0x07    \b, 8-bit direct twiddled
1417 > >0x09   byte    0x08    \b, 4-bit direct twiddled
1418 > >0x09   byte    0x09    \b, rectangle
1419 > >0x09   byte    0x0B    \b, rectangular stride
1420 > >0x09   byte    0x0D    \b, rectangular twiddled
1421 > >0x09   byte    0x10    \b, small VQ
1422 > >0x09   byte    0x11    \b, small VQ & mipmap
1423 > >0x09   byte    0x12    \b, square twiddled & mipmap
1424 >
1425 > # Sega PVR (Xbox) image header.
1426 > # Contains an embedded DirectDraw surface instead of PVR data.
1427 > 0       name    sega-pvr-xbox-dds-header
1428 > >16     lelong  x       %d x
1429 > >12     lelong  x       %d,
1430 > >84     string  x       %.4s
1431 >
1432 > # Sega PVR image.
1433 > 0       string  PVRT
1434 > >0x10   string  DDS\040\174\000\000\000 Sega PVR (Xbox) image:
1435 > >>0x20  use     sega-pvr-xbox-dds-header
1436 > >0x10   belong  !0x44445320             Sega PVR image:
1437 > >>0     use     sega-pvr-image-header
1438 >
1439 > # Sega PVR image with GBIX.
1440 > 0       string  GBIX
1441 > >0x10   string  PVRT
1442 > >>0x10  string  DDS\040\174\000\000\000 Sega PVR (Xbox) image:
1443 > >>>0x20 use     sega-pvr-xbox-dds-header
1444 > >>0x10  belong  !0x44445320             Sega PVR image:
1445 > >>>0x10 use     sega-pvr-image-header
1446 > >>0x08  lelong  x       \b, global index = %u
1447 >
1448 > # Sega GVR header.
1449 > 0       name    sega-gvr-image-header
1450 > >0x0C   beshort x       %d x
1451 > >0x0E   beshort x       %d
1452 > # Image data format.
1453 > >0x0B   byte    0       \b, I4
1454 > >0x0B   byte    1       \b, I8
1455 > >0x0B   byte    2       \b, IA4
1456 > >0x0B   byte    3       \b, IA8
1457 > >0x0B   byte    4       \b, RGB565
1458 > >0x0B   byte    5       \b, RGB5A3
1459 > >0x0B   byte    6       \b, ARGB8888
1460 > >0x0B   byte    8       \b, CI4
1461 > >0x0B   byte    9       \b, CI8
1462 > >0x0B   byte    14      \b, DXT1
1463 >
1464 > # Sega GVR image.
1465 > 0       string  GVRT    Sega GVR image:
1466 > >0x10   use     sega-gvr-image-header
1467 >
1468 > # Sega GVR image with GBIX.
1469 > 0       string  GBIX
1470 > >0x10   string  GVRT    Sega GVR image:
1471 > >>0x10  use     sega-gvr-image-header
1472 > >>0x08  belong  x       \b, global index = %u
1473 >
1474 > # Light Field Picture
1475 > # Documentation: http://optics.miloush.net/lytro/TheFileFormat.aspx
1476 > # Typical file extensions: .lfp .lfr .lfx
1477 >
1478 > 0       belong  0x894C4650
1479 > >4      belong  0x0D0A1A0A
1480 > >12     belong  0x00000000      Lytro Light Field Picture
1481 > >8      belong  x               \b, version %d

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines