images 44 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447
  1. #------------------------------------------------------------------------------
  2. # $File: images,v 1.116 2016/03/23 15:29:20 christos Exp $
  3. # images: file(1) magic for image formats (see also "iff", and "c-lang" for
  4. # XPM bitmaps)
  5. #
  6. # originally from jef@helios.ee.lbl.gov (Jef Poskanzer),
  7. # additions by janl@ifi.uio.no as well as others. Jan also suggested
  8. # merging several one- and two-line files into here.
  9. #
  10. # little magic: PCX (first byte is 0x0a)
  11. # Targa - matches `povray', `ppmtotga' and `xv' outputs
  12. # by Philippe De Muyter <phdm@macqel.be>
  13. # URL: http://justsolve.archiveteam.org/wiki/TGA
  14. # Reference: http://www.dca.fee.unicamp.br/~martino/disciplinas/ea978/tgaffs.pdf
  15. # Update: Joerg Jenderek
  16. # at 2, byte ImgType must be 1, 2, 3, 9, 10 or 11
  17. # ,32 or 33 (both not observed)
  18. # at 1, byte CoMapType must be 1 if ImgType is 1 or 9, 0 otherwise
  19. # or theoretically 2-128 reserved for use by Truevision or 128-255 may be used for developer applications
  20. # at 3, leshort Index is 0 for povray, ppmtotga and xv outputs
  21. # `xv' recognizes only a subset of the following (RGB with pixelsize = 24)
  22. # `tgatoppm' recognizes a superset (Index may be anything)
  23. #
  24. # test of Color Map Type 0~no 1~color map
  25. # and Image Type 1 2 3 9 10 11 32 33
  26. # and Color Map Entry Size 0 15 16 24 32
  27. 0 ubequad&0x00FeC400000000C0 0
  28. # skip more garbage by looking for positive image type
  29. >2 ubyte >0
  30. # skip some compiled terminfo by looking for image type less equal 33
  31. >>2 ubyte <34
  32. # skip arches.3200 , Finder.Root , Slp.1 by looking for low pixel sizes 15 16 24 32
  33. >>>16 ubyte <33
  34. # skip more by looking for pixel size 0Fh 10h 18h 20h
  35. >>>>16 ubyte&0xC0 0x00
  36. # skip 260-16.ico by looking for no color map
  37. >>>>>1 ubyte 0
  38. # implies no first map entry
  39. >>>>>>3 uleshort 0
  40. >>>>>>>0 use tga-image
  41. # Color Map
  42. >>>>>1 ubyte >0
  43. >>>>>>0 use tga-image
  44. # display tga bitmap image information
  45. 0 name tga-image
  46. >2 ubyte <34 Targa image data
  47. !:mime image/x-tga
  48. !:apple ????TPIC
  49. # normal extension .tga but some Truevision products used others:
  50. # tpic (Apple),icb (Image Capture Board),vda (Video Display Adapter),vst (NuVista),win (UNSURE about that)
  51. !:ext tga/tpic/icb/vda/vst
  52. # image type 1 2 3 9 10 11 32 33
  53. >2 ubyte&0xF7 1 - Map
  54. >2 ubyte&0xF7 2 - RGB
  55. # alpha channel
  56. >>17 ubyte&0x0F >0 \bA
  57. >2 ubyte&0xF7 3 - Mono
  58. # type not found, but by http://www.fileformat.info/format/tga/corion.htm
  59. # Compressed color-mapped data, using Huffman, Delta, and runlength encoding
  60. >2 ubyte 32 - Color
  61. # Compressed color-mapped data, using Huffman, Delta, and RLE. 4-pass quadtree- type process
  62. >2 ubyte 33 - Color
  63. # Color Map Type 0~no 1~color map
  64. >1 ubyte 1 (
  65. # first color map entry, 0 normal
  66. >>3 uleshort >0 \b%d-
  67. # color map length 0 2 1dh 3bh d9h 100h
  68. >>5 uleshort x \b%d)
  69. # 8~run length encoding bit
  70. >2 ubyte&0x08 8 - RLE
  71. # gimp can create big pictures!
  72. >12 uleshort >0 %d x
  73. >12 uleshort =0 65536 x
  74. # image height. 0 interpreted as 65536
  75. >14 uleshort >0 %d
  76. >14 uleshort =0 65536
  77. # Image Pixel Size 15 16 24 32
  78. >16 ubyte x x %d
  79. # X origin of image. 0 normal
  80. >8 uleshort >0 +%d
  81. # Y origin of image. 0 normal; positive for top
  82. >10 uleshort >0 +%d
  83. # Image descriptor: bits 3-0 give the alpha channel depth, bits 5-4 give direction
  84. >17 ubyte&0x0F >0 - %d-bit alpha
  85. # bits 5-4 give direction. normal bottom left
  86. >17 ubyte &0x20 - top
  87. #>17 ubyte ^0x20 - bottom
  88. >17 ubyte &0x10 - right
  89. #>17 ubyte ^0x10 - left
  90. # some info say other bits 6-7 should be zero
  91. # but data storage interleave by http://www.fileformat.info/format/tga/corion.htm
  92. # 00 - no interleave;01 - even/odd interleave; 10 - four way interleave; 11 - reserved
  93. #>17 ubyte&0xC0 0x00 - no interleave
  94. >17 ubyte&0xC0 0x40 - interleave
  95. >17 ubyte&0xC0 0x80 - four way interleave
  96. >17 ubyte&0xC0 0xC0 - reserved
  97. # positive length implies identification field
  98. >0 ubyte >0
  99. >>18 string x "%s"
  100. # last 18 bytes of newer tga file footer signature
  101. >18 search/4261301/s TRUEVISION-XFILE.\0
  102. # extension area offset if not 0
  103. >>&-8 ulelong >0
  104. # length of the extension area. normal 495 for version 2.0
  105. >>>(&-4.l) uleshort 0x01EF
  106. # AuthorName[41]
  107. >>>>&0 string >\0 - author "%-.40s"
  108. # Comment[324]=4 * 80 null terminated
  109. >>>>&41 string >\0 - comment "%-.80s"
  110. # date
  111. >>>>&365 ubequad&0xffffFFFFffff0000 !0
  112. # Day
  113. >>>>>&-6 uleshort x %d
  114. # Month
  115. >>>>>&-8 uleshort x \b-%d
  116. # Year
  117. >>>>>&-4 uleshort x \b-%d
  118. # time
  119. >>>>&371 ubequad&0xffffFFFFffff0000 !0
  120. # hour
  121. >>>>>&-8 uleshort x %d
  122. # minutes
  123. >>>>>&-6 uleshort x \b:%.2d
  124. # second
  125. >>>>>&-4 uleshort x \b:%.2d
  126. # JobName[41]
  127. >>>>&377 string >\0 - job "%-.40s"
  128. # JobHour Jobminute Jobsecond
  129. >>>>&418 ubequad&0xffffFFFFffff0000 !0
  130. >>>>>&-8 uleshort x %d
  131. >>>>>&-6 uleshort x \b:%.2d
  132. >>>>>&-4 uleshort x \b:%.2d
  133. # SoftwareId[41]
  134. >>>>&424 string >\0 - %-.40s
  135. # SoftwareVersionNumber
  136. >>>>&424 ubyte >0
  137. >>>>>&40 uleshort/100 x %d
  138. >>>>>&40 uleshort%100 x \b.%d
  139. # VersionLetter
  140. >>>>>&42 ubyte >0x20 \b%c
  141. # KeyColor
  142. >>>>&468 ulelong >0 - keycolor 0x%8.8x
  143. # Denominator of Pixel ratio. 0~no pixel aspect
  144. >>>>&474 uleshort >0
  145. # Numerator
  146. >>>>>&-4 uleshort >0 - aspect %d
  147. >>>>>&-2 uleshort x \b/%d
  148. # Denominator of Gamma ratio. 0~no Gamma value
  149. >>>>&478 uleshort >0
  150. # Numerator
  151. >>>>>&-4 uleshort >0 - gamma %d
  152. >>>>>&-2 uleshort x \b/%d
  153. # ColorOffset
  154. #>>>>&480 ulelong x - col offset 0x%8.8x
  155. # StampOffset
  156. #>>>>&484 ulelong x - stamp offset 0x%8.8x
  157. # ScanOffset
  158. #>>>>&488 ulelong x - scan offset 0x%8.8x
  159. # AttributesType
  160. #>>>>&492 ubyte x - Attributes 0x%x
  161. ## EndOfTGA
  162. # PBMPLUS images
  163. # The next byte following the magic is always whitespace.
  164. # strength is changed to try these patterns before "x86 boot sector"
  165. 0 name netpbm
  166. >3 regex/s =[0-9]{1,50}\ [0-9]{1,50} Netpbm image data
  167. >>&0 regex =[0-9]{1,50} \b, size = %s x
  168. >>>&0 regex =[0-9]{1,50} \b %s
  169. 0 search/1 P1
  170. >0 use netpbm
  171. >>0 string x \b, bitmap
  172. !:strength + 45
  173. !:mime image/x-portable-bitmap
  174. 0 search/1 P2
  175. >0 use netpbm
  176. >>0 string x \b, greymap
  177. !:strength + 45
  178. !:mime image/x-portable-greymap
  179. 0 search/1 P3
  180. >0 use netpbm
  181. >>0 string x \b, pixmap
  182. !:strength + 45
  183. !:mime image/x-portable-pixmap
  184. 0 string P4
  185. >0 use netpbm
  186. >>0 string x \b, rawbits, bitmap
  187. !:strength + 45
  188. !:mime image/x-portable-bitmap
  189. 0 string P5
  190. >0 use netpbm
  191. >>0 string x \b, rawbits, greymap
  192. !:strength + 45
  193. !:mime image/x-portable-greymap
  194. 0 string P6
  195. >0 use netpbm
  196. >>0 string x \b, rawbits, pixmap
  197. !:strength + 45
  198. !:mime image/x-portable-pixmap
  199. 0 string P7 Netpbm PAM image file
  200. !:mime image/x-portable-pixmap
  201. # From: bryanh@giraffe-data.com (Bryan Henderson)
  202. 0 string \117\072 Solitaire Image Recorder format
  203. >4 string \013 MGI Type 11
  204. >4 string \021 MGI Type 17
  205. 0 string .MDA MicroDesign data
  206. >21 byte 48 version 2
  207. >21 byte 51 version 3
  208. 0 string .MDP MicroDesign page data
  209. >21 byte 48 version 2
  210. >21 byte 51 version 3
  211. # NIFF (Navy Interchange File Format, a modification of TIFF) images
  212. # [GRR: this *must* go before TIFF]
  213. 0 string IIN1 NIFF image data
  214. !:mime image/x-niff
  215. # Canon RAW version 1 (CRW) files are a type of Canon Image File Format
  216. # (CIFF) file. These are apparently all little-endian.
  217. # From: Adam Buchbinder <adam.buchbinder@gmail.com>
  218. # URL: http://www.sno.phy.queensu.ca/~phil/exiftool/canon_raw.html
  219. 0 string II\x1a\0\0\0HEAPCCDR Canon CIFF raw image data
  220. !:mime image/x-canon-crw
  221. >16 leshort x \b, version %d.
  222. >14 leshort x \b%d
  223. # Canon RAW version 2 (CR2) files are a kind of TIFF with an extra magic
  224. # number. Put this above the TIFF test to make sure we detect them.
  225. # These are apparently all little-endian.
  226. # From: Adam Buchbinder <adam.buchbinder@gmail.com>
  227. # URL: http://libopenraw.freedesktop.org/wiki/Canon_CR2
  228. 0 string II\x2a\0\x10\0\0\0CR Canon CR2 raw image data
  229. !:mime image/x-canon-cr2
  230. >10 byte x \b, version %d.
  231. >11 byte x \b%d
  232. # Tag Image File Format, from Daniel Quinlan (quinlan@yggdrasil.com)
  233. # The second word of TIFF files is the TIFF version number, 42, which has
  234. # never changed. The TIFF specification recommends testing for it.
  235. 0 string MM\x00\x2a TIFF image data, big-endian
  236. !:mime image/tiff
  237. >(4.L) use \^tiff_ifd
  238. 0 string II\x2a\x00 TIFF image data, little-endian
  239. !:mime image/tiff
  240. >(4.l) use tiff_ifd
  241. 0 name tiff_ifd
  242. >0 leshort x \b, direntries=%d
  243. >2 use tiff_entry
  244. 0 name tiff_entry
  245. # NewSubFileType
  246. >0 leshort 0xfe
  247. >>12 use tiff_entry
  248. >0 leshort 0x100
  249. >>4 lelong 1
  250. >>>12 use tiff_entry
  251. >>>8 leshort x \b, width=%d
  252. >0 leshort 0x101
  253. >>4 lelong 1
  254. >>>8 leshort x \b, height=%d
  255. >>>12 use tiff_entry
  256. >0 leshort 0x102
  257. >>8 leshort x \b, bps=%d
  258. >>12 use tiff_entry
  259. >0 leshort 0x103
  260. >>4 lelong 1 \b, compression=
  261. >>>8 leshort 1 \bnone
  262. >>>8 leshort 2 \bhuffman
  263. >>>8 leshort 3 \bbi-level group 3
  264. >>>8 leshort 4 \bbi-level group 4
  265. >>>8 leshort 5 \bLZW
  266. >>>8 leshort 6 \bJPEG (old)
  267. >>>8 leshort 7 \bJPEG
  268. >>>8 leshort 8 \bdeflate
  269. >>>8 leshort 9 \bJBIG, ITU-T T.85
  270. >>>8 leshort 0xa \bJBIG, ITU-T T.43
  271. >>>8 leshort 0x7ffe \bNeXT RLE 2-bit
  272. >>>8 leshort 0x8005 \bPackBits (Macintosh RLE)
  273. >>>8 leshort 0x8029 \bThunderscan RLE
  274. >>>8 leshort 0x807f \bRasterPadding (CT or MP)
  275. >>>8 leshort 0x8080 \bRLE (Line Work)
  276. >>>8 leshort 0x8081 \bRLE (High-Res Cont-Tone)
  277. >>>8 leshort 0x8082 \bRLE (Binary Line Work)
  278. >>>8 leshort 0x80b2 \bDeflate (PKZIP)
  279. >>>8 leshort 0x80b3 \bKodak DCS
  280. >>>8 leshort 0x8765 \bJBIG
  281. >>>8 leshort 0x8798 \bJPEG2000
  282. >>>8 leshort 0x8799 \bNikon NEF Compressed
  283. >>>8 default x
  284. >>>>8 leshort x \b(unknown 0x%x)
  285. >>>12 use tiff_entry
  286. >0 leshort 0x106 \b, PhotometricIntepretation=
  287. >>8 clear x
  288. >>8 leshort 0 \bWhiteIsZero
  289. >>8 leshort 1 \bBlackIsZero
  290. >>8 leshort 2 \bRGB
  291. >>8 leshort 3 \bRGB Palette
  292. >>8 leshort 4 \bTransparency Mask
  293. >>8 leshort 5 \bCMYK
  294. >>8 leshort 6 \bYCbCr
  295. >>8 leshort 8 \bCIELab
  296. >>8 default x
  297. >>>8 leshort x \b(unknown=0x%x)
  298. >>12 use tiff_entry
  299. # FillOrder
  300. >0 leshort 0x10a
  301. >>4 lelong 1
  302. >>>12 use tiff_entry
  303. # DocumentName
  304. >0 leshort 0x10d
  305. >>(8.l) string x \b, name=%s
  306. >>>12 use tiff_entry
  307. # ImageDescription
  308. >0 leshort 0x10e
  309. >>(8.l) string x \b, description=%s
  310. >>>12 use tiff_entry
  311. # Make
  312. >0 leshort 0x10f
  313. >>(8.l) string x \b, manufacturer=%s
  314. >>>12 use tiff_entry
  315. # Model
  316. >0 leshort 0x110
  317. >>(8.l) string x \b, model=%s
  318. >>>12 use tiff_entry
  319. # StripOffsets
  320. >0 leshort 0x111
  321. >>12 use tiff_entry
  322. # Orientation
  323. >0 leshort 0x112 \b, orientation=
  324. >>8 leshort 1 \bupper-left
  325. >>8 leshort 3 \blower-right
  326. >>8 leshort 6 \bupper-right
  327. >>8 leshort 8 \blower-left
  328. >>8 leshort 9 \bundefined
  329. >>8 default x
  330. >>>8 leshort x \b[*%d*]
  331. >>12 use tiff_entry
  332. # XResolution
  333. >0 leshort 0x11a
  334. >>8 lelong x \b, xresolution=%d
  335. >>12 use tiff_entry
  336. # YResolution
  337. >0 leshort 0x11b
  338. >>8 lelong x \b, yresolution=%d
  339. >>12 use tiff_entry
  340. # ResolutionUnit
  341. >0 leshort 0x128
  342. >>8 leshort x \b, resolutionunit=%d
  343. >>12 use tiff_entry
  344. # Software
  345. >0 leshort 0x131
  346. >>(8.l) string x \b, software=%s
  347. >>12 use tiff_entry
  348. # Datetime
  349. >0 leshort 0x132
  350. >>(8.l) string x \b, datetime=%s
  351. >>12 use tiff_entry
  352. # HostComputer
  353. >0 leshort 0x13c
  354. >>(8.l) string x \b, hostcomputer=%s
  355. >>12 use tiff_entry
  356. # WhitePoint
  357. >0 leshort 0x13e
  358. >>12 use tiff_entry
  359. # PrimaryChromaticities
  360. >0 leshort 0x13f
  361. >>12 use tiff_entry
  362. # YCbCrCoefficients
  363. >0 leshort 0x211
  364. >>12 use tiff_entry
  365. # YCbCrPositioning
  366. >0 leshort 0x213
  367. >>12 use tiff_entry
  368. # ReferenceBlackWhite
  369. >0 leshort 0x214
  370. >>12 use tiff_entry
  371. # Copyright
  372. >0 leshort 0x8298
  373. >>(8.l) string x \b, copyright=%s
  374. >>12 use tiff_entry
  375. # ExifOffset
  376. >0 leshort 0x8769
  377. >>12 use tiff_entry
  378. # GPS IFD
  379. >0 leshort 0x8825 \b, GPS-Data
  380. >>12 use tiff_entry
  381. #>0 leshort x \b, unknown=0x%x
  382. #>>12 use tiff_entry
  383. 0 string MM\x00\x2b Big TIFF image data, big-endian
  384. !:mime image/tiff
  385. 0 string II\x2b\x00 Big TIFF image data, little-endian
  386. !:mime image/tiff
  387. # PNG [Portable Network Graphics, or "PNG's Not GIF"] images
  388. # (Greg Roelofs, newt@uchicago.edu)
  389. # (Albert Cahalan, acahalan@cs.uml.edu)
  390. #
  391. # 137 P N G \r \n ^Z \n [4-byte length] H E A D [HEAD data] [HEAD crc] ...
  392. #
  393. 0 string \x89PNG\x0d\x0a\x1a\x0a PNG image data
  394. !:mime image/png
  395. >16 belong x \b, %d x
  396. >20 belong x %d,
  397. >24 byte x %d-bit
  398. >25 byte 0 grayscale,
  399. >25 byte 2 \b/color RGB,
  400. >25 byte 3 colormap,
  401. >25 byte 4 gray+alpha,
  402. >25 byte 6 \b/color RGBA,
  403. #>26 byte 0 deflate/32K,
  404. >28 byte 0 non-interlaced
  405. >28 byte 1 interlaced
  406. # possible GIF replacements; none yet released!
  407. # (Greg Roelofs, newt@uchicago.edu)
  408. #
  409. # GRR 950115: this was mine ("Zip GIF"):
  410. 0 string GIF94z ZIF image (GIF+deflate alpha)
  411. !:mime image/x-unknown
  412. #
  413. # GRR 950115: this is Jeremy Wohl's Free Graphics Format (better):
  414. #
  415. 0 string FGF95a FGF image (GIF+deflate beta)
  416. !:mime image/x-unknown
  417. #
  418. # GRR 950115: this is Thomas Boutell's Portable Bitmap Format proposal
  419. # (best; not yet implemented):
  420. #
  421. 0 string PBF PBF image (deflate compression)
  422. !:mime image/x-unknown
  423. # GIF
  424. 0 string GIF8 GIF image data
  425. !:mime image/gif
  426. !:apple 8BIMGIFf
  427. >4 string 7a \b, version 8%s,
  428. >4 string 9a \b, version 8%s,
  429. >6 leshort >0 %d x
  430. >8 leshort >0 %d
  431. #>10 byte &0x80 color mapped,
  432. #>10 byte&0x07 =0x00 2 colors
  433. #>10 byte&0x07 =0x01 4 colors
  434. #>10 byte&0x07 =0x02 8 colors
  435. #>10 byte&0x07 =0x03 16 colors
  436. #>10 byte&0x07 =0x04 32 colors
  437. #>10 byte&0x07 =0x05 64 colors
  438. #>10 byte&0x07 =0x06 128 colors
  439. #>10 byte&0x07 =0x07 256 colors
  440. # ITC (CMU WM) raster files. It is essentially a byte-reversed Sun raster,
  441. # 1 plane, no encoding.
  442. 0 string \361\0\100\273 CMU window manager raster image data
  443. >4 lelong >0 %d x
  444. >8 lelong >0 %d,
  445. >12 lelong >0 %d-bit
  446. # Magick Image File Format
  447. 0 string id=ImageMagick MIFF image data
  448. # Artisan
  449. 0 long 1123028772 Artisan image data
  450. >4 long 1 \b, rectangular 24-bit
  451. >4 long 2 \b, rectangular 8-bit with colormap
  452. >4 long 3 \b, rectangular 32-bit (24-bit with matte)
  453. # FIG (Facility for Interactive Generation of figures), an object-based format
  454. 0 search/1 #FIG FIG image text
  455. >5 string x \b, version %.3s
  456. # PHIGS
  457. 0 string ARF_BEGARF PHIGS clear text archive
  458. 0 string @(#)SunPHIGS SunPHIGS
  459. # version number follows, in the form m.n
  460. >40 string SunBin binary
  461. >32 string archive archive
  462. # GKS (Graphics Kernel System)
  463. 0 string GKSM GKS Metafile
  464. >24 string SunGKS \b, SunGKS
  465. # CGM image files
  466. 0 string BEGMF clear text Computer Graphics Metafile
  467. # MGR bitmaps (Michael Haardt, u31b3hs@pool.informatik.rwth-aachen.de)
  468. 0 string yz MGR bitmap, modern format, 8-bit aligned
  469. 0 string zz MGR bitmap, old format, 1-bit deep, 16-bit aligned
  470. 0 string xz MGR bitmap, old format, 1-bit deep, 32-bit aligned
  471. 0 string yx MGR bitmap, modern format, squeezed
  472. # Fuzzy Bitmap (FBM) images
  473. 0 string %bitmap\0 FBM image data
  474. >30 long 0x31 \b, mono
  475. >30 long 0x33 \b, color
  476. # facsimile data
  477. 1 string PC\ Research,\ Inc group 3 fax data
  478. >29 byte 0 \b, normal resolution (204x98 DPI)
  479. >29 byte 1 \b, fine resolution (204x196 DPI)
  480. # From: Herbert Rosmanith <herp@wildsau.idv.uni.linz.at>
  481. 0 string Sfff structured fax file
  482. # From: Joerg Jenderek <joerg.jen.der.ek@gmx.net>
  483. # most files with the extension .EPA and some with .BMP
  484. 0 string \x11\x06 Award BIOS Logo, 136 x 84
  485. !:mime image/x-award-bioslogo
  486. 0 string \x11\x09 Award BIOS Logo, 136 x 126
  487. !:mime image/x-award-bioslogo
  488. #0 string \x07\x1f BIOS Logo corrupted?
  489. # http://www.blackfiveservices.co.uk/awbmtools.shtml
  490. # http://biosgfx.narod.ru/v3/
  491. # http://biosgfx.narod.ru/abr-2/
  492. 0 string AWBM
  493. >4 leshort <1981 Award BIOS bitmap
  494. !:mime image/x-award-bmp
  495. # image width is a multiple of 4
  496. >>4 leshort&0x0003 0
  497. >>>4 leshort x \b, %d
  498. >>>6 leshort x x %d
  499. >>4 leshort&0x0003 >0 \b,
  500. >>>4 leshort&0x0003 =1
  501. >>>>4 leshort x %d+3
  502. >>>4 leshort&0x0003 =2
  503. >>>>4 leshort x %d+2
  504. >>>4 leshort&0x0003 =3
  505. >>>>4 leshort x %d+1
  506. >>>6 leshort x x %d
  507. # at offset 8 starts imagedata followed by "RGB " marker
  508. # PC bitmaps (OS/2, Windows BMP files) (Greg Roelofs, newt@uchicago.edu)
  509. # http://en.wikipedia.org/wiki/BMP_file_format#DIB_header_.\
  510. # 28bitmap_information_header.29
  511. 0 string BM
  512. >14 leshort 12 PC bitmap, OS/2 1.x format
  513. !:mime image/x-ms-bmp
  514. >>18 leshort x \b, %d x
  515. >>20 leshort x %d
  516. >14 leshort 64 PC bitmap, OS/2 2.x format
  517. !:mime image/x-ms-bmp
  518. >>18 leshort x \b, %d x
  519. >>20 leshort x %d
  520. >14 leshort 40 PC bitmap, Windows 3.x format
  521. !:mime image/x-ms-bmp
  522. >>18 lelong x \b, %d x
  523. >>22 lelong x %d x
  524. >>28 leshort x %d
  525. >14 leshort 124 PC bitmap, Windows 98/2000 and newer format
  526. !:mime image/x-ms-bmp
  527. >>18 lelong x \b, %d x
  528. >>22 lelong x %d x
  529. >>28 leshort x %d
  530. >14 leshort 108 PC bitmap, Windows 95/NT4 and newer format
  531. !:mime image/x-ms-bmp
  532. >>18 lelong x \b, %d x
  533. >>22 lelong x %d x
  534. >>28 leshort x %d
  535. >14 leshort 128 PC bitmap, Windows NT/2000 format
  536. !:mime image/x-ms-bmp
  537. >>18 lelong x \b, %d x
  538. >>22 lelong x %d x
  539. >>28 leshort x %d
  540. # Too simple - MPi
  541. #0 string IC PC icon data
  542. #0 string PI PC pointer image data
  543. #0 string CI PC color icon data
  544. #0 string CP PC color pointer image data
  545. # Conflicts with other entries [BABYL]
  546. #0 string BA PC bitmap array data
  547. # XPM icons (Greg Roelofs, newt@uchicago.edu)
  548. 0 search/1 /*\ XPM\ */ X pixmap image text
  549. !:mime image/x-xpmi
  550. # Utah Raster Toolkit RLE images (janl@ifi.uio.no)
  551. 0 leshort 0xcc52 RLE image data,
  552. >6 leshort x %d x
  553. >8 leshort x %d
  554. >2 leshort >0 \b, lower left corner: %d
  555. >4 leshort >0 \b, lower right corner: %d
  556. >10 byte&0x1 =0x1 \b, clear first
  557. >10 byte&0x2 =0x2 \b, no background
  558. >10 byte&0x4 =0x4 \b, alpha channel
  559. >10 byte&0x8 =0x8 \b, comment
  560. >11 byte >0 \b, %d color channels
  561. >12 byte >0 \b, %d bits per pixel
  562. >13 byte >0 \b, %d color map channels
  563. # image file format (Robert Potter, potter@cs.rochester.edu)
  564. 0 string Imagefile\ version- iff image data
  565. # this adds the whole header (inc. version number), informative but longish
  566. >10 string >\0 %s
  567. # Sun raster images, from Daniel Quinlan (quinlan@yggdrasil.com)
  568. 0 belong 0x59a66a95 Sun raster image data
  569. >4 belong >0 \b, %d x
  570. >8 belong >0 %d,
  571. >12 belong >0 %d-bit,
  572. #>16 belong >0 %d bytes long,
  573. >20 belong 0 old format,
  574. #>20 belong 1 standard,
  575. >20 belong 2 compressed,
  576. >20 belong 3 RGB,
  577. >20 belong 4 TIFF,
  578. >20 belong 5 IFF,
  579. >20 belong 0xffff reserved for testing,
  580. >24 belong 0 no colormap
  581. >24 belong 1 RGB colormap
  582. >24 belong 2 raw colormap
  583. #>28 belong >0 colormap is %d bytes long
  584. # SGI image file format, from Daniel Quinlan (quinlan@yggdrasil.com)
  585. #
  586. # See
  587. # http://reality.sgi.com/grafica/sgiimage.html
  588. #
  589. 0 beshort 474 SGI image data
  590. #>2 byte 0 \b, verbatim
  591. >2 byte 1 \b, RLE
  592. #>3 byte 1 \b, normal precision
  593. >3 byte 2 \b, high precision
  594. >4 beshort x \b, %d-D
  595. >6 beshort x \b, %d x
  596. >8 beshort x %d
  597. >10 beshort x \b, %d channel
  598. >10 beshort !1 \bs
  599. >80 string >0 \b, "%s"
  600. 0 string IT01 FIT image data
  601. >4 belong x \b, %d x
  602. >8 belong x %d x
  603. >12 belong x %d
  604. #
  605. 0 string IT02 FIT image data
  606. >4 belong x \b, %d x
  607. >8 belong x %d x
  608. >12 belong x %d
  609. #
  610. 2048 string PCD_IPI Kodak Photo CD image pack file
  611. >0xe02 byte&0x03 0x00 , landscape mode
  612. >0xe02 byte&0x03 0x01 , portrait mode
  613. >0xe02 byte&0x03 0x02 , landscape mode
  614. >0xe02 byte&0x03 0x03 , portrait mode
  615. 0 string PCD_OPA Kodak Photo CD overview pack file
  616. # FITS format. Jeff Uphoff <juphoff@tarsier.cv.nrao.edu>
  617. # FITS is the Flexible Image Transport System, the de facto standard for
  618. # data and image transfer, storage, etc., for the astronomical community.
  619. # (FITS floating point formats are big-endian.)
  620. 0 string SIMPLE\ \ = FITS image data
  621. >109 string 8 \b, 8-bit, character or unsigned binary integer
  622. >108 string 16 \b, 16-bit, two's complement binary integer
  623. >107 string \ 32 \b, 32-bit, two's complement binary integer
  624. >107 string -32 \b, 32-bit, floating point, single precision
  625. >107 string -64 \b, 64-bit, floating point, double precision
  626. # other images
  627. 0 string This\ is\ a\ BitMap\ file Lisp Machine bit-array-file
  628. # From SunOS 5.5.1 "/etc/magic" - appeared right before Sun raster image
  629. # stuff.
  630. #
  631. 0 beshort 0x1010 PEX Binary Archive
  632. # DICOM medical imaging data
  633. # URL: https://en.wikipedia.org/wiki/DICOM#Data_format
  634. # Note: "dcm" is the official file name extension
  635. # XnView mention also "dc3" and "acr" as file name extension
  636. 128 string DICM DICOM medical imaging data
  637. !:mime application/dicom
  638. !:ext dcm/dicom/dic
  639. # XWD - X Window Dump file.
  640. # As described in /usr/X11R6/include/X11/XWDFile.h
  641. # used by the xwd program.
  642. # Bradford Castalia, idaeim, 1/01
  643. # updated by Adam Buchbinder, 2/09
  644. # The following assumes version 7 of the format; the first long is the length
  645. # of the header, which is at least 25 4-byte longs, and the one at offset 8
  646. # is a constant which is always either 1 or 2. Offset 12 is the pixmap depth,
  647. # which is a maximum of 32.
  648. 0 belong >100
  649. >8 belong <3
  650. >>12 belong <33
  651. >>>4 belong 7 XWD X Window Dump image data
  652. !:mime image/x-xwindowdump
  653. >>>>100 string >\0 \b, "%s"
  654. >>>>16 belong x \b, %dx
  655. >>>>20 belong x \b%dx
  656. >>>>12 belong x \b%d
  657. # PDS - Planetary Data System
  658. # These files use Parameter Value Language in the header section.
  659. # Unfortunately, there is no certain magic, but the following
  660. # strings have been found to be most likely.
  661. 0 string NJPL1I00 PDS (JPL) image data
  662. 2 string NJPL1I PDS (JPL) image data
  663. 0 string CCSD3ZF PDS (CCSD) image data
  664. 2 string CCSD3Z PDS (CCSD) image data
  665. 0 string PDS_ PDS image data
  666. 0 string LBLSIZE= PDS (VICAR) image data
  667. # pM8x: ATARI STAD compressed bitmap format
  668. #
  669. # from Oskar Schirmer <schirmer@scara.com> Feb 2, 2001
  670. # p M 8 5/6 xx yy zz data...
  671. # Atari ST STAD bitmap is always 640x400, bytewise runlength compressed.
  672. # bytes either run horizontally (pM85) or vertically (pM86). yy is the
  673. # most frequent byte, xx and zz are runlength escape codes, where xx is
  674. # used for runs of yy.
  675. #
  676. 0 string pM85 Atari ST STAD bitmap image data (hor)
  677. >5 byte 0x00 (white background)
  678. >5 byte 0xFF (black background)
  679. 0 string pM86 Atari ST STAD bitmap image data (vert)
  680. >5 byte 0x00 (white background)
  681. >5 byte 0xFF (black background)
  682. # Gurkan Sengun <gurkan@linuks.mine.nu>, www.linuks.mine.nu
  683. # http://www.atarimax.com/jindroush.atari.org/afmtatr.html
  684. 0 leshort 0x0296 Atari ATR image
  685. # XXX:
  686. # This is bad magic 0x5249 == 'RI' conflicts with RIFF and other
  687. # magic.
  688. # SGI RICE image file <mpruett@sgi.com>
  689. #0 beshort 0x5249 RICE image
  690. #>2 beshort x v%d
  691. #>4 beshort x (%d x
  692. #>6 beshort x %d)
  693. #>8 beshort 0 8 bit
  694. #>8 beshort 1 10 bit
  695. #>8 beshort 2 12 bit
  696. #>8 beshort 3 13 bit
  697. #>10 beshort 0 4:2:2
  698. #>10 beshort 1 4:2:2:4
  699. #>10 beshort 2 4:4:4
  700. #>10 beshort 3 4:4:4:4
  701. #>12 beshort 1 RGB
  702. #>12 beshort 2 CCIR601
  703. #>12 beshort 3 RP175
  704. #>12 beshort 4 YUV
  705. # PCX image files
  706. # From: Dan Fandrich <dan@coneharvesters.com>
  707. # updated by Joerg Jenderek at Feb 2013 by http://de.wikipedia.org/wiki/PCX
  708. # http://web.archive.org/web/20100206055706/http://www.qzx.com/pc-gpe/pcx.txt
  709. # GRR: original test was still too general as it catches xbase examples T5.DBT,T6.DBT with 0xa000000
  710. # 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
  711. 0 ubelong&0xffF8fe00 0x0a000000
  712. # for PCX bit depth > 0
  713. >3 ubyte >0
  714. # test for valid versions
  715. >>1 ubyte <6
  716. >>>1 ubyte !1 PCX
  717. !:mime image/x-pcx
  718. #!:mime image/pcx
  719. >>>>1 ubyte 0 ver. 2.5 image data
  720. >>>>1 ubyte 2 ver. 2.8 image data, with palette
  721. >>>>1 ubyte 3 ver. 2.8 image data, without palette
  722. >>>>1 ubyte 4 for Windows image data
  723. >>>>1 ubyte 5 ver. 3.0 image data
  724. >>>>4 uleshort x bounding box [%d,
  725. >>>>6 uleshort x %d] -
  726. >>>>8 uleshort x [%d,
  727. >>>>10 uleshort x %d],
  728. >>>>65 ubyte >1 %d planes each of
  729. >>>>3 ubyte x %d-bit
  730. >>>>68 byte 1 colour,
  731. >>>>68 byte 2 grayscale,
  732. # this should not happen
  733. >>>>68 default x image,
  734. >>>>12 leshort >0 %d x
  735. >>>>>14 uleshort x %d dpi,
  736. >>>>2 byte 0 uncompressed
  737. >>>>2 byte 1 RLE compressed
  738. # Adobe Photoshop
  739. # From: Asbjoern Sloth Toennesen <asbjorn@lila.io>
  740. 0 string 8BPS Adobe Photoshop Image
  741. !:mime image/vnd.adobe.photoshop
  742. >4 beshort 2 (PSB)
  743. >18 belong x \b, %d x
  744. >14 belong x %d,
  745. >24 beshort 0 bitmap
  746. >24 beshort 1 grayscale
  747. >>12 beshort 2 with alpha
  748. >24 beshort 2 indexed
  749. >24 beshort 3 RGB
  750. >>12 beshort 4 \bA
  751. >24 beshort 4 CMYK
  752. >>12 beshort 5 \bA
  753. >24 beshort 7 multichannel
  754. >24 beshort 8 duotone
  755. >24 beshort 9 lab
  756. >12 beshort > 1
  757. >>12 beshort x \b, %dx
  758. >12 beshort 1 \b,
  759. >22 beshort x %d-bit channel
  760. >12 beshort > 1 \bs
  761. # XV thumbnail indicator (ThMO)
  762. 0 string P7\ 332 XV thumbnail image data
  763. # NITF is defined by United States MIL-STD-2500A
  764. 0 string NITF National Imagery Transmission Format
  765. >25 string >\0 dated %.14s
  766. # GEM Image: Version 1, Headerlen 8 (Wolfram Kleff)
  767. # Format variations from: Bernd Nuernberger <bernd.nuernberger@web.de>
  768. # Update: Joerg Jenderek
  769. # See http://fileformats.archiveteam.org/wiki/GEM_Raster
  770. # For variations, also see:
  771. # http://www.seasip.info/Gem/ff_img.html (Ventura)
  772. # http://www.atari-wiki.com/?title=IMG_file (XIMG, STTT)
  773. # http://www.fileformat.info/format/gemraster/spec/index.htm (XIMG, STTT)
  774. # http://sylvana.net/1stguide/1STGUIDE.ENG (TIMG)
  775. 0 beshort 0x0001
  776. # header_size
  777. >2 beshort 0x0008
  778. >>0 use gem_info
  779. >2 beshort 0x0009
  780. >>0 use gem_info
  781. # no example for NOSIG
  782. >2 beshort 24
  783. >>0 use gem_info
  784. # no example for HYPERPAINT
  785. >2 beshort 25
  786. >>0 use gem_info
  787. 16 string XIMG\0
  788. >0 use gem_info
  789. # no example
  790. 16 string STTT\0\x10
  791. >0 use gem_info
  792. # no example or description
  793. 16 string TIMG\0
  794. >0 use gem_info
  795. 0 name gem_info
  796. # version is 2 for some XIMG and 1 for all others
  797. >0 beshort <0x0003 GEM
  798. # http://www.snowstone.org.uk/riscos/mimeman/mimemap.txt
  799. !:mime image/x-gem
  800. # header_size 24 25 27 59 779 words for colored bitmaps
  801. >>2 beshort >9
  802. >>>16 string STTT\0\x10 STTT
  803. >>>16 string TIMG\0 TIMG
  804. # HYPERPAINT or NOSIG variant
  805. >>>16 string \0\x80
  806. >>>>2 beshort =24 NOSIG
  807. >>>>2 beshort !24 HYPERPAINT
  808. # NOSIG or XIMG variant
  809. >>>16 default x
  810. >>>>16 string !XIMG\0 NOSIG
  811. >>16 string =XIMG\0 XIMG Image data
  812. !:ext img/ximg
  813. # to avoid Warning: Current entry does not yet have a description for adding a EXTENSION type
  814. >>16 string !XIMG\0 Image data
  815. !:ext img
  816. # header_size is 9 for Ventura files and 8 for other GEM Paint files
  817. >>2 beshort 9 (Ventura)
  818. #>>2 beshort 8 (Paint)
  819. >>12 beshort x %d x
  820. >>14 beshort x %d,
  821. # 1 4 8
  822. >>4 beshort x %d planes,
  823. # in tenths of a millimetre
  824. >>8 beshort x %d x
  825. >>10 beshort x %d pixelsize
  826. # pattern_size 1-8. 2 for GEM Paint
  827. >>6 beshort !2 \b, pattern size %d
  828. # GEM Metafile (Wolfram Kleff)
  829. 0 lelong 0x0018FFFF GEM Metafile data
  830. >4 leshort x version %d
  831. #
  832. # SMJPEG. A custom Motion JPEG format used by Loki Entertainment
  833. # Software Torbjorn Andersson <d91tan@Update.UU.SE>.
  834. #
  835. 0 string \0\nSMJPEG SMJPEG
  836. >8 belong x %d.x data
  837. # According to the specification you could find any number of _TXT
  838. # headers here, but I can't think of any way of handling that. None of
  839. # the SMJPEG files I tried it on used this feature. Even if such a
  840. # file is encountered the output should still be reasonable.
  841. >16 string _SND \b,
  842. >>24 beshort >0 %d Hz
  843. >>26 byte 8 8-bit
  844. >>26 byte 16 16-bit
  845. >>28 string NONE uncompressed
  846. # >>28 string APCM ADPCM compressed
  847. >>27 byte 1 mono
  848. >>28 byte 2 stereo
  849. # Help! Isn't there any way to avoid writing this part twice?
  850. >>32 string _VID \b,
  851. # >>>48 string JFIF JPEG
  852. >>>40 belong >0 %d frames
  853. >>>44 beshort >0 (%d x
  854. >>>46 beshort >0 %d)
  855. >16 string _VID \b,
  856. # >>32 string JFIF JPEG
  857. >>24 belong >0 %d frames
  858. >>28 beshort >0 (%d x
  859. >>30 beshort >0 %d)
  860. 0 string Paint\ Shop\ Pro\ Image\ File Paint Shop Pro Image File
  861. # "thumbnail file" (icon)
  862. # descended from "xv", but in use by other applications as well (Wolfram Kleff)
  863. 0 string P7\ 332 XV "thumbnail file" (icon) data
  864. # taken from fkiss: (<yav@mte.biglobe.ne.jp> ?)
  865. 0 string KiSS KISS/GS
  866. >4 byte 16 color
  867. >>5 byte x %d bit
  868. >>8 leshort x %d colors
  869. >>10 leshort x %d groups
  870. >4 byte 32 cell
  871. >>5 byte x %d bit
  872. >>8 leshort x %d x
  873. >>10 leshort x %d
  874. >>12 leshort x +%d
  875. >>14 leshort x +%d
  876. # Webshots (www.webshots.com), by John Harrison
  877. 0 string C\253\221g\230\0\0\0 Webshots Desktop .wbz file
  878. # Hercules DASD image files
  879. # From Jan Jaeger <jj@septa.nl>
  880. 0 string CKD_P370 Hercules CKD DASD image file
  881. >8 long x \b, %d heads per cylinder
  882. >12 long x \b, track size %d bytes
  883. >16 byte x \b, device type 33%2.2X
  884. 0 string CKD_C370 Hercules compressed CKD DASD image file
  885. >8 long x \b, %d heads per cylinder
  886. >12 long x \b, track size %d bytes
  887. >16 byte x \b, device type 33%2.2X
  888. 0 string CKD_S370 Hercules CKD DASD shadow file
  889. >8 long x \b, %d heads per cylinder
  890. >12 long x \b, track size %d bytes
  891. >16 byte x \b, device type 33%2.2X
  892. # Squeak images and programs - etoffi@softhome.net
  893. 0 string \146\031\0\0 Squeak image data
  894. 0 search/1 'From\040Squeak Squeak program text
  895. # partimage: file(1) magic for PartImage files (experimental, incomplete)
  896. # Author: Hans-Joachim Baader <hjb@pro-linux.de>
  897. 0 string PaRtImAgE-VoLuMe PartImage
  898. >0x0020 string 0.6.1 file version %s
  899. >>0x0060 lelong >-1 volume %d
  900. #>>0x0064 8 byte identifier
  901. #>>0x007c reserved
  902. >>0x0200 string >\0 type %s
  903. >>0x1400 string >\0 device %s,
  904. >>0x1600 string >\0 original filename %s,
  905. # Some fields omitted
  906. >>0x2744 lelong 0 not compressed
  907. >>0x2744 lelong 1 gzip compressed
  908. >>0x2744 lelong 2 bzip2 compressed
  909. >>0x2744 lelong >2 compressed with unknown algorithm
  910. >0x0020 string >0.6.1 file version %s
  911. >0x0020 string <0.6.1 file version %s
  912. # DCX is multi-page PCX, using a simple header of up to 1024
  913. # offsets for the respective PCX components.
  914. # From: Joerg Wunsch <joerg_wunsch@uriah.heep.sax.de>
  915. 0 lelong 987654321 DCX multi-page PCX image data
  916. # Simon Walton <simonw@matteworld.com>
  917. # Kodak Cineon format for scanned negatives
  918. # http://www.kodak.com/US/en/motion/support/dlad/
  919. 0 lelong 0xd75f2a80 Cineon image data
  920. >200 belong >0 \b, %d x
  921. >204 belong >0 %d
  922. # Bio-Rad .PIC is an image format used by microscope control systems
  923. # and related image processing software used by biologists.
  924. # From: Vebjorn Ljosa <vebjorn@ljosa.com>
  925. # BOOL values are two-byte integers; use them to rule out false positives.
  926. # http://web.archive.org/web/20050317223257/www.cs.ubc.ca/spider/ladic/text/biorad.txt
  927. # Samples: http://www.loci.wisc.edu/software/sample-data
  928. 14 leshort <2
  929. >62 leshort <2
  930. >>54 leshort 12345 Bio-Rad .PIC Image File
  931. >>>0 leshort >0 %d x
  932. >>>2 leshort >0 %d,
  933. >>>4 leshort =1 1 image in file
  934. >>>4 leshort >1 %d images in file
  935. # From Jan "Yenya" Kasprzak <kas@fi.muni.cz>
  936. # The description of *.mrw format can be found at
  937. # http://www.dalibor.cz/minolta/raw_file_format.htm
  938. 0 string \000MRM Minolta Dimage camera raw image data
  939. # Summary: DjVu image / document
  940. # Extension: .djvu
  941. # Reference: http://djvu.org/docs/DjVu3Spec.djvu
  942. # Submitted by: Stephane Loeuillet <stephane.loeuillet@tiscali.fr>
  943. # Modified by (1): Abel Cheung <abelcheung@gmail.com>
  944. 0 string AT&TFORM
  945. >12 string DJVM DjVu multiple page document
  946. !:mime image/vnd.djvu
  947. >12 string DJVU DjVu image or single page document
  948. !:mime image/vnd.djvu
  949. >12 string DJVI DjVu shared document
  950. !:mime image/vnd.djvu
  951. >12 string THUM DjVu page thumbnails
  952. !:mime image/vnd.djvu
  953. # Originally by Marc Espie
  954. # Modified by Robert Minsk <robertminsk at yahoo.com>
  955. # http://www.openexr.com/openexrfilelayout.pdf
  956. 0 lelong 20000630 OpenEXR image data,
  957. !:mime image/x-exr
  958. >4 lelong&0x000000ff x version %d,
  959. >4 lelong ^0x00000200 storage: scanline
  960. >4 lelong &0x00000200 storage: tiled
  961. >8 search/0x1000 compression\0 \b, compression:
  962. >>&16 byte 0 none
  963. >>&16 byte 1 rle
  964. >>&16 byte 2 zips
  965. >>&16 byte 3 zip
  966. >>&16 byte 4 piz
  967. >>&16 byte 5 pxr24
  968. >>&16 byte 6 b44
  969. >>&16 byte 7 b44a
  970. >>&16 byte >7 unknown
  971. >8 search/0x1000 dataWindow\0 \b, dataWindow:
  972. >>&10 lelong x (%d
  973. >>&14 lelong x %d)-
  974. >>&18 lelong x \b(%d
  975. >>&22 lelong x %d)
  976. >8 search/0x1000 displayWindow\0 \b, displayWindow:
  977. >>&10 lelong x (%d
  978. >>&14 lelong x %d)-
  979. >>&18 lelong x \b(%d
  980. >>&22 lelong x %d)
  981. >8 search/0x1000 lineOrder\0 \b, lineOrder:
  982. >>&14 byte 0 increasing y
  983. >>&14 byte 1 decreasing y
  984. >>&14 byte 2 random y
  985. >>&14 byte >2 unknown
  986. # SMPTE Digital Picture Exchange Format, SMPTE DPX
  987. #
  988. # ANSI/SMPTE 268M-1994, SMPTE Standard for File Format for Digital
  989. # Moving-Picture Exchange (DPX), v1.0, 18 February 1994
  990. # Robert Minsk <robertminsk at yahoo.com>
  991. 0 string SDPX DPX image data, big-endian,
  992. !:mime image/x-dpx
  993. >768 beshort <4
  994. >>772 belong x %dx
  995. >>776 belong x \b%d,
  996. >768 beshort >3
  997. >>776 belong x %dx
  998. >>772 belong x \b%d,
  999. >768 beshort 0 left to right/top to bottom
  1000. >768 beshort 1 right to left/top to bottom
  1001. >768 beshort 2 left to right/bottom to top
  1002. >768 beshort 3 right to left/bottom to top
  1003. >768 beshort 4 top to bottom/left to right
  1004. >768 beshort 5 top to bottom/right to left
  1005. >768 leshort 6 bottom to top/left to right
  1006. >768 leshort 7 bottom to top/right to left
  1007. # From: Tom Hilinski <tom.hilinski@comcast.net>
  1008. # http://www.unidata.ucar.edu/packages/netcdf/
  1009. 0 string CDF\001 NetCDF Data Format data
  1010. #-----------------------------------------------------------------------
  1011. # Hierarchical Data Format, used to facilitate scientific data exchange
  1012. # specifications at http://hdf.ncsa.uiuc.edu/
  1013. 0 belong 0x0e031301 Hierarchical Data Format (version 4) data
  1014. !:mime application/x-hdf
  1015. 0 string \211HDF\r\n\032\n Hierarchical Data Format (version 5) data
  1016. !:mime application/x-hdf
  1017. 512 string \211HDF\r\n\032\n Hierarchical Data Format (version 5) with 512 bytes user block
  1018. !:mime application/x-hdf
  1019. 1024 string \211HDF\r\n\032\n Hierarchical Data Format (version 5) with 1k user block
  1020. !:mime application/x-hdf
  1021. 2048 string \211HDF\r\n\032\n Hierarchical Data Format (version 5) with 2k user block
  1022. !:mime application/x-hdf
  1023. 4096 string \211HDF\r\n\032\n Hierarchical Data Format (version 5) with 4k user block
  1024. !:mime application/x-hdf
  1025. # From: Tobias Burnus <burnus@net-b.de>
  1026. # Xara (for a while: Corel Xara) is a graphic package, see
  1027. # http://www.xara.com/ for Windows and as GPL application for Linux
  1028. 0 string XARA\243\243 Xara graphics file
  1029. # http://www.cartesianinc.com/Tech/
  1030. 0 string CPC\262 Cartesian Perceptual Compression image
  1031. !:mime image/x-cpi
  1032. # From Albert Cahalan <acahalan@gmail.com>
  1033. # puredigital used it for the CVS disposable camcorder
  1034. #8 lelong 4 ZBM bitmap image data
  1035. #>4 leshort x %u x
  1036. #>6 leshort x %u
  1037. # From Albert Cahalan <acahalan@gmail.com>
  1038. # uncompressed 5:6:5 HighColor image for OLPC XO firmware icons
  1039. 0 string C565 OLPC firmware icon image data
  1040. >4 leshort x %u x
  1041. >6 leshort x %u
  1042. # Applied Images - Image files from Cytovision
  1043. # Gustavo Junior Alves <gjalves@gjalves.com.br>
  1044. 0 string \xce\xda\xde\xfa Cytovision Metaphases file
  1045. 0 string \xed\xad\xef\xac Cytovision Karyotype file
  1046. 0 string \x0b\x00\x03\x00 Cytovision FISH Probe file
  1047. 0 string \xed\xfe\xda\xbe Cytovision FLEX file
  1048. 0 string \xed\xab\xed\xfe Cytovision FLEX file
  1049. 0 string \xad\xfd\xea\xad Cytovision RATS file
  1050. # Wavelet Scalar Quantization format used in gray-scale fingerprint images
  1051. # From Tano M Fotang <mfotang@quanteq.com>
  1052. 0 string \xff\xa0\xff\xa8\x00 Wavelet Scalar Quantization image data
  1053. # Type: PCO B16 image files
  1054. # URL: http://www.pco.de/fileadmin/user_upload/db/download/MA_CWDCOPIE_0412b.pdf
  1055. # From: Florian Philipp <florian.philipp@binarywings.net>
  1056. # Extension: .b16
  1057. # Description: Pixel image format produced by PCO Camware, typically used
  1058. # together with PCO cameras.
  1059. # Note: Different versions exist for e.g. 8 bit and 16 bit images.
  1060. # Documentation is incomplete.
  1061. 0 string/b PCO- PCO B16 image data
  1062. >12 lelong x \b, %dx
  1063. >16 lelong x \b%d
  1064. >20 lelong 0 \b, short header
  1065. >20 lelong -1 \b, extended header
  1066. >>24 lelong 0 \b, grayscale
  1067. >>>36 lelong 0 linear LUT
  1068. >>>36 lelong 1 logarithmic LUT
  1069. >>>28 lelong x [%d
  1070. >>>32 lelong x \b,%d]
  1071. >>24 lelong 1 \b, color
  1072. >>>64 lelong 0 linear LUT
  1073. >>>64 lelong 1 logarithmic LUT
  1074. >>>40 lelong x r[%d
  1075. >>>44 lelong x \b,%d]
  1076. >>>48 lelong x g[%d
  1077. >>>52 lelong x \b,%d]
  1078. >>>56 lelong x b[%d
  1079. >>>60 lelong x \b,%d]
  1080. # Polar Monitor Bitmap (.pmb) used as logo for Polar Electro watches
  1081. # From: Markus Heidelberg <markus.heidelberg at web.de>
  1082. 0 string/t [BitmapInfo2] Polar Monitor Bitmap text
  1083. !:mime image/x-polar-monitor-bitmap
  1084. # From: Rick Richardson <rickrich@gmail.com>
  1085. # updated by: Joerg Jenderek
  1086. # URL: http://techmods.net/nuvi/
  1087. 0 string GARMIN\ BITMAP\ 01 Garmin Bitmap file
  1088. # extension is also used for
  1089. # Sony SRF raw image (image/x-sony-srf)
  1090. # SRF map
  1091. # Terragen Surface Map (http://www.planetside.co.uk/terragen)
  1092. # FileLocator Pro search criteria file (http://www.mythicsoft.com/filelocatorpro)
  1093. !:ext srf
  1094. #!:mime image/x-garmin-srf
  1095. # version 1.00,2.00,2.10,2.40,2.50
  1096. >0x2f string >0 \b, version %4.4s
  1097. # width (2880,2881,3240)
  1098. >0x55 uleshort >0 \b, %dx
  1099. # height (80,90)
  1100. >>0x53 uleshort x \b%d
  1101. # Type: Ulead Photo Explorer5 (.pe5)
  1102. # URL: http://www.jisyo.com/cgibin/view.cgi?EXT=pe5 (Japanese)
  1103. # From: Simon Horman <horms@debian.org>
  1104. 0 string IIO2H Ulead Photo Explorer5
  1105. # Type: X11 cursor
  1106. # URL: http://webcvs.freedesktop.org/mime/shared-mime-info/freedesktop.org.xml.in?view=markup
  1107. # From: Mathias Brodala <info@noctus.net>
  1108. 0 string Xcur X11 cursor
  1109. # Type: Olympus ORF raw images.
  1110. # URL: http://libopenraw.freedesktop.org/wiki/Olympus_ORF
  1111. # From: Adam Buchbinder <adam.buchbinder@gmail.com>
  1112. 0 string MMOR Olympus ORF raw image data, big-endian
  1113. !:mime image/x-olympus-orf
  1114. 0 string IIRO Olympus ORF raw image data, little-endian
  1115. !:mime image/x-olympus-orf
  1116. 0 string IIRS Olympus ORF raw image data, little-endian
  1117. !:mime image/x-olympus-orf
  1118. # Type: files used in modern AVCHD camcoders to store clip information
  1119. # Extension: .cpi
  1120. # From: Alexander Danilov <alexander.a.danilov@gmail.com>
  1121. 0 string HDMV0100 AVCHD Clip Information
  1122. # From: Adam Buchbinder <adam.buchbinder@gmail.com>
  1123. # URL: http://local.wasp.uwa.edu.au/~pbourke/dataformats/pic/
  1124. # Radiance HDR; usually has .pic or .hdr extension.
  1125. 0 string #?RADIANCE\n Radiance HDR image data
  1126. #!mime image/vnd.radiance
  1127. # From: Adam Buchbinder <adam.buchbinder@gmail.com>
  1128. # URL: http://www.mpi-inf.mpg.de/resources/pfstools/pfs_format_spec.pdf
  1129. # Used by the pfstools packages. The regex matches for the image size could
  1130. # probably use some work. The MIME type is made up; if there's one in
  1131. # actual common use, it should replace the one below.
  1132. 0 string PFS1\x0a PFS HDR image data
  1133. #!mime image/x-pfs
  1134. >1 regex [0-9]*\ \b, %s
  1135. >>1 regex \ [0-9]{4} \bx%s
  1136. # Type: Foveon X3F
  1137. # URL: http://www.photofo.com/downloads/x3f-raw-format.pdf
  1138. # From: Adam Buchbinder <adam.buchbinder@gmail.com>
  1139. # Note that the MIME type isn't defined anywhere that I can find; if
  1140. # there's a canonical type for this format, it should replace this one.
  1141. 0 string FOVb Foveon X3F raw image data
  1142. !:mime image/x-x3f
  1143. >6 leshort x \b, version %d.
  1144. >4 leshort x \b%d
  1145. >28 lelong x \b, %dx
  1146. >32 lelong x \b%d
  1147. # Paint.NET file
  1148. # From Adam Buchbinder <adam.buchbinder@gmail.com>
  1149. 0 string PDN3 Paint.NET image data
  1150. !:mime image/x-paintnet
  1151. # Not really an image.
  1152. # From: "Tano M. Fotang" <mfotang@quanteq.com>
  1153. 0 string \x46\x4d\x52\x00 ISO/IEC 19794-2 Format Minutiae Record (FMR)
  1154. # doc: http://www.shikino.co.jp/eng/products/images/FLOWER.jpg.zip
  1155. # example: http://www.shikino.co.jp/eng/products/images/FLOWER.wdp.zip
  1156. 90 bequad 0x574D50484F544F00 JPEG-XR Image
  1157. >98 byte&0x08 =0x08 \b, hard tiling
  1158. >99 byte&0x80 =0x80 \b, tiling present
  1159. >99 byte&0x40 =0x40 \b, codestream present
  1160. >99 byte&0x38 x \b, spatial xform=
  1161. >99 byte&0x38 0x00 \bTL
  1162. >99 byte&0x38 0x08 \bBL
  1163. >99 byte&0x38 0x10 \bTR
  1164. >99 byte&0x38 0x18 \bBR
  1165. >99 byte&0x38 0x20 \bBT
  1166. >99 byte&0x38 0x28 \bRB
  1167. >99 byte&0x38 0x30 \bLT
  1168. >99 byte&0x38 0x38 \bLB
  1169. >100 byte&0x80 =0x80 \b, short header
  1170. >>102 beshort+1 x \b, %d
  1171. >>104 beshort+1 x \bx%d
  1172. >100 byte&0x80 =0x00 \b, long header
  1173. >>102 belong+1 x \b, %x
  1174. >>106 belong+1 x \bx%x
  1175. >101 beshort&0xf x \b, bitdepth=
  1176. >>101 beshort&0xf 0x0 \b1-WHITE=1
  1177. >>101 beshort&0xf 0x1 \b8
  1178. >>101 beshort&0xf 0x2 \b16
  1179. >>101 beshort&0xf 0x3 \b16-SIGNED
  1180. >>101 beshort&0xf 0x4 \b16-FLOAT
  1181. >>101 beshort&0xf 0x5 \b(reserved 5)
  1182. >>101 beshort&0xf 0x6 \b32-SIGNED
  1183. >>101 beshort&0xf 0x7 \b32-FLOAT
  1184. >>101 beshort&0xf 0x8 \b5
  1185. >>101 beshort&0xf 0x9 \b10
  1186. >>101 beshort&0xf 0xa \b5-6-5
  1187. >>101 beshort&0xf 0xb \b(reserved %d)
  1188. >>101 beshort&0xf 0xc \b(reserved %d)
  1189. >>101 beshort&0xf 0xd \b(reserved %d)
  1190. >>101 beshort&0xf 0xe \b(reserved %d)
  1191. >>101 beshort&0xf 0xf \b1-BLACK=1
  1192. >101 beshort&0xf0 x \b, colorfmt=
  1193. >>101 beshort&0xf0 0x00 \bYONLY
  1194. >>101 beshort&0xf0 0x10 \bYUV240
  1195. >>101 beshort&0xf0 0x20 \bYWV422
  1196. >>101 beshort&0xf0 0x30 \bYWV444
  1197. >>101 beshort&0xf0 0x40 \bCMYK
  1198. >>101 beshort&0xf0 0x50 \bCMYKDIRECT
  1199. >>101 beshort&0xf0 0x60 \bNCOMPONENT
  1200. >>101 beshort&0xf0 0x70 \bRGB
  1201. >>101 beshort&0xf0 0x80 \bRGBE
  1202. >>101 beshort&0xf0 >0x80 \b(reserved 0x%x)
  1203. # From: Johan van der Knijff <johan.vanderknijff@kb.nl>
  1204. #
  1205. # BPG (Better Portable Graphics) format
  1206. # http://bellard.org/bpg/
  1207. # http://fileformats.archiveteam.org/wiki/BPG
  1208. #
  1209. 0 string \x42\x50\x47\xFB BPG (Better Portable Graphics)
  1210. !:mime image/bpg
  1211. # From: Joerg Jenderek
  1212. # URL: https://en.wikipedia.org/wiki/Apple_Icon_Image_format
  1213. 0 string icns Mac OS X icon
  1214. !:mime image/x-icns
  1215. !:apple ????icns
  1216. !:ext icns
  1217. >4 ubelong >0
  1218. # file size
  1219. >>4 ubelong x \b, %d bytes
  1220. # icon type
  1221. >>8 string x \b, "%4.4s" type
  1222. # TIM images
  1223. 0 lelong 0x00000010 TIM image,
  1224. >4 lelong 0x8 4-Bit,
  1225. >4 lelong 0x9 8-Bit,
  1226. >4 lelong 0x2 15-Bit,
  1227. >4 lelong 0x3 24-Bit,
  1228. >4 lelong &8
  1229. >>(8.l+12) leshort x Pixel at (%d,
  1230. >>(8.l+14) leshort x \b%d)
  1231. >>(8.l+16) leshort x Size=%dx
  1232. >>(8.l+18) leshort x \b%d,
  1233. >>4 lelong 0x8 16 CLUT Entries at
  1234. >>4 lelong 0x9 256 CLUT Entries at
  1235. >>12 leshort x (%d,
  1236. >>14 leshort x \b%d)
  1237. >4 lelong ^8
  1238. >>12 leshort x Pixel at (%d,
  1239. >>14 leshort x \b%d)
  1240. >>16 leshort x Size=%dx
  1241. >>18 leshort x \b%d
  1242. # MDEC streams
  1243. 0 lelong 0x80010160 MDEC video stream,
  1244. >16 leshort x %dx
  1245. >18 leshort x \b%d
  1246. #>8 lelong x %d frames
  1247. #>4 leshort x secCount=%d;
  1248. #>6 leshort x nSectors=%d;
  1249. #>12 lelong x frameSize=%d;
  1250. # BS encoded bitstreams
  1251. 2 leshort 0x3800 BS image,
  1252. >6 leshort x Version %d,
  1253. >4 leshort x Quantization %d,
  1254. >0 leshort x (Decompresses to %d words)
  1255. # Type: farbfeld image.
  1256. # Url: http://tools.suckless.org/farbfeld/
  1257. # From: Ian D. Scott <ian@iandouglasscott.com>
  1258. #
  1259. 0 string farbfeld farbfeld image data,
  1260. >8 ubelong x %dx
  1261. >12 ubelong x \b%d
  1262. # Type: Sega PVR image.
  1263. # From: David Korth <gerbilsoft@gerbilsoft.com>
  1264. # References:
  1265. # - http://fabiensanglard.net/Mykaruga/tools/segaPVRFormat.txt
  1266. # - https://github.com/yazgoo/pvrx2png
  1267. # - https://github.com/nickworonekin/puyotools
  1268. # Sega PVR header.
  1269. 0 name sega-pvr-image-header
  1270. >0x0C leshort x %d x
  1271. >0x0E leshort x %d
  1272. # Image format.
  1273. >0x08 byte 0 \b, ARGB1555
  1274. >0x08 byte 1 \b, RGB565
  1275. >0x08 byte 2 \b, ARGB4444
  1276. >0x08 byte 3 \b, YUV442
  1277. >0x08 byte 4 \b, Bump
  1278. >0x08 byte 5 \b, 4bpp
  1279. >0x08 byte 6 \b, 8bpp
  1280. # Image data type.
  1281. >0x09 byte 0x01 \b, square twiddled
  1282. >0x09 byte 0x02 \b, square twiddled & mipmap
  1283. >0x09 byte 0x03 \b, VQ
  1284. >0x09 byte 0x04 \b, VQ & mipmap
  1285. >0x09 byte 0x05 \b, 8-bit CLUT twiddled
  1286. >0x09 byte 0x06 \b, 4-bit CLUT twiddled
  1287. >0x09 byte 0x07 \b, 8-bit direct twiddled
  1288. >0x09 byte 0x08 \b, 4-bit direct twiddled
  1289. >0x09 byte 0x09 \b, rectangle
  1290. >0x09 byte 0x0B \b, rectangular stride
  1291. >0x09 byte 0x0D \b, rectangular twiddled
  1292. >0x09 byte 0x10 \b, small VQ
  1293. >0x09 byte 0x11 \b, small VQ & mipmap
  1294. >0x09 byte 0x12 \b, square twiddled & mipmap
  1295. # Sega PVR (Xbox) image header.
  1296. # Contains an embedded DirectDraw surface instead of PVR data.
  1297. 0 name sega-pvr-xbox-dds-header
  1298. >16 lelong x %d x
  1299. >12 lelong x %d,
  1300. >84 string x %.4s
  1301. # Sega PVR image.
  1302. 0 string PVRT
  1303. >0x10 string DDS\040\174\000\000\000 Sega PVR (Xbox) image:
  1304. >>0x20 use sega-pvr-xbox-dds-header
  1305. >0x10 belong !0x44445320 Sega PVR image:
  1306. >>0 use sega-pvr-image-header
  1307. # Sega PVR image with GBIX.
  1308. 0 string GBIX
  1309. >0x10 string PVRT
  1310. >>0x10 string DDS\040\174\000\000\000 Sega PVR (Xbox) image:
  1311. >>>0x20 use sega-pvr-xbox-dds-header
  1312. >>0x10 belong !0x44445320 Sega PVR image:
  1313. >>>0x10 use sega-pvr-image-header
  1314. >>0x08 lelong x \b, global index = %u
  1315. # Sega GVR header.
  1316. 0 name sega-gvr-image-header
  1317. >0x0C beshort x %d x
  1318. >0x0E beshort x %d
  1319. # Image data format.
  1320. >0x0B byte 0 \b, I4
  1321. >0x0B byte 1 \b, I8
  1322. >0x0B byte 2 \b, IA4
  1323. >0x0B byte 3 \b, IA8
  1324. >0x0B byte 4 \b, RGB565
  1325. >0x0B byte 5 \b, RGB5A3
  1326. >0x0B byte 6 \b, ARGB8888
  1327. >0x0B byte 8 \b, CI4
  1328. >0x0B byte 9 \b, CI8
  1329. >0x0B byte 14 \b, DXT1
  1330. # Sega GVR image.
  1331. 0 string GVRT Sega GVR image:
  1332. >0x10 use sega-gvr-image-header
  1333. # Sega GVR image with GBIX.
  1334. 0 string GBIX
  1335. >0x10 string GVRT Sega GVR image:
  1336. >>0x10 use sega-gvr-image-header
  1337. >>0x08 belong x \b, global index = %u