images 99 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030303130323033303430353036303730383039304030413042304330443045304630473048304930503051305230533054305530563057305830593060306130623063
  1. #------------------------------------------------------------------------------
  2. # $File: images,v 1.205 2021/10/18 13:56:29 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. # Conflict with MPEG sequences.
  29. !:strength -40
  30. # Prevent conflicts with CRI ADX.
  31. #>(2.S-2) belong !0x28632943
  32. # above line does not work for rgb32_top_left_rle.tga
  33. # skip some MPEG sequence *.vob and some CRI ADX audio with improbable interleave bits
  34. >17 ubyte&0xC0 !0xC0
  35. # skip more garbage like *.iso by looking for positive image type
  36. >>2 ubyte >0
  37. # skip some compiled terminfo like xterm+tmux by looking for image type less equal 33
  38. >>>2 ubyte <34
  39. # skip some MPEG sequence *.vob HV001T01.EVO winnicki.mpg with unacceptable alpha channel depth 11
  40. >>>>17 ubyte&0x0F !11
  41. # skip arches.3200 , Finder.Root , Slp.1 by looking for low pixel depth 1 8 15 16 24 32
  42. >>>>>16 ubyte 1
  43. >>>>>>0 use tga-image
  44. >>>>>16 ubyte 8
  45. >>>>>>0 use tga-image
  46. >>>>>16 ubyte 15
  47. >>>>>>0 use tga-image
  48. >>>>>16 ubyte 16
  49. >>>>>>0 use tga-image
  50. >>>>>16 ubyte 24
  51. >>>>>>0 use tga-image
  52. >>>>>16 ubyte 32
  53. >>>>>>0 use tga-image
  54. # display tga bitmap image information
  55. 0 name tga-image
  56. >2 ubyte <34 Targa image data
  57. !:mime image/x-tga
  58. !:apple ????TPIC
  59. # normal extension .tga but some Truevision products used others:
  60. # tpic (Apple),icb (Image Capture Board),vda (Video Display Adapter),vst (NuVista),win (UNSURE about that)
  61. !:ext tga/tpic/icb/vda/vst
  62. # image type 1 2 3 9 10 11 32 33
  63. >2 ubyte&0xF7 1 - Map
  64. >2 ubyte&0xF7 2 - RGB
  65. # alpha channel
  66. >>17 ubyte&0x0F >0 \bA
  67. >2 ubyte&0xF7 3 - Mono
  68. # type not found, but by http://www.fileformat.info/format/tga/corion.htm
  69. # Compressed color-mapped data, using Huffman, Delta, and runlength encoding
  70. >2 ubyte 32 - Color
  71. # Compressed color-mapped data, using Huffman, Delta, and RLE. 4-pass quadtree- type process
  72. >2 ubyte 33 - Color
  73. # Color Map Type 0~no 1~color map
  74. >1 ubyte 1 (
  75. # first color map entry, 0 normal
  76. >>3 uleshort >0 \b%d-
  77. # color map length 0 2 1dh 3bh d9h 100h
  78. >>5 uleshort x \b%d)
  79. # 8~run length encoding bit
  80. >2 ubyte&0x08 8 - RLE
  81. # gimp can create big pictures!
  82. >12 uleshort >0 %d x
  83. >12 uleshort =0 65536 x
  84. # image height. 0 interpreted as 65536
  85. >14 uleshort >0 %d
  86. >14 uleshort =0 65536
  87. # Image Pixel depth 1 8 15 16 24 32
  88. >16 ubyte x x %d
  89. # X origin of image. 0 normal
  90. >8 uleshort >0 +%d
  91. # Y origin of image. 0 normal; positive for top
  92. >10 uleshort >0 +%d
  93. # Image descriptor: bits 3-0 give the alpha channel depth, bits 5-4 give direction
  94. # alpha depth like: 1 8
  95. >17 ubyte&0x0F >0 - %d-bit alpha
  96. # bits 5-4 give direction. normal bottom left
  97. >17 ubyte &0x20 - top
  98. #>17 ubyte ^0x20 - bottom
  99. >17 ubyte &0x10 - right
  100. #>17 ubyte ^0x10 - left
  101. # some info say other bits 6-7 should be zero
  102. # but data storage interleave by http://www.fileformat.info/format/tga/corion.htm
  103. # 00 - no interleave;01 - even/odd interleave; 10 - four way interleave; 11 - reserved
  104. #>17 ubyte&0xC0 0x00 - no interleave
  105. >17 ubyte&0xC0 0x40 - interleave
  106. >17 ubyte&0xC0 0x80 - four way interleave
  107. >17 ubyte&0xC0 0xC0 - reserved
  108. # positive length implies identification field
  109. >0 ubyte >0
  110. >>18 string x "%s"
  111. # last 18 bytes of newer tga file footer signature
  112. >18 search/4261301/s TRUEVISION-XFILE.\0
  113. # extension area offset if not 0
  114. >>&-8 ulelong >0
  115. # length of the extension area. normal 495 for version 2.0
  116. >>>(&-4.l) uleshort 0x01EF
  117. # AuthorName[41]
  118. >>>>&0 string >\0 - author "%-.40s"
  119. # Comment[324]=4 * 80 null terminated
  120. >>>>&41 string >\0 - comment "%-.80s"
  121. # date
  122. >>>>&365 ubequad&0xffffFFFFffff0000 !0
  123. # Day
  124. >>>>>&-6 uleshort x %d
  125. # Month
  126. >>>>>&-8 uleshort x \b-%d
  127. # Year
  128. >>>>>&-4 uleshort x \b-%d
  129. # time
  130. >>>>&371 ubequad&0xffffFFFFffff0000 !0
  131. # hour
  132. >>>>>&-8 uleshort x %d
  133. # minutes
  134. >>>>>&-6 uleshort x \b:%.2d
  135. # second
  136. >>>>>&-4 uleshort x \b:%.2d
  137. # JobName[41]
  138. >>>>&377 string >\0 - job "%-.40s"
  139. # JobHour Jobminute Jobsecond
  140. >>>>&418 ubequad&0xffffFFFFffff0000 !0
  141. >>>>>&-8 uleshort x %d
  142. >>>>>&-6 uleshort x \b:%.2d
  143. >>>>>&-4 uleshort x \b:%.2d
  144. # SoftwareId[41]
  145. >>>>&424 string >\0 - %-.40s
  146. # SoftwareVersionNumber
  147. >>>>&424 ubyte >0
  148. >>>>>&40 uleshort/100 x %d
  149. >>>>>&40 uleshort%100 x \b.%d
  150. # VersionLetter
  151. >>>>>&42 ubyte >0x20 \b%c
  152. # KeyColor
  153. >>>>&468 ulelong >0 - keycolor %#8.8x
  154. # Denominator of Pixel ratio. 0~no pixel aspect
  155. >>>>&474 uleshort >0
  156. # Numerator
  157. >>>>>&-4 uleshort >0 - aspect %d
  158. >>>>>&-2 uleshort x \b/%d
  159. # Denominator of Gamma ratio. 0~no Gamma value
  160. >>>>&478 uleshort >0
  161. # Numerator
  162. >>>>>&-4 uleshort >0 - gamma %d
  163. >>>>>&-2 uleshort x \b/%d
  164. # ColorOffset
  165. #>>>>&480 ulelong x - col offset %#8.8x
  166. # StampOffset
  167. #>>>>&484 ulelong x - stamp offset %#8.8x
  168. # ScanOffset
  169. #>>>>&488 ulelong x - scan offset %#8.8x
  170. # AttributesType
  171. #>>>>&492 ubyte x - Attributes %#x
  172. ## EndOfTGA
  173. # PBMPLUS images
  174. # URL: https://en.wikipedia.org/wiki/Netpbm
  175. # The next byte following the magic is always whitespace.
  176. # adding 65 to strength so that Netpbm images comes before "x86 boot sector" or
  177. # "DOS/MBR boot sector" identified by ./filesystems
  178. 0 name netpbm
  179. >3 regex/s =[0-9]{1,50}\ [0-9]{1,50} Netpbm image data
  180. >>&0 regex =[0-9]{1,50} \b, size = %s x
  181. >>>&0 regex =[0-9]{1,50} \b %s
  182. 0 search/1 P1
  183. # test for whitespace after 2 byte magic
  184. >2 regex/2 [\040\t\f\r\n]
  185. # skip DROID x-fmt-164-signature-id-583.pbm with ten 0 digits
  186. >>3 string !000000000
  187. >>>0 use netpbm
  188. >>>0 string x \b, bitmap
  189. !:strength + 65
  190. !:mime image/x-portable-bitmap
  191. !:ext pbm
  192. # check for character # starting a comment line
  193. >>>3 ubyte =0x23
  194. >>>>4 string x %s
  195. 0 search/1 P2
  196. >0 regex/4 P2[\040\t\f\r\n]
  197. >>0 use netpbm
  198. >>0 string x \b, greymap
  199. !:strength + 65
  200. # american spelling gray
  201. !:mime image/x-portable-graymap
  202. !:ext pgm
  203. 0 search/1 P3
  204. >0 regex/4 P3[\040\t\f\r\n]
  205. >>0 use netpbm
  206. >>0 string x \b, pixmap
  207. !:strength + 65
  208. !:mime image/x-portable-pixmap
  209. !:ext ppm
  210. 0 string P4
  211. >0 regex/4 P4[\040\t\f\r\n]
  212. >>0 use netpbm
  213. >>0 string x \b, rawbits, bitmap
  214. !:strength + 65
  215. !:mime image/x-portable-bitmap
  216. !:ext pbm
  217. 0 string P5
  218. >0 regex/4 P5[\040\t\f\r\n]
  219. >>0 use netpbm
  220. >>0 string x \b, rawbits, greymap
  221. !:strength + 65
  222. !:mime image/x-portable-greymap
  223. !:ext pgm
  224. 0 string P6
  225. >0 regex/4 P6[\040\t\f\r\n]
  226. >>0 use netpbm
  227. >>0 string x \b, rawbits, pixmap
  228. !:strength + 65
  229. !:mime image/x-portable-pixmap
  230. !:ext ppm/pnm
  231. # URL: https://en.wikipedia.org/wiki/Netpbm#PAM_graphics_format
  232. # Reference: http://fileformats.archiveteam.org/wiki/Portable_Arbitrary_Map
  233. # Update: Joerg Jenderek
  234. 0 string P7
  235. # skip DROID fmt-405-signature-id-589.pam by looking for character like New Line
  236. >2 ubyte !0xAB
  237. #>2 ubyte =0x0A
  238. >>3 search/256/b WIDTH Netpbm PAM image file, size =
  239. !:mime image/x-portable-arbitrarymap
  240. !:ext pam
  241. !:strength + 65
  242. >>>&1 string x %s
  243. >>>3 search/256/b HEIGHT x
  244. >>>>&1 string x %s
  245. # at offset 2 a New Line character (0xA) should appear
  246. >>>2 ubyte !0x0A \b, %#x at offset 2 instead new line
  247. # From: bryanh@giraffe-data.com (Bryan Henderson)
  248. 0 string \117\072 Solitaire Image Recorder format
  249. >4 string \013 MGI Type 11
  250. >4 string \021 MGI Type 17
  251. 0 string .MDA MicroDesign data
  252. >21 byte 48 version 2
  253. >21 byte 51 version 3
  254. 0 string .MDP MicroDesign page data
  255. >21 byte 48 version 2
  256. >21 byte 51 version 3
  257. # NIFF (Navy Interchange File Format, a modification of TIFF) images
  258. # [GRR: this *must* go before TIFF]
  259. 0 string IIN1 NIFF image data
  260. !:mime image/x-niff
  261. # Canon RAW version 1 (CRW) files are a type of Canon Image File Format
  262. # (CIFF) file. These are apparently all little-endian.
  263. # From: Adam Buchbinder <adam.buchbinder@gmail.com>
  264. # URL: https://www.sno.phy.queensu.ca/~phil/exiftool/canon_raw.html
  265. 0 string II\x1a\0\0\0HEAPCCDR Canon CIFF raw image data
  266. !:mime image/x-canon-crw
  267. >16 leshort x \b, version %d.
  268. >14 leshort x \b%d
  269. # Canon RAW version 2 (CR2) files are a kind of TIFF with an extra magic
  270. # number. Put this above the TIFF test to make sure we detect them.
  271. # These are apparently all little-endian.
  272. # From: Adam Buchbinder <adam.buchbinder@gmail.com>
  273. # URL: https://libopenraw.freedesktop.org/wiki/Canon_CR2
  274. 0 string II\x2a\0\x10\0\0\0CR Canon CR2 raw image data
  275. !:mime image/x-canon-cr2
  276. !:strength +80
  277. >10 byte x \b, version %d.
  278. >11 byte x \b%d
  279. # Fujifilm RAF RAW image files with embedded JPEG data and compressed
  280. # or uncompressed CFA RAW data. Byte order: Big Endian.
  281. # URL: https://libopenraw.freedesktop.org/formats/raf/
  282. # Useful info from http://fileformats.archiveteam.org/wiki/Fujifilm_RAF.
  283. # File extension: RAF
  284. # Works for both the FinePix S2 Pro and the X-T3. Anybody have some more Fuji
  285. # raw samples available?
  286. # -- David Dyer-Bennet <dd-b@dd-b.net> 9-Sep-2021
  287. 0 string FUJIFILMCCD-RAW Fujifilm RAF raw image data
  288. !:mime image/x-fuji-raf
  289. !:ext raf
  290. >0x10 string x \b, format version %4.4s
  291. >0x1C string x \b, camera %s
  292. # Tag Image File Format, from Daniel Quinlan (quinlan@yggdrasil.com)
  293. # The second word of TIFF files is the TIFF version number, 42, which has
  294. # never changed. The TIFF specification recommends testing for it.
  295. 0 string MM\x00\x2a TIFF image data, big-endian
  296. !:strength +70
  297. !:mime image/tiff
  298. !:ext tif,tiff
  299. >(4.L) use \^tiff_ifd
  300. 0 string II\x2a\x00 TIFF image data, little-endian
  301. !:mime image/tiff
  302. !:strength +70
  303. !:ext tif,tiff
  304. >(4.l) use tiff_ifd
  305. 0 name tiff_ifd
  306. >0 leshort x \b, direntries=%d
  307. >2 use tiff_entry
  308. 0 name tiff_entry
  309. # NewSubFileType
  310. >0 leshort 0xfe
  311. >>12 use tiff_entry
  312. >0 leshort 0x100
  313. >>4 lelong 1
  314. >>>12 use tiff_entry
  315. >>>8 leshort x \b, width=%d
  316. >0 leshort 0x101
  317. >>4 lelong 1
  318. >>>8 leshort x \b, height=%d
  319. >>>12 use tiff_entry
  320. >0 leshort 0x102
  321. >>8 leshort x \b, bps=%d
  322. >>12 use tiff_entry
  323. >0 leshort 0x103
  324. >>4 lelong 1 \b, compression=
  325. >>>8 leshort 1 \bnone
  326. >>>8 leshort 2 \bhuffman
  327. >>>8 leshort 3 \bbi-level group 3
  328. >>>8 leshort 4 \bbi-level group 4
  329. >>>8 leshort 5 \bLZW
  330. >>>8 leshort 6 \bJPEG (old)
  331. >>>8 leshort 7 \bJPEG
  332. >>>8 leshort 8 \bdeflate
  333. >>>8 leshort 9 \bJBIG, ITU-T T.85
  334. >>>8 leshort 0xa \bJBIG, ITU-T T.43
  335. >>>8 leshort 0x7ffe \bNeXT RLE 2-bit
  336. >>>8 leshort 0x8005 \bPackBits (Macintosh RLE)
  337. >>>8 leshort 0x8029 \bThunderscan RLE
  338. >>>8 leshort 0x807f \bRasterPadding (CT or MP)
  339. >>>8 leshort 0x8080 \bRLE (Line Work)
  340. >>>8 leshort 0x8081 \bRLE (High-Res Cont-Tone)
  341. >>>8 leshort 0x8082 \bRLE (Binary Line Work)
  342. >>>8 leshort 0x80b2 \bDeflate (PKZIP)
  343. >>>8 leshort 0x80b3 \bKodak DCS
  344. >>>8 leshort 0x8765 \bJBIG
  345. >>>8 leshort 0x8798 \bJPEG2000
  346. >>>8 leshort 0x8799 \bNikon NEF Compressed
  347. >>>8 default x
  348. >>>>8 leshort x \b(unknown %#x)
  349. >>>12 use tiff_entry
  350. >0 leshort 0x106 \b, PhotometricIntepretation=
  351. >>8 clear x
  352. >>8 leshort 0 \bWhiteIsZero
  353. >>8 leshort 1 \bBlackIsZero
  354. >>8 leshort 2 \bRGB
  355. >>8 leshort 3 \bRGB Palette
  356. >>8 leshort 4 \bTransparency Mask
  357. >>8 leshort 5 \bCMYK
  358. >>8 leshort 6 \bYCbCr
  359. >>8 leshort 8 \bCIELab
  360. >>8 default x
  361. >>>8 leshort x \b(unknown=%#x)
  362. >>12 use tiff_entry
  363. # FillOrder
  364. >0 leshort 0x10a
  365. >>4 lelong 1
  366. >>>12 use tiff_entry
  367. # DocumentName
  368. >0 leshort 0x10d
  369. >>(8.l) string x \b, name=%s
  370. >>>12 use tiff_entry
  371. # ImageDescription
  372. >0 leshort 0x10e
  373. >>(8.l) string x \b, description=%s
  374. >>>12 use tiff_entry
  375. # Make
  376. >0 leshort 0x10f
  377. >>(8.l) string x \b, manufacturer=%s
  378. >>>12 use tiff_entry
  379. # Model
  380. >0 leshort 0x110
  381. >>(8.l) string x \b, model=%s
  382. >>>12 use tiff_entry
  383. # StripOffsets
  384. >0 leshort 0x111
  385. >>12 use tiff_entry
  386. # Orientation
  387. >0 leshort 0x112 \b, orientation=
  388. >>8 leshort 1 \bupper-left
  389. >>8 leshort 3 \blower-right
  390. >>8 leshort 6 \bupper-right
  391. >>8 leshort 8 \blower-left
  392. >>8 leshort 9 \bundefined
  393. >>8 default x
  394. >>>8 leshort x \b[*%d*]
  395. >>12 use tiff_entry
  396. # XResolution
  397. >0 leshort 0x11a
  398. >>8 lelong x \b, xresolution=%d
  399. >>12 use tiff_entry
  400. # YResolution
  401. >0 leshort 0x11b
  402. >>8 lelong x \b, yresolution=%d
  403. >>12 use tiff_entry
  404. # ResolutionUnit
  405. >0 leshort 0x128
  406. >>8 leshort x \b, resolutionunit=%d
  407. >>12 use tiff_entry
  408. # Software
  409. >0 leshort 0x131
  410. >>(8.l) string x \b, software=%s
  411. >>12 use tiff_entry
  412. # Datetime
  413. >0 leshort 0x132
  414. >>(8.l) string x \b, datetime=%s
  415. >>12 use tiff_entry
  416. # HostComputer
  417. >0 leshort 0x13c
  418. >>(8.l) string x \b, hostcomputer=%s
  419. >>12 use tiff_entry
  420. # WhitePoint
  421. >0 leshort 0x13e
  422. >>12 use tiff_entry
  423. # PrimaryChromaticities
  424. >0 leshort 0x13f
  425. >>12 use tiff_entry
  426. # YCbCrCoefficients
  427. >0 leshort 0x211
  428. >>12 use tiff_entry
  429. # YCbCrPositioning
  430. >0 leshort 0x213
  431. >>12 use tiff_entry
  432. # ReferenceBlackWhite
  433. >0 leshort 0x214
  434. >>12 use tiff_entry
  435. # Copyright
  436. >0 leshort 0x8298
  437. >>(8.l) string x \b, copyright=%s
  438. >>12 use tiff_entry
  439. # ExifOffset
  440. >0 leshort 0x8769
  441. >>12 use tiff_entry
  442. # GPS IFD
  443. >0 leshort 0x8825 \b, GPS-Data
  444. >>12 use tiff_entry
  445. #>0 leshort x \b, unknown=%#x
  446. #>>12 use tiff_entry
  447. 0 string MM\x00\x2b Big TIFF image data, big-endian
  448. !:mime image/tiff
  449. 0 string II\x2b\x00 Big TIFF image data, little-endian
  450. !:mime image/tiff
  451. # PNG [Portable Network Graphics, or "PNG's Not GIF"] images
  452. # (Greg Roelofs, newt@uchicago.edu)
  453. # (Albert Cahalan, acahalan@cs.uml.edu)
  454. #
  455. # 137 P N G \r \n ^Z \n [4-byte length] I H D R [HEAD data] [HEAD crc] ...
  456. #
  457. # IHDR parser
  458. 0 name png-ihdr
  459. >0 belong x \b, %d x
  460. >4 belong x %d,
  461. >8 byte x %d-bit
  462. >9 byte 0 grayscale,
  463. >9 byte 2 \b/color RGB,
  464. >9 byte 3 colormap,
  465. >9 byte 4 gray+alpha,
  466. >9 byte 6 \b/color RGBA,
  467. #>10 byte 0 deflate/32K,
  468. >12 byte 0 non-interlaced
  469. >12 byte 1 interlaced
  470. # Standard PNG image.
  471. 0 string \x89PNG\x0d\x0a\x1a\x0a\x00\x00\x00\x0DIHDR PNG image data
  472. !:mime image/png
  473. !:ext png
  474. !:strength +10
  475. >16 use png-ihdr
  476. # Apple CgBI PNG image.
  477. 0 string \x89PNG\x0d\x0a\x1a\x0a\x00\x00\x00\x04CgBI
  478. >24 string \x00\x00\x00\x0DIHDR PNG image data (CgBI)
  479. !:mime image/png
  480. !:ext png
  481. !:strength +10
  482. >>32 use png-ihdr
  483. # possible GIF replacements; none yet released!
  484. # (Greg Roelofs, newt@uchicago.edu)
  485. #
  486. # GRR 950115: this was mine ("Zip GIF"):
  487. 0 string GIF94z ZIF image (GIF+deflate alpha)
  488. !:mime image/x-unknown
  489. #
  490. # GRR 950115: this is Jeremy Wohl's Free Graphics Format (better):
  491. #
  492. 0 string FGF95a FGF image (GIF+deflate beta)
  493. !:mime image/x-unknown
  494. #
  495. # GRR 950115: this is Thomas Boutell's Portable Bitmap Format proposal
  496. # (best; not yet implemented):
  497. #
  498. 0 string PBF PBF image (deflate compression)
  499. !:mime image/x-unknown
  500. # GIF
  501. # Strength set up to beat 0x55AA DOS/MBR signature word lookups (+65)
  502. 0 string GIF8 GIF image data
  503. !:strength +80
  504. !:mime image/gif
  505. !:apple 8BIMGIFf
  506. !:ext gif
  507. >4 string 7a \b, version 8%s,
  508. >4 string 9a \b, version 8%s,
  509. >6 leshort >0 %d x
  510. >8 leshort >0 %d
  511. #>10 byte &0x80 color mapped,
  512. #>10 byte&0x07 =0x00 2 colors
  513. #>10 byte&0x07 =0x01 4 colors
  514. #>10 byte&0x07 =0x02 8 colors
  515. #>10 byte&0x07 =0x03 16 colors
  516. #>10 byte&0x07 =0x04 32 colors
  517. #>10 byte&0x07 =0x05 64 colors
  518. #>10 byte&0x07 =0x06 128 colors
  519. #>10 byte&0x07 =0x07 256 colors
  520. # ITC (CMU WM) raster files. It is essentially a byte-reversed Sun raster,
  521. # 1 plane, no encoding.
  522. 0 string \361\0\100\273 CMU window manager raster image data
  523. >4 lelong >0 %d x
  524. >8 lelong >0 %d,
  525. >12 lelong >0 %d-bit
  526. # Magick Image File Format
  527. # URL: https://imagemagick.org/script/miff.php
  528. # Reference: http://fileformats.archiveteam.org/wiki/MIFF
  529. # Update: Joerg Jenderek
  530. # http://www.nationalarchives.gov.uk/pronom/fmt/930
  531. 0 search/256/bc id=imagemagick
  532. # skip bad ASCII text by following new line~0x0A or space~0x20 character
  533. #>&0 ubyte x \b, next character %#x
  534. # called by TriD ImageMagick Machine independent File Format bitmap
  535. >&0 ubyte&0xD5 0 MIFF image data
  536. # https://reposcope.com/mimetype/image/miff
  537. #!:mime image/miff
  538. !:mime image/x-miff
  539. !:ext miff/mif
  540. # examples with standard file(1) magic
  541. #>>0 string =id=ImageMagick with standard magic
  542. # examples with unusual file(1) magic like
  543. >>0 string !id=ImageMagick starting with
  544. # start with comment (brace) like http://samples.fileformat.info/.../AQUARIUM.MIF
  545. >>>0 ubyte =0x7b comment
  546. # skip second character which is often a newline and show comment
  547. >>>>2 string x "%s"
  548. # does not start with comment, probably letters with other case like Id=ImageMagick
  549. # ImageMagick-7.0.9-2/Magick++/demo/smile_anim.miff
  550. >>>0 ubyte !0x7b
  551. >>>>0 string >\0 '%-.14s'
  552. # URL: https://imagemagick.org/
  553. # Reference: https://imagemagick.org/script/magick-vector-graphics.php
  554. # From: Joerg Jenderek
  555. # Note: all white-spaces between commands are ignored
  556. 0 string push
  557. # skip some white spaces
  558. >5 search/3 graphic-context ImageMagick Vector Graphic
  559. # TODO: look for dangerous commands like CVE-2016-3715
  560. #!:mime text/plain
  561. !:mime image/x-mvg
  562. !:ext mvg
  563. # Artisan
  564. 0 long 1123028772 Artisan image data
  565. >4 long 1 \b, rectangular 24-bit
  566. >4 long 2 \b, rectangular 8-bit with colormap
  567. >4 long 3 \b, rectangular 32-bit (24-bit with matte)
  568. # FIG (Facility for Interactive Generation of figures), an object-based format
  569. 0 search/1 #FIG FIG image text
  570. >5 string x \b, version %.3s
  571. # PHIGS
  572. 0 string ARF_BEGARF PHIGS clear text archive
  573. 0 string @(#)SunPHIGS SunPHIGS
  574. # version number follows, in the form m.n
  575. >40 string SunBin binary
  576. >32 string archive archive
  577. # GKS (Graphics Kernel System)
  578. 0 string GKSM GKS Metafile
  579. >24 string SunGKS \b, SunGKS
  580. # CGM image files
  581. 0 string BEGMF clear text Computer Graphics Metafile
  582. # MGR bitmaps (Michael Haardt, u31b3hs@pool.informatik.rwth-aachen.de)
  583. 0 string yz MGR bitmap, modern format, 8-bit aligned
  584. 0 string zz MGR bitmap, old format, 1-bit deep, 16-bit aligned
  585. 0 string xz MGR bitmap, old format, 1-bit deep, 32-bit aligned
  586. 0 string yx MGR bitmap, modern format, squeezed
  587. # Fuzzy Bitmap (FBM) images
  588. 0 string %bitmap\0 FBM image data
  589. >30 long 0x31 \b, mono
  590. >30 long 0x33 \b, color
  591. # facsimile data
  592. 1 string PC\ Research,\ Inc group 3 fax data
  593. >29 byte 0 \b, normal resolution (204x98 DPI)
  594. >29 byte 1 \b, fine resolution (204x196 DPI)
  595. # From: Herbert Rosmanith <herp@wildsau.idv.uni.linz.at>
  596. 0 string Sfff structured fax file
  597. # From: Joerg Jenderek <joerg.jen.der.ek@gmx.net>
  598. # URL: http://fileformats.archiveteam.org/wiki/Award_BIOS_logo
  599. # Note: verified by XnView command `nconvert -fullinfo *.EPA`
  600. 0 string \x11\x06 Award BIOS Logo, 136 x 84
  601. !:mime image/x-award-bioslogo
  602. !:ext epa
  603. 0 string \x11\x09 Award BIOS Logo, 136 x 126
  604. !:mime image/x-award-bioslogo
  605. !:ext epa
  606. # https://telparia.com/fileFormatSamples/image/epa/IO.EPA
  607. # Note: by bitmap-awbm-v1x1009.trid.xml called "Award BIOS logo bitmap (128x126) (v1)"
  608. # verified by RECOIL `recoil2png -o tmp.png IO.EPA; file tmp.png`
  609. 0 string \x10\x09 Award BIOS Logo, 128 x 126
  610. !:mime image/x-award-bioslogo
  611. !:ext epa
  612. #0 string \x07\x1f BIOS Logo corrupted?
  613. # http://www.blackfiveservices.co.uk/awbmtools.shtml
  614. # http://biosgfx.narod.ru/v3/
  615. # http://biosgfx.narod.ru/abr-2/
  616. 0 string AWBM
  617. # Note: by bitmap-awbm.trid.xml called "Award BIOS logo bitmap (v2)"
  618. >4 leshort <1981 Award BIOS Logo, version 2
  619. #>4 leshort <1981 Award BIOS bitmap
  620. !:mime image/x-award-bioslogo2
  621. #!:mime image/x-award-bmp
  622. !:ext epa/bmp
  623. # image width is a multiple of 4
  624. >>4 leshort&0x0003 0
  625. >>>4 leshort x \b, %d
  626. >>>6 leshort x x %d
  627. >>4 leshort&0x0003 >0 \b,
  628. >>>4 leshort&0x0003 =1
  629. >>>>4 leshort x %d+3
  630. >>>4 leshort&0x0003 =2
  631. >>>>4 leshort x %d+2
  632. >>>4 leshort&0x0003 =3
  633. >>>>4 leshort x %d+1
  634. >>>6 leshort x x %d
  635. # at offset 8 starts imagedata followed by "RGB " marker
  636. # PC bitmaps (OS/2, Windows BMP files) (Greg Roelofs, newt@uchicago.edu)
  637. # https://en.wikipedia.org/wiki/BMP_file_format#DIB_header_.\
  638. # 28bitmap_information_header.29
  639. # Note: variant starting direct with DIB header see
  640. # http://fileformats.archiveteam.org/wiki/BMP
  641. # verified by ImageMagick version 6.8.9-8 command `identify *.dib`
  642. 0 leshort 40
  643. # skip bad samples like GAME by looking for valid number of color planes
  644. >12 uleshort 1 Device independent bitmap graphic
  645. !:mime image/x-ms-bmp
  646. !:apple ????BMPp
  647. !:ext dib
  648. >>4 lelong x \b, %d x
  649. >>8 lelong x %d x
  650. >>14 leshort x %d
  651. # number of color planes (must be 1)
  652. #>>12 uleshort >1 \b, %u color planes
  653. # compression method: 0~no 1~RLE 8-bit/pixel 3~Huffman 1D
  654. #>>16 ulelong 3 \b, Huffman 1D compression
  655. >>16 ulelong >0 \b, %u compression
  656. # image size is the size of raw bitmap; a dummy 0 can be given for BI_RGB bitmaps
  657. >>20 ulelong x \b, image size %u
  658. # horizontal and vertical resolution of the image (pixel per metre, signed integer)
  659. >>24 lelong >0 \b, resolution %d x
  660. >>>28 lelong x %d px/m
  661. # number of colors in palette, or 0 to default to 2**n
  662. #>>32 ulelong >0 \b, %u colors
  663. # number of important colors used, or 0 when every color is important
  664. >>36 ulelong >0 \b, %u important colors
  665. # From: Joerg Jenderek
  666. # URL: http://fileformats.archiveteam.org/wiki/VBM_(VDC_BitMap)
  667. # Reference: http://csbruce.com/cbm/postings/csc19950906-1.txt
  668. # http://mark0.net/download/triddefs_xml.7z
  669. # defs/b/bitmap-vbm.trid.xml
  670. # defs/b/bitmap-vbm-v3.trid.xml
  671. # Note: called "VDC BitMap" by TrID
  672. # verified by RECOIL `recoil2png -o tmp.png coke_can.vbm; file tmp.png`
  673. # begin with a signature of 'B' 'M' 0xCB, followed by a version byte 2 or 3
  674. # Similar to the unrelated Windows BMP format
  675. # check for VDC bitmap and then display image dimension and version
  676. 0 name bitmap-vbm
  677. >2 ubyte 0xCB VDC bitmap
  678. !:mime image/x-commodore-vbm
  679. # http://recoil.sourceforge.net/formats.html
  680. !:ext bm/vbm
  681. # the VBM format version number: 2 or 3
  682. >>3 ubyte x \b, version %u
  683. # width of the image in Hi/Lo format
  684. >>4 ubeshort x \b, %u
  685. # height of the image
  686. >>6 ubeshort x x %u
  687. # version 3 images have the following additional header information
  688. >>3 ubyte =3
  689. # data-encoding type: 0~uncompressed 1~RLE-compressed
  690. >>>8 ubyte 0 \b, uncompressed
  691. >>>8 ubyte 1 \b, RLE-compressed
  692. # byte code for general RLE repetitions
  693. #>>>9 ubyte x \b, RLE repetition code 0x%x
  694. # reserved := 0
  695. #>>>14 short >0 \b, reserved 0x%x
  696. # length of comment text; 0~no comment text
  697. #>>>16 ubeshort >0 \b, comment length %u
  698. >>>16 pstring/H >0 \b, comment "%s"
  699. #
  700. 0 string BM
  701. # check for magic and version 2 of VDC bitmap or BMP with cbSize=715=CB02
  702. >2 beshort 0xCB02
  703. >>6 short =0
  704. >>>0 use bitmap-bmp
  705. # VDC bitmap height or maybe a few OS/2 BMP with nonzero "hotspot coordinates"
  706. >>6 short !0
  707. >>>0 use bitmap-vbm
  708. # check for magic and version 3 of VDC bitmap or BMP with cbSize=971=CB03
  709. >2 beshort 0xCB03
  710. # check for reserved value (=0) of VDC bitmap
  711. >>14 short =0
  712. >>>0 use bitmap-vbm
  713. # BMP with cbSize=????03CBh and dib header size != 0
  714. >>14 short !0
  715. >>>0 use bitmap-bmp
  716. # cbSize is size of header or file size of Windows BMP bitmap
  717. >2 default x
  718. >>0 use bitmap-bmp
  719. 0 name bitmap-bmp
  720. >14 lelong 12 PC bitmap, OS/2 1.x format
  721. !:mime image/bmp
  722. !:ext bmp
  723. >>18 leshort x \b, %d x
  724. >>20 leshort x %d
  725. # number of color planes (must be 1)
  726. #>>22 leshort !1 \b, %u color planes
  727. # number of bits per pixel (color depth); found 4 8
  728. >>24 leshort x x %d
  729. # x, y coordinates of the hotspot
  730. >>6 uleshort >0 \b, hotspot %ux
  731. >>>8 uleshort x \b%u
  732. # cbSize; size of file or header like 1Ah 228C8h
  733. >>2 ulelong x \b, cbSize %u
  734. #>>2 ulelong x \b, cbSize 0x%8.8x
  735. # offBits; offset to bitmap data like:
  736. >>10 ulelong x \b, bits offset %u
  737. # http://fileformats.archiveteam.org/wiki/BMP#OS.2F2_BMP_2.0 no examples found
  738. >14 ulelong 48 PC bitmap, OS/2 2.x format (DIB header size=48)
  739. >14 ulelong 24 PC bitmap, OS/2 2.x format (DIB header size=24)
  740. # http://entropymine.com/jason/bmpsuite/bmpsuite/q/pal8os2v2-16.bmp
  741. # Note: by bitmap-bmp-v2o.trid.xml called "Windows Bitmap (v2o)"
  742. >14 ulelong 16 PC bitmap, OS/2 2.x format (DIB header size=16)
  743. !:mime image/bmp
  744. !:apple ????BMPp
  745. !:ext bmp
  746. # image width and height fields are unsigned integers for OS/2
  747. >>18 ulelong x \b, %u x
  748. >>22 ulelong x %u
  749. # number of bits per pixel (color depth); found 8
  750. >>28 uleshort >1 x %u
  751. # x, y coordinates of the hotspot
  752. >>6 uleshort >0 \b, hotspot %ux
  753. >>>8 uleshort x \b%u
  754. # number of color planes (must be 1)
  755. #>>26 uleshort >1 \b, %u color planes
  756. # cbSize; size of file like: 241E
  757. >>2 ulelong x \b, cbSize %u
  758. #>>2 ulelong x \b, cbSize 0x%x
  759. # offBits; offset to bitmap data like: 41E
  760. >>10 ulelong x \b, bits offset %u
  761. #>>10 ulelong x \b, bits offset 0x%x
  762. >14 lelong 64 PC bitmap, OS/2 2.x format
  763. !:mime image/bmp
  764. !:apple ????BMPp
  765. !:ext bmp
  766. # image width and height fields are unsigned integers for OS/2
  767. >>18 ulelong x \b, %u x
  768. >>22 ulelong x %u
  769. # number of bits per pixel (color depth); found 1 4 8
  770. >>28 uleshort >1 x %u
  771. # x, y coordinates of the hotspot
  772. >>6 uleshort >0 \b, hotspot %ux
  773. >>>8 uleshort x \b%u
  774. >>26 uleshort >1 \b, %u color planes
  775. # cbSize; size of file or headers
  776. >>2 ulelong x \b, cbSize %u
  777. # BMP with cbSize 000002CBh=715 or 000003CBh=971 maybe misinterpreted as VDC bitmap
  778. #>>2 ulelong x \b, cbSize %#x
  779. # offBits; offset to bitmap data like 56h 5Eh 8Eh 43Eh
  780. >>10 ulelong x \b, bits offset %u
  781. #>>10 ulelong x \b, bits offset %#x
  782. #>>(10.l) ubequad !0 \b, bits %#16.16llx
  783. # BITMAPV2INFOHEADER adds RGB bit masks
  784. >14 lelong 52 PC bitmap, Adobe Photoshop
  785. !:mime image/bmp
  786. !:apple ????BMPp
  787. !:ext bmp
  788. >>18 lelong x \b, %d x
  789. >>22 lelong x %d x
  790. # number of bits per pixel (color depth); found 16 32
  791. >>28 leshort x %d
  792. # x, y coordinates of the hotspot; should be zero for Windows variant
  793. >>6 uleshort >0 \b, hotspot %ux
  794. >>>8 uleshort x \b%u
  795. # cbSize; size of file like: 14A 7F42
  796. >>2 ulelong x \b, cbSize %u
  797. #>>2 ulelong x \b, cbSize 0x%x
  798. # offBits; offset to bitmap data like: 42h
  799. >>10 ulelong x \b, bits offset %u
  800. #>>10 ulelong x \b, bits offset 0x%x
  801. # BITMAPV3INFOHEADER adds alpha channel bit mask
  802. >14 lelong 56 PC bitmap, Adobe Photoshop with alpha channel mask
  803. !:mime image/bmp
  804. !:apple ????BMPp
  805. !:ext bmp
  806. >>18 lelong x \b, %d x
  807. >>22 lelong x %d x
  808. # number of bits per pixel (color depth); found 16 32
  809. >>28 leshort x %d
  810. # x, y coordinates of the hotspot; should be zero for Windows variant
  811. >>6 uleshort >0 \b, hotspot %ux
  812. >>>8 uleshort x \b%u
  813. # cbSize; size of file like: 4E 7F46 131DE 14046h
  814. >>2 ulelong x \b, cbSize %u
  815. #>>2 ulelong x \b, cbSize 0x%x
  816. # offBits; offset to bitmap data like: 46h
  817. >>10 ulelong x \b, bits offset %u
  818. #>>10 ulelong x \b, bits offset 0x%x
  819. >14 lelong 40
  820. # jump 4 bytes before end of file/header to skip fmt-116-signature-id-118.dib
  821. # broken for large bitmaps
  822. #>>(2.l-4) ulong x PC bitmap, Windows 3.x format
  823. >>14 lelong 40 PC bitmap, Windows 3.x format
  824. !:mime image/bmp
  825. !:apple ????BMPp
  826. >>>18 lelong x \b, %d x
  827. >>>22 lelong x %d
  828. # 320 x 400 https://en.wikipedia.org/wiki/LOGO.SYS
  829. >>>18 ulequad =0x0000019000000140 x
  830. !:ext bmp/sys
  831. >>>18 ulequad !0x0000019000000140
  832. # compression method 2~RLE 4-bit/pixel implies also extension rle
  833. >>>>30 ulelong 2 x
  834. !:ext bmp/rle
  835. # not RLE compressed and not 320x400 dimension
  836. >>>>30 default x
  837. # "small" dimensions like: 14x15 15x16 16x14 16x16 32x32
  838. # https://en.wikipedia.org/wiki/Favicon
  839. >>>>>18 ulequad&0xffFFffC0ffFFffC0 =0 x
  840. # https://www.politi-kdigital.de/favicon.ico
  841. # http://forum.rpc1.org/favicon.ico
  842. !:ext bmp/ico
  843. # "big" dimensions > 63
  844. >>>>>18 default x x
  845. !:ext bmp
  846. # number of bits per pixel (color depth); found 1 2 4 8 16 24 32
  847. >>>28 leshort x %d
  848. # x, y coordinates of the hotspot; there is no hotspot in bitmaps, so values 0
  849. #>>>6 uleshort >0 \b, hotspot %ux
  850. #>>>>8 uleshort x \b%u
  851. # number of color planes (must be 1), except badplanes.bmp for testing
  852. #>>>26 uleshort >1 \b, %u color planes
  853. # compression method: 0~no 1~RLE 8-bit/pixel 2~RLE 4-bit/pixel 3~Huffman 1D 6~RGBA bit field masks
  854. #>>>30 ulelong 3 \b, Huffman 1D compression
  855. >>>30 ulelong >0 \b, %u compression
  856. # image size is the size of raw bitmap; a dummy 0 can be given for BI_RGB bitmaps
  857. >>>34 ulelong >0 \b, image size %u
  858. # horizontal and vertical resolution of the image (pixel per metre, signed integer)
  859. >>>38 lelong >0 \b, resolution %d x
  860. >>>>42 lelong x %d px/m
  861. # number of colors in palette 16 256, or 0 to default to 2**n
  862. #>>>46 ulelong >0 \b, %u colors
  863. # number of important colors used, or 0 when every color is important
  864. >>>50 ulelong >0 \b, %u important colors
  865. # cbSize; often size of file
  866. >>>2 ulelong x \b, cbSize %u
  867. #>>>2 ulelong x \b, cbSize %#x
  868. # offBits; offset to bitmap data like 36h 76h BEh 236h 406h 436h 4E6h
  869. >>>10 ulelong x \b, bits offset %u
  870. #>>>10 ulelong x \b, bits offset %#x
  871. #>>>(10.l) ubequad !0 \b, bits %#16.16llxd
  872. >14 lelong 124 PC bitmap, Windows 98/2000 and newer format
  873. !:mime image/bmp
  874. !:ext bmp
  875. >>18 lelong x \b, %d x
  876. >>22 lelong x %d x
  877. # color planes; must be 1
  878. #>>>26 uleshort >1 \b, %u color planes
  879. # number of bits per pixel (color depth); found 4 8 16 24 32 1 (fmt-119-signature-id-121.bmp) 0 (rgb24jpeg.bmp rgb24png.bmp)
  880. >>28 leshort x %d
  881. # x, y coordinates of the hotspot; should be zero for Windows variant
  882. >>6 leshort >0 \b, hotspot %ux
  883. >>>8 leshort x \b%u
  884. # cbSize; size of file like: 8E AA 48A 999 247A 4F02 7F8A 3F88E B216E 1D4C8A 100008A
  885. >>2 ulelong x \b, cbSize %u
  886. #>>2 ulelong x \b, cbSize 0x%x
  887. # offBits; offset to bitmap data like: 8A 47A ABABABAB (fmt-119-signature-id-121.bmp)
  888. >>10 ulelong x \b, bits offset %u
  889. #>>10 ulelong x \b, bits offset 0x%x
  890. >14 lelong 108 PC bitmap, Windows 95/NT4 and newer format
  891. !:mime image/bmp
  892. !:ext bmp
  893. >>18 lelong x \b, %d x
  894. >>22 lelong x %d x
  895. # number of bits per pixel (color depth); found 8 24 32
  896. >>28 leshort x %d
  897. # x, y coordinates of the hotspot; should be zero for Windows variant
  898. >>6 leshort >0 \b, hotspot %ux
  899. >>>8 leshort x \b%u
  900. # cbSize; size of file like: 82 8A 9A 9F86 1E07A 3007A 88B7A C007A
  901. >>2 ulelong x \b, cbSize %u
  902. #>>2 ulelong x \b, cbSize 0x%x
  903. # offBits; offset to bitmap data like: 7A 7E 46A
  904. >>10 ulelong x \b, bits offset %u
  905. #>>10 ulelong x \b, bits offset 0x%x
  906. # Update: Joerg Jenderek
  907. # URL: http://fileformats.archiveteam.org/wiki/OS/2_Icon
  908. # Reference: http://www.fileformat.info
  909. # /format/os2bmp/spec/902d5c253f2a43ada39c2b81034f27fd/view.htm
  910. # Note: verified by command like `deark -l -d3 OS2MEMU.ICO`
  911. 0 string IC
  912. # skip Lotus smart icon *.smi by looking for valid hotspot coordinates
  913. >6 ulelong&0xFF00FF00 =0 OS/2 icon
  914. # jump 4 bytes before end of header/file and test for accessibility
  915. #>>(2.l-4) ubelong x End of header is OK!
  916. !:mime image/x-os2-ico
  917. !:ext ico
  918. # cbSize; size of header or file in bytes like 1ah 120h 420h
  919. >>2 ulelong x \b, cbSize %u
  920. # xHotspot, yHotspot; coordinates of the hotspot for icons like 16 32
  921. >>6 uleshort x \b, hotspot %ux
  922. >>8 uleshort x \b%u
  923. # offBits; offset in bytes to the beginning of the bit-map pel data like 20h
  924. >>10 ulelong x \b, bits offset %u
  925. #>>(10.l) ubequad x \b, bits %#16.16llx
  926. #0 string PI PC pointer image data
  927. #0 string CI PC color icon data
  928. 0 string CI
  929. # test also for valid dib header sizes 12 or 64
  930. >14 ulelong <65 OS/2
  931. # test also for valid hotspot coordinates
  932. #>>6 ulelong&0xFE00FE00 =0 OS/2
  933. !:mime image/x-os2-ico
  934. !:ext ico
  935. >>14 ulelong 12 1.x color icon
  936. # image width and height fields are unsigned integers for OS/2
  937. >>>18 uleshort x %u x
  938. # stored height = 2 * real height
  939. >>>20 uleshort/2 x %u
  940. # number of bits per pixel (color depth). Typical 32 24 16 8 4 but only 1 found
  941. >>>24 uleshort >1 x %u
  942. # color planes; must be 1
  943. #>>>22 uleshort >1 \b, %u color planes
  944. >>14 ulelong 64 2.x color icon
  945. # image width and height
  946. >>>18 ulelong x %u x
  947. # stored height = 2 * real height
  948. >>>22 ulelong/2 x %u
  949. # number of bits per pixel (color depth). only 1 found
  950. >>>28 uleshort >1 x %u
  951. #>>>26 uleshort >1 \b, %u color planes
  952. # compression method: 0~no 3~Huffman 1D
  953. >>>30 ulelong 3 \b, Huffman 1D compression
  954. #>>>30 ulelong >0 \b, %u compression
  955. # xHotspot, yHotspot; coordinates of the hotspot like 0 1 16 20 32 33 63 64
  956. >>6 uleshort x \b, hotspot %ux
  957. >>8 uleshort x \b%u
  958. # cbSize; size of header or maybe file in bytes like 1Ah 4Eh 84Eh
  959. >>2 ulelong x \b, cbSize %u
  960. #>>2 ulelong x \b, cbSize %x
  961. # offBits; offset to bitmap data (pixel array) like E4h 3Ah 66h 6Ah 33Ah 4A4h
  962. >>10 ulelong x \b, bits offset %u
  963. #>>10 ulelong x \b, bits offset %#x
  964. #>>(10.l) ubequad !0 \b, bits %#16.16llx
  965. # dib header size: 12~Ch~OS/2 1.x 64~40h~OS/2 2.x
  966. #>>14 ulelong x \b, dib header size %u
  967. #0 string CP PC color pointer image data
  968. # URL: http://fileformats.archiveteam.org/wiki/OS/2_Pointer
  969. # Reference: http://www.fileformat.info/format/os2bmp/egff.htm
  970. 0 string CP
  971. # skip many Corel Photo-Paint image "CPT9FILE" by checking for positive bits offset
  972. >10 ulelong >0
  973. # skip CPU-Z Report by checking for valid dib header sizes 12 or 64
  974. >>14 ulelong =12
  975. >>>0 use os2-ptr
  976. >>14 ulelong =64
  977. >>>0 use os2-ptr
  978. # display information of OS/2 pointer bitmaps
  979. 0 name os2-ptr
  980. >14 ulelong x OS/2
  981. # http://extension.nirsoft.net/PTR
  982. !:mime image/x-ibm-pointer
  983. !:ext ptr
  984. >>14 ulelong 12 1.x color pointer
  985. # image width and height fields are unsigned integers for OS/2
  986. >>>18 uleshort x %u x
  987. # stored height = 2 * real height
  988. >>>20 uleshort/2 x %u
  989. # number of bits per pixel (color depth). Typical 32 24 16 8 4 but only 1 found
  990. >>>24 uleshort >1 x %u
  991. # color planes; must be 1
  992. #>>>22 uleshort >1 \b, %u color planes
  993. >>14 ulelong 64 2.x color pointer
  994. # image width and height
  995. >>>18 ulelong x %u x
  996. # stored height = 2 * real height
  997. >>>22 ulelong/2 x %u
  998. # number of bits per pixel (color depth). only 1 found
  999. >>>28 uleshort >1 x %u
  1000. #>>>26 uleshort >1 \b, %u color planes
  1001. # compression method: 0~no 3~Huffman 1D
  1002. >>>30 ulelong 3 \b, Huffman 1D compression
  1003. #>>>30 ulelong >0 \b, %u compression
  1004. # xHotspot, yHotspot; coordinates of the hotspot like 0 3 4 8 15 16 23 27 31
  1005. >>6 uleshort x \b, hotspot %ux
  1006. >>8 uleshort x \b%u
  1007. # cbSize; size of header or maybe file in bytes like 1Ah 4Eh
  1008. >>2 ulelong x \b, cbSize %u
  1009. #>>2 ulelong x \b, cbSize %x
  1010. # offBits; offset to bitmap data (pixel array) like 6Ah A4h E4h 4A4h
  1011. >>10 ulelong x \b, bits offset %u
  1012. #>>10 ulelong x \b, bits offset %#x
  1013. #>>(10.l) ubequad !0 \b, bits %#16.16llx
  1014. # dib header size: 12~Ch~OS/2 1.x 64~40h~OS/2 2.x
  1015. #>>14 ulelong x \b, dib header size %u
  1016. # Conflicts with other entries [BABYL]
  1017. # URL: http://fileformats.archiveteam.org/wiki/BMP#OS.2F2_Bitmap_Array
  1018. # Note: container for OS/2 icon "IC", color icon "CI", color pointer "CP" or bitmap "BM"
  1019. #0 string BA PC bitmap array data
  1020. 0 string BA
  1021. # skip old Emacs RMAIL BABYL ./mail.news by checking for low header size
  1022. >2 ulelong <0x004c5942 OS/2 graphic array
  1023. !:mime image/x-os2-graphics
  1024. #!:apple ????BMPf
  1025. # cbSize; size of header like 28h 5Ch
  1026. >>2 ulelong x \b, cbSize %u
  1027. #>>2 ulelong x \b, cbSize %#x
  1028. # offNext; offset to data like 0 48h F2h 4Eh 64h C6h D2h D6h DAh E6h EAh 348h
  1029. >>6 ulelong >0 \b, data offset %u
  1030. #>>6 ulelong >0 \b, data offset %#x
  1031. #>>(6.l) ubequad !0 \b, data %#16.16llx
  1032. # dimensions of the intended device like 640 x 480 for VGA or 1024 x 768
  1033. >>10 uleshort >0 \b, display %u
  1034. >>>12 uleshort >0 x %u
  1035. # usType of first array element
  1036. #>>14 string x \b, usType %2.2s
  1037. # 1 space char after "1st"
  1038. # no *.bga examples found https://www.openwith.org/file-extensions/bga/1342
  1039. >>14 string BM \b; 1st
  1040. !:ext bmp/bga
  1041. >>14 string CI \b; 1st
  1042. !:ext ico
  1043. >>14 string CP \b; 1st
  1044. !:ext ico
  1045. >>14 string IC \b; 1st
  1046. !:ext ico
  1047. # no white-black pointer found
  1048. #>>14 string PT \b; 1st
  1049. #!:ext
  1050. >>14 indirect x
  1051. # XPM icons (Greg Roelofs, newt@uchicago.edu)
  1052. 0 search/1 /*\ XPM\ */ X pixmap image text
  1053. !:mime image/x-xpmi
  1054. # Utah Raster Toolkit RLE images (janl@ifi.uio.no)
  1055. 0 leshort 0xcc52 RLE image data,
  1056. >6 leshort x %d x
  1057. >8 leshort x %d
  1058. >2 leshort >0 \b, lower left corner: %d
  1059. >4 leshort >0 \b, lower right corner: %d
  1060. >10 byte&0x1 =0x1 \b, clear first
  1061. >10 byte&0x2 =0x2 \b, no background
  1062. >10 byte&0x4 =0x4 \b, alpha channel
  1063. >10 byte&0x8 =0x8 \b, comment
  1064. >11 byte >0 \b, %d color channels
  1065. >12 byte >0 \b, %d bits per pixel
  1066. >13 byte >0 \b, %d color map channels
  1067. # image file format (Robert Potter, potter@cs.rochester.edu)
  1068. 0 string Imagefile\ version- iff image data
  1069. # this adds the whole header (inc. version number), informative but longish
  1070. >10 string >\0 %s
  1071. # Sun raster images, from Daniel Quinlan (quinlan@yggdrasil.com)
  1072. 0 belong 0x59a66a95 Sun raster image data
  1073. >4 belong >0 \b, %d x
  1074. >8 belong >0 %d,
  1075. >12 belong >0 %d-bit,
  1076. #>16 belong >0 %d bytes long,
  1077. >20 belong 0 old format,
  1078. #>20 belong 1 standard,
  1079. >20 belong 2 compressed,
  1080. >20 belong 3 RGB,
  1081. >20 belong 4 TIFF,
  1082. >20 belong 5 IFF,
  1083. >20 belong 0xffff reserved for testing,
  1084. >24 belong 0 no colormap
  1085. >24 belong 1 RGB colormap
  1086. >24 belong 2 raw colormap
  1087. #>28 belong >0 colormap is %d bytes long
  1088. # SGI image file format, from Daniel Quinlan (quinlan@yggdrasil.com)
  1089. #
  1090. # See
  1091. # http://reality.sgi.com/grafica/sgiimage.html
  1092. #
  1093. 0 beshort 474 SGI image data
  1094. #>2 byte 0 \b, verbatim
  1095. >2 byte 1 \b, RLE
  1096. #>3 byte 1 \b, normal precision
  1097. >3 byte 2 \b, high precision
  1098. >4 beshort x \b, %d-D
  1099. >6 beshort x \b, %d x
  1100. >8 beshort x %d
  1101. >10 beshort x \b, %d channel
  1102. >10 beshort !1 \bs
  1103. >80 string >0 \b, "%s"
  1104. 0 string IT01 FIT image data
  1105. >4 belong x \b, %d x
  1106. >8 belong x %d x
  1107. >12 belong x %d
  1108. #
  1109. 0 string IT02 FIT image data
  1110. >4 belong x \b, %d x
  1111. >8 belong x %d x
  1112. >12 belong x %d
  1113. #
  1114. 2048 string PCD_IPI Kodak Photo CD image pack file
  1115. >0xe02 byte&0x03 0x00 , landscape mode
  1116. >0xe02 byte&0x03 0x01 , portrait mode
  1117. >0xe02 byte&0x03 0x02 , landscape mode
  1118. >0xe02 byte&0x03 0x03 , portrait mode
  1119. 0 string PCD_OPA Kodak Photo CD overview pack file
  1120. # FITS format. Jeff Uphoff <juphoff@tarsier.cv.nrao.edu>
  1121. # FITS is the Flexible Image Transport System, the de facto standard for
  1122. # data and image transfer, storage, etc., for the astronomical community.
  1123. # (FITS floating point formats are big-endian.)
  1124. 0 string SIMPLE\ \ = FITS image data
  1125. !:mime image/fits
  1126. !:ext fits/fts
  1127. >109 string 8 \b, 8-bit, character or unsigned binary integer
  1128. >108 string 16 \b, 16-bit, two's complement binary integer
  1129. >107 string \ 32 \b, 32-bit, two's complement binary integer
  1130. >107 string -32 \b, 32-bit, floating point, single precision
  1131. >107 string -64 \b, 64-bit, floating point, double precision
  1132. # other images
  1133. 0 string This\ is\ a\ BitMap\ file Lisp Machine bit-array-file
  1134. # From SunOS 5.5.1 "/etc/magic" - appeared right before Sun raster image
  1135. # stuff.
  1136. #
  1137. 0 beshort 0x1010 PEX Binary Archive
  1138. # DICOM medical imaging data
  1139. # URL: https://en.wikipedia.org/wiki/DICOM#Data_format
  1140. # Note: "dcm" is the official file name extension
  1141. # XnView mention also "dc3" and "acr" as file name extension
  1142. 128 string DICM DICOM medical imaging data
  1143. !:mime application/dicom
  1144. !:ext dcm/dicom/dic
  1145. # XWD - X Window Dump file.
  1146. # As described in /usr/X11R6/include/X11/XWDFile.h
  1147. # used by the xwd program.
  1148. # Bradford Castalia, idaeim, 1/01
  1149. # updated by Adam Buchbinder, 2/09
  1150. # The following assumes version 7 of the format; the first long is the length
  1151. # of the header, which is at least 25 4-byte longs, and the one at offset 8
  1152. # is a constant which is always either 1 or 2. Offset 12 is the pixmap depth,
  1153. # which is a maximum of 32.
  1154. 0 belong >100
  1155. >8 belong <3
  1156. >>12 belong <33
  1157. >>>4 belong 7 XWD X Window Dump image data
  1158. !:mime image/x-xwindowdump
  1159. >>>>100 string >\0 \b, "%s"
  1160. >>>>16 belong x \b, %dx
  1161. >>>>20 belong x \b%dx
  1162. >>>>12 belong x \b%d
  1163. # PDS - Planetary Data System
  1164. # These files use Parameter Value Language in the header section.
  1165. # Unfortunately, there is no certain magic, but the following
  1166. # strings have been found to be most likely.
  1167. 0 string NJPL1I00 PDS (JPL) image data
  1168. 2 string NJPL1I PDS (JPL) image data
  1169. 0 string CCSD3ZF PDS (CCSD) image data
  1170. 2 string CCSD3Z PDS (CCSD) image data
  1171. 0 string PDS_ PDS image data
  1172. 0 string LBLSIZE= PDS (VICAR) image data
  1173. # pM8x: ATARI STAD compressed bitmap format
  1174. #
  1175. # from Oskar Schirmer <schirmer@scara.com> Feb 2, 2001
  1176. # p M 8 5/6 xx yy zz data...
  1177. # Atari ST STAD bitmap is always 640x400, bytewise runlength compressed.
  1178. # bytes either run horizontally (pM85) or vertically (pM86). yy is the
  1179. # most frequent byte, xx and zz are runlength escape codes, where xx is
  1180. # used for runs of yy.
  1181. #
  1182. 0 string pM85 Atari ST STAD bitmap image data (hor)
  1183. >5 byte 0x00 (white background)
  1184. >5 byte 0xFF (black background)
  1185. 0 string pM86 Atari ST STAD bitmap image data (vert)
  1186. >5 byte 0x00 (white background)
  1187. >5 byte 0xFF (black background)
  1188. # From: Alex Myczko <alex@aiei.ch>
  1189. # https://www.atarimax.com/jindroush.atari.org/afmtatr.html
  1190. 0 leshort 0x0296 Atari ATR image
  1191. # From: Joerg Jenderek
  1192. # URL: http://fileformats.archiveteam.org/wiki/ImageLab/PrintTechnic
  1193. # Reference: http://mark0.net/download/triddefs_xml.7z/defs/b/bitmap-b_w.trid.xml
  1194. # Note: called "ImageLab bitmap" by TrID
  1195. # verfied by XnView `nconvert -fullinfo "MAEDCHEN.B&W"`
  1196. 0 string B&W256 ImageLab bitmap
  1197. !:mime image/x-ilab
  1198. # https://www.xnview.com/de/image_formats/
  1199. # GRR: add char & inside parse_ext in ../../src/apprentice.c to avoid in file version 5.40 error like:
  1200. # Magdir\images, 1090: Warning: EXTENSION type ` b_w/b&w' has bad char '&'
  1201. !:ext b_w/b&w
  1202. # Width
  1203. >6 ubeshort x \b, %u
  1204. # Height
  1205. >8 ubeshort x x %u
  1206. # XXX:
  1207. # This is bad magic 0x5249 == 'RI' conflicts with RIFF and other
  1208. # magic.
  1209. # SGI RICE image file <mpruett@sgi.com>
  1210. #0 beshort 0x5249 RICE image
  1211. #>2 beshort x v%d
  1212. #>4 beshort x (%d x
  1213. #>6 beshort x %d)
  1214. #>8 beshort 0 8 bit
  1215. #>8 beshort 1 10 bit
  1216. #>8 beshort 2 12 bit
  1217. #>8 beshort 3 13 bit
  1218. #>10 beshort 0 4:2:2
  1219. #>10 beshort 1 4:2:2:4
  1220. #>10 beshort 2 4:4:4
  1221. #>10 beshort 3 4:4:4:4
  1222. #>12 beshort 1 RGB
  1223. #>12 beshort 2 CCIR601
  1224. #>12 beshort 3 RP175
  1225. #>12 beshort 4 YUV
  1226. # PCX image files
  1227. # From: Dan Fandrich <dan@coneharvesters.com>
  1228. # updated by Joerg Jenderek at Feb 2013 by https://de.wikipedia.org/wiki/PCX
  1229. # https://web.archive.org/web/20100206055706/http://www.qzx.com/pc-gpe/pcx.txt
  1230. # GRR: original test was still too general as it catches xbase examples T5.DBT,T6.DBT with 0xa000000
  1231. # 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
  1232. 0 ubelong&0xffF8fe00 0x0a000000
  1233. # for PCX bit depth > 0
  1234. >3 ubyte >0
  1235. # test for valid versions
  1236. >>1 ubyte <6
  1237. >>>1 ubyte !1 PCX
  1238. !:mime image/x-pcx
  1239. #!:mime image/pcx
  1240. >>>>1 ubyte 0 ver. 2.5 image data
  1241. >>>>1 ubyte 2 ver. 2.8 image data, with palette
  1242. >>>>1 ubyte 3 ver. 2.8 image data, without palette
  1243. >>>>1 ubyte 4 for Windows image data
  1244. >>>>1 ubyte 5 ver. 3.0 image data
  1245. >>>>4 uleshort x bounding box [%d,
  1246. >>>>6 uleshort x %d] -
  1247. >>>>8 uleshort x [%d,
  1248. >>>>10 uleshort x %d],
  1249. >>>>65 ubyte >1 %d planes each of
  1250. >>>>3 ubyte x %d-bit
  1251. >>>>68 byte 1 colour,
  1252. >>>>68 byte 2 grayscale,
  1253. # this should not happen
  1254. >>>>68 default x image,
  1255. >>>>12 leshort >0 %d x
  1256. >>>>>14 uleshort x %d dpi,
  1257. >>>>2 byte 0 uncompressed
  1258. >>>>2 byte 1 RLE compressed
  1259. # Adobe Photoshop
  1260. # From: Asbjoern Sloth Toennesen <asbjorn@lila.io>
  1261. # URL: http://fileformats.archiveteam.org/wiki/PSD
  1262. # Reference: https://www.adobe.com/devnet-apps/photoshop/fileformatashtml/
  1263. # Note: verfied by XnView `nconvert -fullinfo *.psd *.psb *.pdd`
  1264. # and ImageMagick `identify -verbose *.pdd`
  1265. 0 string 8BPS
  1266. # skip DROID x-fmt-92-signature-id-277.psd by checking valid width
  1267. >18 belong >0 Adobe Photoshop
  1268. !:mime image/vnd.adobe.photoshop
  1269. !:apple ????8BPS
  1270. # version: always equal to 1, but 2 for PSB
  1271. >>4 beshort 1
  1272. # URL: http://fileformats.archiveteam.org/wiki/PhotoDeluxe
  1273. # EXTRAS/PHOTOS/DEMOPIX/ORIGINAL.PDD
  1274. >>>34 search/0xC0d7 PHUT Image (PhotoDeluxe)
  1275. !:ext pdd
  1276. >>>34 default x Image
  1277. !:ext psd
  1278. # URL: http://fileformats.archiveteam.org/wiki/PSB
  1279. >>4 beshort 2 Image (PSB)
  1280. !:ext psb
  1281. # width in pixels: 1-30000 1-300000 for PSB
  1282. >>18 belong x \b, %d x
  1283. >>14 belong x %d,
  1284. # The color mode; 0~Bitmap 1~Grayscale 2~Indexed 3~RGB 4~CMYK 7~Multichannel 9~Duotone 9~Lab
  1285. >>24 beshort 0 bitmap
  1286. >>24 beshort 1 grayscale
  1287. # the number of channels; range is 1 to 56
  1288. >>>12 beshort 2 with alpha
  1289. >>24 beshort 2 indexed
  1290. >>24 beshort 3 RGB
  1291. >>>12 beshort 4 \bA
  1292. >>24 beshort 4 CMYK
  1293. >>>12 beshort 5 \bA
  1294. >>24 beshort 7 multichannel
  1295. >>24 beshort 8 duotone
  1296. >>24 beshort 9 lab
  1297. >>12 beshort > 1
  1298. >>>12 beshort x \b, %dx
  1299. >>12 beshort 1 \b,
  1300. >>22 beshort x %d-bit channel
  1301. >>12 beshort > 1 \bs
  1302. # 6 reserved bytes; must be zero, but spaces inside ImageMagick input.psd
  1303. # https://download.imagemagick.org/ImageMagick/download/ImageMagick-7.0.11-11.zip
  1304. # ImageMagick-7.0.11-11\PerlMagick\t\input.psd
  1305. >>6 bequad&0xFFffFFffFFff0000 !0 \b, at offset 6
  1306. >>>6 belong x 0x%8.8x
  1307. >>>6 beshort x \b%4.4x
  1308. # XV thumbnail indicator (ThMO)
  1309. # URL: https://en.wikipedia.org/wiki/Xv_(software)
  1310. # Reference: http://fileformats.archiveteam.org/wiki/XV_thumbnail
  1311. # Update: Joerg Jenderek
  1312. 0 string P7\ 332 XV thumbnail image data
  1313. #0 string P7\ 332 XV "thumbnail file" (icon) data
  1314. !:mime image/x-xv-thumbnail
  1315. # thumbnail .xvpic/foo.bar for graphic foo.bar
  1316. !:ext p7/gif/tif/xpm/jpg
  1317. # NITF is defined by United States MIL-STD-2500A
  1318. 0 string NITF National Imagery Transmission Format
  1319. >25 string >\0 dated %.14s
  1320. # GEM Image: Version 1, Headerlen 8 (Wolfram Kleff)
  1321. # Format variations from: Bernd Nuernberger <bernd.nuernberger@web.de>
  1322. # Update: Joerg Jenderek
  1323. # See http://fileformats.archiveteam.org/wiki/GEM_Raster
  1324. # For variations, also see:
  1325. # https://www.seasip.info/Gem/ff_img.html (Ventura)
  1326. # http://www.atari-wiki.com/?title=IMG_file (XIMG, STTT)
  1327. # http://www.fileformat.info/format/gemraster/spec/index.htm (XIMG, STTT)
  1328. # http://sylvana.net/1stguide/1STGUIDE.ENG (TIMG)
  1329. 0 beshort 0x0001
  1330. # header_size
  1331. >2 beshort 0x0008
  1332. >>0 use gem_info
  1333. >2 beshort 0x0009
  1334. >>0 use gem_info
  1335. # no example for NOSIG
  1336. >2 beshort 24
  1337. >>0 use gem_info
  1338. # no example for HYPERPAINT
  1339. >2 beshort 25
  1340. >>0 use gem_info
  1341. 16 string XIMG\0
  1342. >0 use gem_info
  1343. # no example
  1344. 16 string STTT\0\x10
  1345. >0 use gem_info
  1346. # no example or description
  1347. 16 string TIMG\0
  1348. >0 use gem_info
  1349. 0 name gem_info
  1350. # version is 2 for some XIMG and 1 for all others
  1351. >0 beshort <0x0003 GEM
  1352. # https://www.snowstone.org.uk/riscos/mimeman/mimemap.txt
  1353. !:mime image/x-gem
  1354. # header_size 24 25 27 59 779 words for colored bitmaps
  1355. >>2 beshort >9
  1356. >>>16 string STTT\0\x10 STTT
  1357. >>>16 string TIMG\0 TIMG
  1358. # HYPERPAINT or NOSIG variant
  1359. >>>16 string \0\x80
  1360. >>>>2 beshort =24 NOSIG
  1361. >>>>2 beshort !24 HYPERPAINT
  1362. # NOSIG or XIMG variant
  1363. >>>16 default x
  1364. >>>>16 string !XIMG\0 NOSIG
  1365. >>16 string =XIMG\0 XIMG Image data
  1366. !:ext img/ximg
  1367. # to avoid Warning: Current entry does not yet have a description for adding a EXTENSION type
  1368. >>16 string !XIMG\0 Image data
  1369. !:ext img
  1370. # header_size is 9 for Ventura files and 8 for other GEM Paint files
  1371. >>2 beshort 9 (Ventura)
  1372. #>>2 beshort 8 (Paint)
  1373. >>12 beshort x %d x
  1374. >>14 beshort x %d,
  1375. # 1 4 8
  1376. >>4 beshort x %d planes,
  1377. # in tenths of a millimetre
  1378. >>8 beshort x %d x
  1379. >>10 beshort x %d pixelsize
  1380. # pattern_size 1-8. 2 for GEM Paint
  1381. >>6 beshort !2 \b, pattern size %d
  1382. # GEM Metafile (Wolfram Kleff)
  1383. 0 lelong 0x0018FFFF GEM Metafile data
  1384. >4 leshort x version %d
  1385. #
  1386. # SMJPEG. A custom Motion JPEG format used by Loki Entertainment
  1387. # Software Torbjorn Andersson <d91tan@Update.UU.SE>.
  1388. #
  1389. 0 string \0\nSMJPEG SMJPEG
  1390. >8 belong x %d.x data
  1391. # According to the specification you could find any number of _TXT
  1392. # headers here, but I can't think of any way of handling that. None of
  1393. # the SMJPEG files I tried it on used this feature. Even if such a
  1394. # file is encountered the output should still be reasonable.
  1395. >16 string _SND \b,
  1396. >>24 beshort >0 %d Hz
  1397. >>26 byte 8 8-bit
  1398. >>26 byte 16 16-bit
  1399. >>28 string NONE uncompressed
  1400. # >>28 string APCM ADPCM compressed
  1401. >>27 byte 1 mono
  1402. >>28 byte 2 stereo
  1403. # Help! Isn't there any way to avoid writing this part twice?
  1404. >>32 string _VID \b,
  1405. # >>>48 string JFIF JPEG
  1406. >>>40 belong >0 %d frames
  1407. >>>44 beshort >0 (%d x
  1408. >>>46 beshort >0 %d)
  1409. >16 string _VID \b,
  1410. # >>32 string JFIF JPEG
  1411. >>24 belong >0 %d frames
  1412. >>28 beshort >0 (%d x
  1413. >>30 beshort >0 %d)
  1414. 0 string Paint\ Shop\ Pro\ Image\ File Paint Shop Pro Image File
  1415. # taken from fkiss: (<yav@mte.biglobe.ne.jp> ?)
  1416. 0 string KiSS KISS/GS
  1417. >4 byte 16 color
  1418. >>5 byte x %d bit
  1419. >>8 leshort x %d colors
  1420. >>10 leshort x %d groups
  1421. >4 byte 32 cell
  1422. >>5 byte x %d bit
  1423. >>8 leshort x %d x
  1424. >>10 leshort x %d
  1425. >>12 leshort x +%d
  1426. >>14 leshort x +%d
  1427. # Webshots (www.webshots.com), by John Harrison
  1428. 0 string C\253\221g\230\0\0\0 Webshots Desktop .wbz file
  1429. # Hercules DASD image files
  1430. # From Jan Jaeger <jj@septa.nl>
  1431. 0 string CKD_P370 Hercules CKD DASD image file
  1432. >8 long x \b, %d heads per cylinder
  1433. >12 long x \b, track size %d bytes
  1434. >16 byte x \b, device type 33%2.2X
  1435. 0 string CKD_C370 Hercules compressed CKD DASD image file
  1436. >8 long x \b, %d heads per cylinder
  1437. >12 long x \b, track size %d bytes
  1438. >16 byte x \b, device type 33%2.2X
  1439. 0 string CKD_S370 Hercules CKD DASD shadow file
  1440. >8 long x \b, %d heads per cylinder
  1441. >12 long x \b, track size %d bytes
  1442. >16 byte x \b, device type 33%2.2X
  1443. # Squeak images and programs - etoffi@softhome.net
  1444. 0 string \146\031\0\0 Squeak image data
  1445. 0 search/1 'From\040Squeak Squeak program text
  1446. # partimage: file(1) magic for PartImage files (experimental, incomplete)
  1447. # Author: Hans-Joachim Baader <hjb@pro-linux.de>
  1448. 0 string PaRtImAgE-VoLuMe PartImage
  1449. >0x0020 string 0.6.1 file version %s
  1450. >>0x0060 lelong >-1 volume %d
  1451. #>>0x0064 8 byte identifier
  1452. #>>0x007c reserved
  1453. >>0x0200 string >\0 type %s
  1454. >>0x1400 string >\0 device %s,
  1455. >>0x1600 string >\0 original filename %s,
  1456. # Some fields omitted
  1457. >>0x2744 lelong 0 not compressed
  1458. >>0x2744 lelong 1 gzip compressed
  1459. >>0x2744 lelong 2 bzip2 compressed
  1460. >>0x2744 lelong >2 compressed with unknown algorithm
  1461. >0x0020 string >0.6.1 file version %s
  1462. >0x0020 string <0.6.1 file version %s
  1463. # DCX is multi-page PCX, using a simple header of up to 1024
  1464. # offsets for the respective PCX components.
  1465. # From: Joerg Wunsch <joerg_wunsch@uriah.heep.sax.de>
  1466. # Update: Joerg Jenderek
  1467. # URL: http://fileformats.archiveteam.org/wiki/DCX
  1468. 0 lelong 987654321 DCX multi-page
  1469. # http://www.nationalarchives.gov.uk/pronom/x-fmt/348
  1470. !:mime image/x-dcx
  1471. !:ext dcx
  1472. # The first file offset usually starts at file offset 0x1004
  1473. # print 1 space after 0x100? offset and then handles PCX images by ./images
  1474. >4 lelong x \b, at %#x
  1475. >(4.l) indirect x
  1476. # possible 2nd PCX image
  1477. #>8 lelong !0 \b, at %#x
  1478. #>>(8.l) indirect x
  1479. # possible 3rd PCX image
  1480. #>12 lelong !0 \b, at %#x
  1481. #>>(12.l) indirect x
  1482. # Simon Walton <simonw@matteworld.com>
  1483. # Kodak Cineon format for scanned negatives
  1484. # http://www.kodak.com/US/en/motion/support/dlad/
  1485. 0 lelong 0xd75f2a80 Cineon image data
  1486. >200 belong >0 \b, %d x
  1487. >204 belong >0 %d
  1488. # Bio-Rad .PIC is an image format used by microscope control systems
  1489. # and related image processing software used by biologists.
  1490. # From: Vebjorn Ljosa <vebjorn@ljosa.com>
  1491. # BOOL values are two-byte integers; use them to rule out false positives.
  1492. # https://web.archive.org/web/20050317223257/www.cs.ubc.ca/spider/ladic/text/biorad.txt
  1493. # Samples: https://www.loci.wisc.edu/software/sample-data
  1494. 14 leshort <2
  1495. >62 leshort <2
  1496. >>54 leshort 12345 Bio-Rad .PIC Image File
  1497. >>>0 leshort >0 %d x
  1498. >>>2 leshort >0 %d,
  1499. >>>4 leshort =1 1 image in file
  1500. >>>4 leshort >1 %d images in file
  1501. # From Jan "Yenya" Kasprzak <kas@fi.muni.cz>
  1502. # The description of *.mrw format can be found at
  1503. # http://www.dalibor.cz/minolta/raw_file_format.htm
  1504. 0 string \000MRM Minolta Dimage camera raw image data
  1505. # Summary: DjVu image / document
  1506. # Extension: .djvu
  1507. # Reference: http://djvu.org/docs/DjVu3Spec.djvu
  1508. # Submitted by: Stephane Loeuillet <stephane.loeuillet@tiscali.fr>
  1509. # Modified by (1): Abel Cheung <abelcheung@gmail.com>
  1510. 0 string AT&TFORM
  1511. >12 string DJVM DjVu multiple page document
  1512. !:mime image/vnd.djvu
  1513. >12 string DJVU DjVu image or single page document
  1514. !:mime image/vnd.djvu
  1515. >12 string DJVI DjVu shared document
  1516. !:mime image/vnd.djvu
  1517. >12 string THUM DjVu page thumbnails
  1518. !:mime image/vnd.djvu
  1519. # Originally by Marc Espie
  1520. # Modified by Robert Minsk <robertminsk at yahoo.com>
  1521. # https://www.openexr.com/openexrfilelayout.pdf
  1522. 0 lelong 20000630 OpenEXR image data,
  1523. !:mime image/x-exr
  1524. >4 lelong&0x000000ff x version %d,
  1525. >4 lelong ^0x00000200 storage: scanline
  1526. >4 lelong &0x00000200 storage: tiled
  1527. >8 search/0x1000 compression\0 \b, compression:
  1528. >>&16 byte 0 none
  1529. >>&16 byte 1 rle
  1530. >>&16 byte 2 zips
  1531. >>&16 byte 3 zip
  1532. >>&16 byte 4 piz
  1533. >>&16 byte 5 pxr24
  1534. >>&16 byte 6 b44
  1535. >>&16 byte 7 b44a
  1536. >>&16 byte 8 dwaa
  1537. >>&16 byte 9 dwab
  1538. >>&16 byte >9 unknown
  1539. >8 search/0x1000 dataWindow\0 \b, dataWindow:
  1540. >>&10 lelong x (%d
  1541. >>&14 lelong x %d)-
  1542. >>&18 lelong x \b(%d
  1543. >>&22 lelong x %d)
  1544. >8 search/0x1000 displayWindow\0 \b, displayWindow:
  1545. >>&10 lelong x (%d
  1546. >>&14 lelong x %d)-
  1547. >>&18 lelong x \b(%d
  1548. >>&22 lelong x %d)
  1549. >8 search/0x1000 lineOrder\0 \b, lineOrder:
  1550. >>&14 byte 0 increasing y
  1551. >>&14 byte 1 decreasing y
  1552. >>&14 byte 2 random y
  1553. >>&14 byte >2 unknown
  1554. # SMPTE Digital Picture Exchange Format, SMPTE DPX
  1555. #
  1556. # ANSI/SMPTE 268M-1994, SMPTE Standard for File Format for Digital
  1557. # Moving-Picture Exchange (DPX), v1.0, 18 February 1994
  1558. # Robert Minsk <robertminsk at yahoo.com>
  1559. # Modified by Harry Mallon <hjmallon at gmail.com>
  1560. 0 string SDPX DPX image data, big-endian,
  1561. !:mime image/x-dpx
  1562. >0 use dpx_info
  1563. 0 string XPDS DPX image data, little-endian,
  1564. !:mime image/x-dpx
  1565. >0 use \^dpx_info
  1566. 0 name dpx_info
  1567. >768 beshort <4
  1568. >>772 belong x %dx
  1569. >>776 belong x \b%d,
  1570. >768 beshort >3
  1571. >>776 belong x %dx
  1572. >>772 belong x \b%d,
  1573. >768 beshort 0 left to right/top to bottom
  1574. >768 beshort 1 right to left/top to bottom
  1575. >768 beshort 2 left to right/bottom to top
  1576. >768 beshort 3 right to left/bottom to top
  1577. >768 beshort 4 top to bottom/left to right
  1578. >768 beshort 5 top to bottom/right to left
  1579. >768 beshort 6 bottom to top/left to right
  1580. >768 beshort 7 bottom to top/right to left
  1581. # From: Tom Hilinski <tom.hilinski@comcast.net>
  1582. # https://www.unidata.ucar.edu/software/netcdf/
  1583. 0 string CDF\001 NetCDF Data Format data
  1584. # 64-bit offset netcdf Classic https://www.unidata.ucar.edu/software/netcdf/docs/file_format_specifications
  1585. 0 string CDF\002 NetCDF Data Format data (64-bit offset)
  1586. # From: Michael Liu
  1587. # https://en.wikipedia.org/wiki/Common_Data_Format
  1588. 0 belong 0xCDF30001 Common Data Format (Version 3 or later) data
  1589. !:mime application/x-cdf
  1590. 0 belong 0xCDF26002 Common Data Format (Version 2.6 or 2.7) data
  1591. !:mime application/x-cdf
  1592. 0 belong 0x0000FFFF Common Data Format (Version 2.5 or earlier) data
  1593. !:mime application/x-cdf
  1594. # Hierarchical Data Format, used to facilitate scientific data exchange
  1595. # specifications at http://hdf.ncsa.uiuc.edu/
  1596. # URL: http://fileformats.archiveteam.org/wiki/HDF
  1597. # https://en.wikipedia.org/wiki/Hierarchical_Data_Format
  1598. # Reference: https://portal.hdfgroup.org/download/attachments/52627880/HDF5_File_Format_Specification_Version-3.0.pdf
  1599. 0 belong 0x0e031301 Hierarchical Data Format (version 4) data
  1600. !:mime application/x-hdf
  1601. !:ext hdf/hdf4/h4
  1602. 0 string \211HDF\r\n\032\n Hierarchical Data Format (version 5) data
  1603. #!:mime application/x-hdf
  1604. !:mime application/x-hdf5
  1605. !:ext h5/hdf5/hdf/he5
  1606. 512 string \211HDF\r\n\032\n
  1607. # skip Matlab v5 mat-file testhdf5_7.4_GLNX86.mat handled by ./mathematica
  1608. >0 string !MATLAB Hierarchical Data Format (version 5) with 512 bytes user block
  1609. #!:mime application/x-hdf
  1610. !:mime application/x-hdf5
  1611. !:ext h5/hdf5/hdf/he5
  1612. 1024 string \211HDF\r\n\032\n Hierarchical Data Format (version 5) with 1k user block
  1613. #!:mime application/x-hdf
  1614. !:mime application/x-hdf5
  1615. !:ext h5/hdf5/hdf/he5
  1616. 2048 string \211HDF\r\n\032\n Hierarchical Data Format (version 5) with 2k user block
  1617. #!:mime application/x-hdf
  1618. !:mime application/x-hdf5
  1619. !:ext h5/hdf5/hdf/he5
  1620. 4096 string \211HDF\r\n\032\n Hierarchical Data Format (version 5) with 4k user block
  1621. #!:mime application/x-hdf
  1622. !:mime application/x-hdf5
  1623. !:ext h5/hdf5/hdf/he5
  1624. # From: Tobias Burnus <burnus@net-b.de>
  1625. # Xara (for a while: Corel Xara) is a graphic package, see
  1626. # http://www.xara.com/ for Windows and as GPL application for Linux
  1627. 0 string XARA\243\243 Xara graphics file
  1628. # From: Joerg Jenderek
  1629. # URL: http://fileformats.archiveteam.org/wiki/Corel_Gallery
  1630. # Reference: http://mark0.net/download/triddefs_xml.7z/defs/b/bmf-corel.trid.xml
  1631. # Note: called "Corel Binary Material Format" by TrID and
  1632. # "Corel Flow" by XnView
  1633. 0 string @CorelBMF\n\rCorel\040Corporation Corel GALLERY Clipart
  1634. !:mime image/x-corel-bmf
  1635. !:ext bmf
  1636. # https://www.cartesianinc.com/Tech/
  1637. # Reference: http://fileformats.archiveteam.org/wiki/Cartesian_Perceptual_Compression
  1638. 0 string CPC\262 Cartesian Perceptual Compression image
  1639. !:mime image/x-cpi
  1640. !:ext cpi/cpc
  1641. # From Albert Cahalan <acahalan@gmail.com>
  1642. # puredigital used it for the CVS disposable camcorder
  1643. #8 lelong 4 ZBM bitmap image data
  1644. #>4 leshort x %u x
  1645. #>6 leshort x %u
  1646. # From Albert Cahalan <acahalan@gmail.com>
  1647. # uncompressed 5:6:5 HighColor image for OLPC XO firmware icons
  1648. 0 string C565 OLPC firmware icon image data
  1649. >4 leshort x %u x
  1650. >6 leshort x %u
  1651. # Applied Images - Image files from Cytovision
  1652. # Gustavo Junior Alves <gjalves@gjalves.com.br>
  1653. 0 string \xce\xda\xde\xfa Cytovision Metaphases file
  1654. 0 string \xed\xad\xef\xac Cytovision Karyotype file
  1655. 0 string \x0b\x00\x03\x00 Cytovision FISH Probe file
  1656. 0 string \xed\xfe\xda\xbe Cytovision FLEX file
  1657. 0 string \xed\xab\xed\xfe Cytovision FLEX file
  1658. 0 string \xad\xfd\xea\xad Cytovision RATS file
  1659. # Wavelet Scalar Quantization format used in gray-scale fingerprint images
  1660. # From Tano M Fotang <mfotang@quanteq.com>
  1661. 0 string \xff\xa0\xff\xa8\x00 Wavelet Scalar Quantization image data
  1662. # Type: PCO B16 image files
  1663. # URL: http://www.pco.de/fileadmin/user_upload/db/download/MA_CWDCOPIE_0412b.pdf
  1664. # From: Florian Philipp <florian.philipp@binarywings.net>
  1665. # Extension: .b16
  1666. # Description: Pixel image format produced by PCO Camware, typically used
  1667. # together with PCO cameras.
  1668. # Note: Different versions exist for e.g. 8 bit and 16 bit images.
  1669. # Documentation is incomplete.
  1670. 0 string/b PCO- PCO B16 image data
  1671. >12 lelong x \b, %dx
  1672. >16 lelong x \b%d
  1673. >20 lelong 0 \b, short header
  1674. >20 lelong -1 \b, extended header
  1675. >>24 lelong 0 \b, grayscale
  1676. >>>36 lelong 0 linear LUT
  1677. >>>36 lelong 1 logarithmic LUT
  1678. >>>28 lelong x [%d
  1679. >>>32 lelong x \b,%d]
  1680. >>24 lelong 1 \b, color
  1681. >>>64 lelong 0 linear LUT
  1682. >>>64 lelong 1 logarithmic LUT
  1683. >>>40 lelong x r[%d
  1684. >>>44 lelong x \b,%d]
  1685. >>>48 lelong x g[%d
  1686. >>>52 lelong x \b,%d]
  1687. >>>56 lelong x b[%d
  1688. >>>60 lelong x \b,%d]
  1689. # Polar Monitor Bitmap (.pmb) used as logo for Polar Electro watches
  1690. # From: Markus Heidelberg <markus.heidelberg at web.de>
  1691. 0 string/t [BitmapInfo2] Polar Monitor Bitmap text
  1692. !:mime image/x-polar-monitor-bitmap
  1693. # From: Rick Richardson <rickrich@gmail.com>
  1694. # updated by: Joerg Jenderek
  1695. # URL: http://techmods.net/nuvi/
  1696. 0 string GARMIN\ BITMAP\ 01 Garmin Bitmap file
  1697. # extension is also used for
  1698. # Sony SRF raw image (image/x-sony-srf)
  1699. # SRF map
  1700. # Terragen Surface Map (https://www.planetside.co.uk/terragen)
  1701. # FileLocator Pro search criteria file (https://www.mythicsoft.com/filelocatorpro)
  1702. !:ext srf
  1703. #!:mime image/x-garmin-srf
  1704. # version 1.00,2.00,2.10,2.40,2.50
  1705. >0x2f string >0 \b, version %4.4s
  1706. # width (2880,2881,3240)
  1707. >0x55 uleshort >0 \b, %dx
  1708. # height (80,90)
  1709. >>0x53 uleshort x \b%d
  1710. # Type: Ulead Photo Explorer5 (.pe5)
  1711. # URL: http://www.jisyo.com/cgibin/view.cgi?EXT=pe5 (Japanese)
  1712. # From: Simon Horman <horms@debian.org>
  1713. 0 string IIO2H Ulead Photo Explorer5
  1714. # Type: X11 cursor
  1715. # URL: http://webcvs.freedesktop.org/mime/shared-mime-info/freedesktop.org.xml.in?view=markup
  1716. # From: Mathias Brodala <info@noctus.net>
  1717. 0 string Xcur X11 cursor
  1718. # Type: Olympus ORF raw images.
  1719. # URL: https://libopenraw.freedesktop.org/wiki/Olympus_ORF
  1720. # From: Adam Buchbinder <adam.buchbinder@gmail.com>
  1721. 0 string MMOR Olympus ORF raw image data, big-endian
  1722. !:mime image/x-olympus-orf
  1723. 0 string IIRO Olympus ORF raw image data, little-endian
  1724. !:mime image/x-olympus-orf
  1725. 0 string IIRS Olympus ORF raw image data, little-endian
  1726. !:mime image/x-olympus-orf
  1727. # Type: files used in modern AVCHD camcoders to store clip information
  1728. # Extension: .cpi
  1729. # From: Alexander Danilov <alexander.a.danilov@gmail.com>
  1730. 0 string HDMV0100 AVCHD Clip Information
  1731. # From: Adam Buchbinder <adam.buchbinder@gmail.com>
  1732. # URL: http://local.wasp.uwa.edu.au/~pbourke/dataformats/pic/
  1733. # Radiance HDR; usually has .pic or .hdr extension.
  1734. 0 string #?RADIANCE\n Radiance HDR image data
  1735. #!mime image/vnd.radiance
  1736. # From: Adam Buchbinder <adam.buchbinder@gmail.com>
  1737. # URL: https://www.mpi-inf.mpg.de/resources/pfstools/pfs_format_spec.pdf
  1738. # Used by the pfstools packages. The regex matches for the image size could
  1739. # probably use some work. The MIME type is made up; if there's one in
  1740. # actual common use, it should replace the one below.
  1741. 0 string PFS1\x0a PFS HDR image data
  1742. #!mime image/x-pfs
  1743. >1 regex [0-9]*\ \b, %s
  1744. >>1 regex \ [0-9]{4} \bx%s
  1745. # Type: Foveon X3F
  1746. # URL: https://www.photofo.com/downloads/x3f-raw-format.pdf
  1747. # From: Adam Buchbinder <adam.buchbinder@gmail.com>
  1748. # Note that the MIME type isn't defined anywhere that I can find; if
  1749. # there's a canonical type for this format, it should replace this one.
  1750. 0 string FOVb Foveon X3F raw image data
  1751. !:mime image/x-x3f
  1752. >6 leshort x \b, version %d.
  1753. >4 leshort x \b%d
  1754. >28 lelong x \b, %dx
  1755. >32 lelong x \b%d
  1756. # Paint.NET file
  1757. # From Adam Buchbinder <adam.buchbinder@gmail.com>
  1758. 0 string PDN3 Paint.NET image data
  1759. !:mime image/x-paintnet
  1760. # Not really an image.
  1761. # From: "Tano M. Fotang" <mfotang@quanteq.com>
  1762. 0 string \x46\x4d\x52\x00 ISO/IEC 19794-2 Format Minutiae Record (FMR)
  1763. # doc: https://www.shikino.co.jp/eng/products/images/FLOWER.jpg.zip
  1764. # example: https://www.shikino.co.jp/eng/products/images/FLOWER.wdp.zip
  1765. 90 bequad 0x574D50484F544F00 JPEG-XR Image
  1766. >98 byte&0x08 =0x08 \b, hard tiling
  1767. >99 byte&0x80 =0x80 \b, tiling present
  1768. >99 byte&0x40 =0x40 \b, codestream present
  1769. >99 byte&0x38 x \b, spatial xform=
  1770. >99 byte&0x38 0x00 \bTL
  1771. >99 byte&0x38 0x08 \bBL
  1772. >99 byte&0x38 0x10 \bTR
  1773. >99 byte&0x38 0x18 \bBR
  1774. >99 byte&0x38 0x20 \bBT
  1775. >99 byte&0x38 0x28 \bRB
  1776. >99 byte&0x38 0x30 \bLT
  1777. >99 byte&0x38 0x38 \bLB
  1778. >100 byte&0x80 =0x80 \b, short header
  1779. >>102 beshort+1 x \b, %d
  1780. >>104 beshort+1 x \bx%d
  1781. >100 byte&0x80 =0x00 \b, long header
  1782. >>102 belong+1 x \b, %x
  1783. >>106 belong+1 x \bx%x
  1784. >101 beshort&0xf x \b, bitdepth=
  1785. >>101 beshort&0xf 0x0 \b1-WHITE=1
  1786. >>101 beshort&0xf 0x1 \b8
  1787. >>101 beshort&0xf 0x2 \b16
  1788. >>101 beshort&0xf 0x3 \b16-SIGNED
  1789. >>101 beshort&0xf 0x4 \b16-FLOAT
  1790. >>101 beshort&0xf 0x5 \b(reserved 5)
  1791. >>101 beshort&0xf 0x6 \b32-SIGNED
  1792. >>101 beshort&0xf 0x7 \b32-FLOAT
  1793. >>101 beshort&0xf 0x8 \b5
  1794. >>101 beshort&0xf 0x9 \b10
  1795. >>101 beshort&0xf 0xa \b5-6-5
  1796. >>101 beshort&0xf 0xb \b(reserved %d)
  1797. >>101 beshort&0xf 0xc \b(reserved %d)
  1798. >>101 beshort&0xf 0xd \b(reserved %d)
  1799. >>101 beshort&0xf 0xe \b(reserved %d)
  1800. >>101 beshort&0xf 0xf \b1-BLACK=1
  1801. >101 beshort&0xf0 x \b, colorfmt=
  1802. >>101 beshort&0xf0 0x00 \bYONLY
  1803. >>101 beshort&0xf0 0x10 \bYUV240
  1804. >>101 beshort&0xf0 0x20 \bYWV422
  1805. >>101 beshort&0xf0 0x30 \bYWV444
  1806. >>101 beshort&0xf0 0x40 \bCMYK
  1807. >>101 beshort&0xf0 0x50 \bCMYKDIRECT
  1808. >>101 beshort&0xf0 0x60 \bNCOMPONENT
  1809. >>101 beshort&0xf0 0x70 \bRGB
  1810. >>101 beshort&0xf0 0x80 \bRGBE
  1811. >>101 beshort&0xf0 >0x80 \b(reserved %#x)
  1812. # From: Johan van der Knijff <johan.vanderknijff@kb.nl>
  1813. #
  1814. # BPG (Better Portable Graphics) format
  1815. # https://bellard.org/bpg/
  1816. # http://fileformats.archiveteam.org/wiki/BPG
  1817. #
  1818. 0 string \x42\x50\x47\xFB BPG (Better Portable Graphics)
  1819. !:mime image/bpg
  1820. # From: Joerg Jenderek
  1821. # URL: https://en.wikipedia.org/wiki/Apple_Icon_Image_format
  1822. 0 string icns Mac OS X icon
  1823. !:mime image/x-icns
  1824. !:apple ????icns
  1825. !:ext icns
  1826. >4 ubelong >0
  1827. # file size
  1828. >>4 ubelong x \b, %d bytes
  1829. # icon type
  1830. >>8 string x \b, "%4.4s" type
  1831. # TIM images
  1832. # URL: http://fileformats.archiveteam.org/wiki/TIM_(PlayStation_graphics)
  1833. # Reference: https://mrclick.zophar.net/TilEd/download/timgfx.txt
  1834. # Update: Joerg Jenderek
  1835. # Note: called as "PSX TIM *bpp bitmap" by bitmap-tim-*.trid.xml
  1836. # verified as "TIM PSX" by XnView `nconvert -fullinfo *.tim` and
  1837. # by RECOIL `recoil2png -o TMP.PNG input.tim; file TMP.PNG` and often
  1838. # as "PSX TIM" by ImageMagick version 7.1.0-10 command `identify *.tim`
  1839. # here signed integers are used but according to Kaitai unsigned
  1840. 0 lelong 0x00000010
  1841. # 32 Flag bits *cttt; c~CLUT flag t~type 000~4BPP 001~8BPP 010~16BPP 011~24BPP 100~Mixed
  1842. #>4 lelong x FLAGS=%#x
  1843. # 12+Size of CLUT (2Ch for 4BPP; 20Ch 40Ch 60Ch 80Ch C0Ch for 8BPP) or
  1844. # +image data size (800Ch 2000Ch 2580C for 16BPP) (02000003h for dBase memo test.dbt)
  1845. #>8 lelong x \b, 12+CLUT or data size=%#8.8x
  1846. # CLUT or data size remainder is 12 (Ch), but 03 for dBase memo test.dbt
  1847. #>8 ubyte&0x0F =0x0C \b, SIZE REMAINDER IS 12
  1848. # skip dBase III memo test.dbt with invalid flags 22D10189h
  1849. >4 lelong&0xffFFffF0 =0 Sony PlayStation PSX image,
  1850. # file (version 5.40) labeled the above entry as "TIM image"
  1851. !:mime image/x-sony-tim
  1852. !:ext tim
  1853. #>>4 lelong&0x00000007 x \b, BPP~%u
  1854. # 4BPP and 8BPP examples exist with CLUT or without CLUT
  1855. >>4 lelong&0x07 0x0 4-Bit,
  1856. >>4 lelong&0x07 0x1 8-Bit,
  1857. # 16BPP and 24BPP examples have no CLUT
  1858. >>4 lelong 0x2 15-Bit,
  1859. >>4 lelong 0x3 24-Bit,
  1860. # no example
  1861. >>4 lelong&0x07 0x4 Mixed-Bit,
  1862. # CLUT flag set
  1863. >>4 lelong &8
  1864. # 12 + size of CLUT like: 1000Ch 800Ch 400Ch 40Ch and 2FEh (KAGE.TIM)
  1865. #>>>(8.l+8) lelong x \b, 12+CLUT SIZE=%#8.8x
  1866. >>>(8.l+12) leshort x Pixel at (%d,
  1867. >>>(8.l+14) leshort x \b%d) Size=
  1868. # image width (to get actual width multiply by 4 for 4BPP and by 2 for 8BPP)
  1869. >>>>4 lelong 0x8
  1870. >>>>>(8.l+16) leshort*4 x \b%d
  1871. >>>>4 lelong 0x9
  1872. >>>>>(8.l+16) leshort*2 x \b%d
  1873. # image height like: 32 64 128 144 160 208 256
  1874. >>>(8.l+18) leshort x \bx%d,
  1875. >>>4 lelong 0x8 16 CLUT Entries at
  1876. >>>4 lelong 0x9 256 CLUT Entries at
  1877. >>>12 leshort x (%d,
  1878. >>>14 leshort x \b%d)
  1879. # no Color LookUp Table (CLUT)
  1880. >>4 lelong ^8
  1881. # image orgin X Y
  1882. >>>12 leshort x Pixel at (%d,
  1883. >>>14 leshort x \b%d) Size=
  1884. # real image width = multiply by 4 (4BPP) 2 (8BPP) 1 (16BPP) 2/3 (24BPP)
  1885. >>>>4 lelong 0x0
  1886. >>>>>16 leshort*4 x \b%d
  1887. >>>>4 lelong 0x1
  1888. >>>>>16 leshort*2 x \b%d
  1889. >>>>4 lelong 0x2
  1890. >>>>>16 leshort x \b%d
  1891. >>>>4 lelong 0x3
  1892. # GRR: NOT working
  1893. #>>>>>16 leshort*2/3 x \b%d
  1894. >>>>>16 leshort x \b2/3*%d
  1895. # mixed format width not explained!
  1896. >>>>4 lelong 0x4
  1897. >>>>>16 leshort x \b%d
  1898. # image height like: 64 240 256
  1899. >>>18 leshort x \bx%d
  1900. # TIM image data
  1901. # MDEC streams
  1902. 0 lelong 0x80010160 MDEC video stream,
  1903. >16 leshort x %dx
  1904. >18 leshort x \b%d
  1905. #>8 lelong x %d frames
  1906. #>4 leshort x secCount=%d;
  1907. #>6 leshort x nSectors=%d;
  1908. #>12 lelong x frameSize=%d;
  1909. # BS encoded bitstreams
  1910. 2 leshort 0x3800 BS image,
  1911. >6 leshort x Version %d,
  1912. >4 leshort x Quantization %d,
  1913. >0 leshort x (Decompresses to %d words)
  1914. # Type: farbfeld image.
  1915. # Url: http://tools.suckless.org/farbfeld/
  1916. # From: Ian D. Scott <ian@iandouglasscott.com>
  1917. #
  1918. 0 string farbfeld farbfeld image data,
  1919. >8 ubelong x %dx
  1920. >12 ubelong x \b%d
  1921. # Type: Microsoft DirectDraw Surface (common data)
  1922. # URL: https://msdn.microsoft.com/library/default.asp?url=/library/en-us/directx9_c/directx/graphics/reference/DDSFileReference/ddsfileformat.asp
  1923. # From: Morten Hustveit <morten@debian.org>
  1924. # Updated by: David Korth <gerbilsoft@gerbilsoft.com>
  1925. 0 name ms-directdraw-surface
  1926. >0x10 ulelong x %u x
  1927. >0x0C ulelong x %u
  1928. # Color depth.
  1929. >0x58 ulelong >0 \b, %u-bit color
  1930. # Determine the pixel format.
  1931. >0x50 ulelong&0x4 4
  1932. # FIXME: Handle DX10 and XBOX formats.
  1933. >>0x54 string x \b, compressed using %.4s
  1934. >0x50 ulelong&0x2 0x2 \b, alpha only
  1935. >0x50 ulelong&0x200 0x200 \b, YUV
  1936. >0x50 ulelong&0x20000 0x20000 \b, luminance
  1937. # RGB pixel format
  1938. >0x50 ulelong&0x40 0x40
  1939. # Determine the RGB format using the color masks.
  1940. # ulequad order: 0xGGGGGGGGRRRRRRRR, 0xAAAAAAAABBBBBBBB
  1941. >>0x58 ulelong 16
  1942. # NOTE: 15-bit color formats usually have 16-bit listed as the color depth.
  1943. >>>0x5C ulequad 0x000003E000007C00
  1944. >>>>0x64 ulequad 0x000000000000001F \b, RGB555
  1945. >>>0x5C ulequad 0x000003E000001F00
  1946. >>>>0x64 ulequad 0x000000000000007C \b, BGR555
  1947. >>>0x5C ulequad 0x000007E00000F800
  1948. >>>>0x64 ulequad 0x000000000000001F \b, RGB565
  1949. >>>0x5C ulequad 0x000007E000001F00
  1950. >>>>0x64 ulequad 0x00000000000000F8 \b, BGR565
  1951. >>>0x5C ulequad 0x000000F000000F00
  1952. >>>>0x64 ulequad 0x0000F0000000000F \b, ARGB4444
  1953. >>>0x5C ulequad 0x000000F00000000F
  1954. >>>>0x64 ulequad 0x0000F00000000F00 \b, ABGR4444
  1955. >>>0x5C ulequad 0x00000F000000F000
  1956. >>>>0x64 ulequad 0x0000000F000000F0 \b, RGBA4444
  1957. >>>0x5C ulequad 0x00000F00000000F0
  1958. >>>>0x64 ulequad 0x0000000F0000F000 \b, BGRA4444
  1959. >>>0x5C ulequad 0x000000F000000F00
  1960. >>>>0x64 ulequad 0x000000000000000F \b, xRGB4444
  1961. >>>0x5C ulequad 0x000000F00000000F
  1962. >>>>0x64 ulequad 0x0000000000000F00 \b, xBGR4444
  1963. >>>0x5C ulequad 0x00000F000000F000
  1964. >>>>0x64 ulequad 0x00000000000000F0 \b, RGBx4444
  1965. >>>0x5C ulequad 0x00000F00000000F0
  1966. >>>>0x64 ulequad 0x000000000000F000 \b, BGRx4444
  1967. >>>0x5C ulequad 0x000003E000007C00
  1968. >>>>0x64 ulequad 0x000080000000001F \b, ARGB1555
  1969. >>>0x5C ulequad 0x000003E000001F00
  1970. >>>>0x64 ulequad 0x000080000000007C \b, ABGR1555
  1971. >>>0x5C ulequad 0x000007C00000F800
  1972. >>>>0x64 ulequad 0x000000010000003E \b, RGBA5551
  1973. >>>0x5C ulequad 0x000007C00000003E
  1974. >>>>0x64 ulequad 0x000000010000F800 \b, BGRA5551
  1975. >>88 ulelong 24
  1976. >>>0x5C ulequad 0x0000FF0000FF0000
  1977. >>>>0x64 ulequad 0x00000000000000FF \b, RGB888
  1978. >>>0x5C ulequad 0x0000FF00000000FF
  1979. >>>>0x64 ulequad 0x0000000000FF0000 \b, BGR888
  1980. >>88 ulelong 32
  1981. >>>0x5C ulequad 0x0000FF0000FF0000
  1982. >>>>0x64 ulequad 0xFF000000000000FF \b, ARGB8888
  1983. >>>0x5C ulequad 0x0000FF00000000FF
  1984. >>>>0x64 ulequad 0xFF00000000FF0000 \b, ABGR8888
  1985. >>>0x5C ulequad 0x00FF0000FF000000
  1986. >>>>0x64 ulequad 0x000000FF0000FF00 \b, RGBA8888
  1987. >>>0x5C ulequad 0x00FF00000000FF00
  1988. >>>>0x64 ulequad 0x000000FFFF000000 \b, BGBA8888
  1989. >>>0x5C ulequad 0x0000FF0000FF0000
  1990. >>>>0x64 ulequad 0x00000000000000FF \b, xRGB8888
  1991. >>>0x5C ulequad 0x0000FF00000000FF
  1992. >>>>0x64 ulequad 0x0000000000FF0000 \b, xBGR8888
  1993. >>>0x5C ulequad 0x00FF0000FF000000
  1994. >>>>0x64 ulequad 0x000000000000FF00 \b, RGBx8888
  1995. >>>0x5C ulequad 0x00FF00000000FF00
  1996. >>>>0x64 ulequad 0x00000000FF000000 \b, BGBx8888
  1997. # Less common 32-bit color formats.
  1998. >>>0x5C ulequad 0xFFFF00000000FFFF
  1999. >>>>0x64 ulequad 0x0000000000000000 \b, G16R16
  2000. >>>0x5C ulequad 0x0000FFFFFFFF0000
  2001. >>>>0x64 ulequad 0x0000000000000000 \b, R16G16
  2002. >>>0x5C ulequad 0x000FFC003FF00000
  2003. >>>>0x64 ulequad 0xC0000000000003FF \b, A2R10G10B10
  2004. >>>0x5C ulequad 0x000FFC00000003FF
  2005. >>>>0x64 ulequad 0xC00000003FF00000 \b, A2B10G10R10
  2006. # Type: Microsoft DirectDraw Surface
  2007. # URL: https://msdn.microsoft.com/library/default.asp?url=/library/en-us/directx9_c/directx/graphics/reference/DDSFileReference/ddsfileformat.asp
  2008. # From: Morten Hustveit <morten@debian.org>
  2009. # Updated by: David Korth <gerbilsoft@gerbilsoft.com>
  2010. 0 string/b DDS\040\174\000\000\000 Microsoft DirectDraw Surface (DDS):
  2011. >0 use ms-directdraw-surface
  2012. # Type: Sega PVR image.
  2013. # From: David Korth <gerbilsoft@gerbilsoft.com>
  2014. # References:
  2015. # - https://fabiensanglard.net/Mykaruga/tools/segaPVRFormat.txt
  2016. # - https://github.com/yazgoo/pvrx2png
  2017. # - https://github.com/nickworonekin/puyotools
  2018. # Sega PVR header.
  2019. 0 name sega-pvr-image-header
  2020. >0x0C leshort x %u x
  2021. >0x0E leshort x %u
  2022. # Image format.
  2023. >0x08 byte 0 \b, ARGB1555
  2024. >0x08 byte 1 \b, RGB565
  2025. >0x08 byte 2 \b, ARGB4444
  2026. >0x08 byte 3 \b, YUV442
  2027. >0x08 byte 4 \b, Bump
  2028. >0x08 byte 5 \b, 4bpp
  2029. >0x08 byte 6 \b, 8bpp
  2030. # Image data type.
  2031. >0x09 byte 0x01 \b, square twiddled
  2032. >0x09 byte 0x02 \b, square twiddled & mipmap
  2033. >0x09 byte 0x03 \b, VQ
  2034. >0x09 byte 0x04 \b, VQ & mipmap
  2035. >0x09 byte 0x05 \b, 8-bit CLUT twiddled
  2036. >0x09 byte 0x06 \b, 4-bit CLUT twiddled
  2037. >0x09 byte 0x07 \b, 8-bit direct twiddled
  2038. >0x09 byte 0x08 \b, 4-bit direct twiddled
  2039. >0x09 byte 0x09 \b, rectangle
  2040. >0x09 byte 0x0B \b, rectangular stride
  2041. >0x09 byte 0x0D \b, rectangular twiddled
  2042. >0x09 byte 0x10 \b, small VQ
  2043. >0x09 byte 0x11 \b, small VQ & mipmap
  2044. >0x09 byte 0x12 \b, square twiddled & mipmap
  2045. # Sega PVR image.
  2046. 0 string PVRT
  2047. >0x10 string DDS\040\174\000\000\000 Sega PVR (Xbox) image:
  2048. >>0x20 use ms-directdraw-surface
  2049. >0x10 belong !0x44445320 Sega PVR image:
  2050. >>0 use sega-pvr-image-header
  2051. # Sega PVR image with GBIX.
  2052. 0 string GBIX
  2053. >0x10 string PVRT
  2054. >>0x10 string DDS\040\174\000\000\000 Sega PVR (Xbox) image:
  2055. >>>0x20 use ms-directdraw-surface
  2056. >>0x10 belong !0x44445320 Sega PVR image:
  2057. >>>0x10 use sega-pvr-image-header
  2058. >>0x08 lelong x \b, global index = %u
  2059. # Sega GVR header.
  2060. 0 name sega-gvr-image-header
  2061. >0x0C beshort x %u x
  2062. >0x0E beshort x %u
  2063. # Image data format.
  2064. >0x0B byte 0 \b, I4
  2065. >0x0B byte 1 \b, I8
  2066. >0x0B byte 2 \b, IA4
  2067. >0x0B byte 3 \b, IA8
  2068. >0x0B byte 4 \b, RGB565
  2069. >0x0B byte 5 \b, RGB5A3
  2070. >0x0B byte 6 \b, ARGB8888
  2071. >0x0B byte 8 \b, CI4
  2072. >0x0B byte 9 \b, CI8
  2073. >0x0B byte 14 \b, DXT1
  2074. # Sega GVR image.
  2075. 0 string GVRT Sega GVR image:
  2076. >0x10 use sega-gvr-image-header
  2077. # Sega GVR image with GBIX.
  2078. 0 string GBIX
  2079. >0x10 string GVRT Sega GVR image:
  2080. >>0x10 use sega-gvr-image-header
  2081. >>0x08 belong x \b, global index = %u
  2082. # Sega GVR image with GCIX. (Wii)
  2083. 0 string GCIX
  2084. >0x10 string GVRT Sega GVR image:
  2085. >>0x10 use sega-gvr-image-header
  2086. >>0x08 belong x \b, global index = %u
  2087. # Light Field Picture
  2088. # Documentation: http://optics.miloush.net/lytro/TheFileFormat.aspx
  2089. # Typical file extensions: .lfp .lfr .lfx
  2090. 0 belong 0x894C4650
  2091. >4 belong 0x0D0A1A0A
  2092. >12 belong 0x00000000 Lytro Light Field Picture
  2093. >8 belong x \b, version %d
  2094. # Type: Vision Research Phantom CINE Format
  2095. # URL: https://www.phantomhighspeed.com/
  2096. # URL2: http://phantomhighspeed.force.com/vriknowledge/servlet/fileField?id=0BEU0000000Cfyk
  2097. # From: Harry Mallon <hjmallon at gmail.com>
  2098. #
  2099. # This has a short "CI" code but the 44 is the size of the struct which is
  2100. # stable
  2101. 0 string CI
  2102. >2 leshort 44 Vision Research CINE Video,
  2103. >>4 leshort 0 Grayscale,
  2104. >>4 leshort 1 JPEG Compressed,
  2105. >>4 leshort 2 RAW,
  2106. >>6 leshort x version %d,
  2107. >>20 lelong x %d frames,
  2108. >>48 lelong x %dx
  2109. >>52 lelong x \b%d
  2110. # Type: ARRI Raw Image
  2111. # Info: SMPTE RDD30:2014
  2112. # From: Harry Mallon <hjmallon at gmail.com>
  2113. 0 string ARRI ARRI ARI image data,
  2114. >4 lelong 0x78563412 little-endian,
  2115. >4 lelong 0x12345678 big-endian,
  2116. >12 lelong x version %d,
  2117. >20 lelong x %dx
  2118. >24 lelong x \b%d
  2119. # Type: Khronos KTX texture.
  2120. # From: David Korth <gerbilsoft@gerbilsoft.com>
  2121. # Reference: https://www.khronos.org/opengles/sdk/tools/KTX/file_format_spec/
  2122. # glEnum decoding.
  2123. # NOTE: Only the most common formats are listed here.
  2124. 0 name khronos-ktx-glEnum
  2125. >0 lelong 0x1907 \b, RGB
  2126. >0 lelong 0x1908 \b, RGBA
  2127. >0 lelong 0x1909 \b, LUMINANCE
  2128. >0 lelong 0x190A \b, LUMINANCE_ALPHA
  2129. >0 lelong 0x80E1 \b, BGR
  2130. >0 lelong 0x80E2 \b, BGRA
  2131. >0 lelong 0x83A0 \b, RGB_S3TC
  2132. >0 lelong 0x83A1 \b, RGB4_S3TC
  2133. >0 lelong 0x83A2 \b, RGBA_S3TC
  2134. >0 lelong 0x83A3 \b, RGBA4_S3TC
  2135. >0 lelong 0x83A4 \b, RGBA_DXT5_S3TC
  2136. >0 lelong 0x83A5 \b, RGBA4_DXT5_S3TC
  2137. >0 lelong 0x83F0 \b, COMPRESSED_RGB_S3TC_DXT1_EXT
  2138. >0 lelong 0x83F1 \b, COMPRESSED_RGBA_S3TC_DXT1_EXT
  2139. >0 lelong 0x83F2 \b, COMPRESSED_RGBA_S3TC_DXT3_EXT
  2140. >0 lelong 0x83F3 \b, COMPRESSED_RGBA_S3TC_DXT5_EXT
  2141. >0 lelong 0x8D64 \b, ETC1_RGB8_OES
  2142. >0 lelong 0x9270 \b, COMPRESSED_R11_EAC
  2143. >0 lelong 0x9271 \b, COMPRESSED_SIGNED_R11_EAC
  2144. >0 lelong 0x9272 \b, COMPRESSED_RG11_EAC
  2145. >0 lelong 0x9273 \b, COMPRESSED_SIGNED_RG11_EAC
  2146. >0 lelong 0x9274 \b, COMPRESSED_RGB8_ETC2
  2147. >0 lelong 0x9275 \b, COMPRESSED_SRGB8_ETC2
  2148. >0 lelong 0x9276 \b, COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2
  2149. >0 lelong 0x9277 \b, COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2
  2150. >0 lelong 0x9278 \b, COMPRESSED_RGBA2_ETC2_EAC
  2151. >0 lelong 0x9279 \b, COMPRESSED_SRGB8_ALPHA8_ETC2_EAC
  2152. >0 lelong 0x93B0 \b, COMPRESSED_RGBA_ASTC_4x4_KHR
  2153. >0 lelong 0x93B1 \b, COMPRESSED_RGBA_ASTC_5x4_KHR
  2154. >0 lelong 0x93B2 \b, COMPRESSED_RGBA_ASTC_5x5_KHR
  2155. >0 lelong 0x93B3 \b, COMPRESSED_RGBA_ASTC_6x5_KHR
  2156. >0 lelong 0x93B4 \b, COMPRESSED_RGBA_ASTC_6x6_KHR
  2157. >0 lelong 0x93B5 \b, COMPRESSED_RGBA_ASTC_8x5_KHR
  2158. >0 lelong 0x93B6 \b, COMPRESSED_RGBA_ASTC_8x6_KHR
  2159. >0 lelong 0x93B7 \b, COMPRESSED_RGBA_ASTC_8x8_KHR
  2160. >0 lelong 0x93B8 \b, COMPRESSED_RGBA_ASTC_10x5_KHR
  2161. >0 lelong 0x93B9 \b, COMPRESSED_RGBA_ASTC_10x6_KHR
  2162. >0 lelong 0x93BA \b, COMPRESSED_RGBA_ASTC_10x8_KHR
  2163. >0 lelong 0x93BB \b, COMPRESSED_RGBA_ASTC_10x10_KHR
  2164. >0 lelong 0x93BC \b, COMPRESSED_RGBA_ASTC_12x10_KHR
  2165. >0 lelong 0x93BD \b, COMPRESSED_RGBA_ASTC_12x12_KHR
  2166. >0 lelong 0x93D0 \b, COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR
  2167. >0 lelong 0x93D1 \b, COMPRESSED_SRGB8_ALPHA8_ASTC_5x4_KHR
  2168. >0 lelong 0x93D2 \b, COMPRESSED_SRGB8_ALPHA8_ASTC_5x5_KHR
  2169. >0 lelong 0x93D3 \b, COMPRESSED_SRGB8_ALPHA8_ASTC_6x5_KHR
  2170. >0 lelong 0x93D4 \b, COMPRESSED_SRGB8_ALPHA8_ASTC_6x6_KHR
  2171. >0 lelong 0x93D5 \b, COMPRESSED_SRGB8_ALPHA8_ASTC_8x5_KHR
  2172. >0 lelong 0x93D6 \b, COMPRESSED_SRGB8_ALPHA8_ASTC_8x6_KHR
  2173. >0 lelong 0x93D7 \b, COMPRESSED_SRGB8_ALPHA8_ASTC_8x8_KHR
  2174. >0 lelong 0x93D8 \b, COMPRESSED_SRGB8_ALPHA8_ASTC_10x5_KHR
  2175. >0 lelong 0x93D9 \b, COMPRESSED_SRGB8_ALPHA8_ASTC_10x6_KHR
  2176. >0 lelong 0x93DA \b, COMPRESSED_SRGB8_ALPHA8_ASTC_10x8_KHR
  2177. >0 lelong 0x93DB \b, COMPRESSED_SRGB8_ALPHA8_ASTC_10x10_KHR
  2178. >0 lelong 0x93DC \b, COMPRESSED_SRGB8_ALPHA8_ASTC_12x10_KHR
  2179. >0 lelong 0x93DD \b, COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR
  2180. # Endian-specific KTX header.
  2181. # TODO: glType (all textures I've seen so far are GL_UNSIGNED_BYTE)
  2182. 0 name khronos-ktx-endian-header
  2183. >20 lelong x \b, %u
  2184. >24 lelong >1 x %u
  2185. >28 lelong >1 x %u
  2186. >8 lelong >0
  2187. >>8 use khronos-ktx-glEnum
  2188. >8 lelong 0
  2189. >>12 use khronos-ktx-glEnum
  2190. # Main KTX header.
  2191. # Determine endianness, then check the rest of the header.
  2192. 0 string \xABKTX\ 11\xBB\r\n\x1A\n Khronos KTX texture
  2193. >12 lelong 0x04030201 (little-endian)
  2194. >>16 use khronos-ktx-endian-header
  2195. >12 belong 0x04030201 (big-endian)
  2196. >>16 use \^khronos-ktx-endian-header
  2197. # Type: Khronos KTX2 texture.
  2198. # From: David Korth <gerbilsoft@gerbilsoft.com>
  2199. # Based on draft19.
  2200. # Reference: http://github.khronos.org/KTX-Specification/
  2201. # Supercompression enum.
  2202. 0 name khronos-ktx2-supercompression
  2203. >0 lelong 1 BasisLZ
  2204. >0 lelong 2 Zstandard
  2205. >0 lelong 3 ZLIB
  2206. # Vulkan format identifier.
  2207. # NOTE: Formats prohibited from KTX2 are commented out.
  2208. 0 name khronos-ktx2-vkFormat
  2209. >0 lelong 0 UNDEFINED
  2210. >0 lelong 1 R4G4_UNORM_PACK8
  2211. >0 lelong 2 R4G4B4A4_UNORM_PACK16
  2212. >0 lelong 3 B4G4R4A4_UNORM_PACK16
  2213. >0 lelong 4 R5G6B5_UNORM_PACK16
  2214. >0 lelong 5 B5G6R5_UNORM_PACK16
  2215. >0 lelong 6 R5G5B5A1_UNORM_PACK16
  2216. >0 lelong 7 B5G5R5A1_UNORM_PACK16
  2217. >0 lelong 8 A1R5G5B5_UNORM_PACK16
  2218. >0 lelong 9 R8_UNORM
  2219. >0 lelong 10 R8_SNORM
  2220. #>0 lelong 11 R8_USCALED
  2221. #>0 lelong 12 R8_SSCALED
  2222. >0 lelong 13 R8_UINT
  2223. >0 lelong 14 R8_SINT
  2224. >0 lelong 15 R8_SRGB
  2225. >0 lelong 16 R8G8_UNORM
  2226. >0 lelong 17 R8G8_SNORM
  2227. #>0 lelong 18 R8G8_USCALED
  2228. #>0 lelong 19 R8G8_SSCALED
  2229. >0 lelong 20 R8G8_UINT
  2230. >0 lelong 21 R8G8_SINT
  2231. >0 lelong 22 R8G8_SRGB
  2232. >0 lelong 23 R8G8B8_UNORM
  2233. >0 lelong 24 R8G8B8_SNORM
  2234. #>0 lelong 25 R8G8B8_USCALED
  2235. #>0 lelong 26 R8G8B8_SSCALED
  2236. >0 lelong 27 R8G8B8_UINT
  2237. >0 lelong 28 R8G8B8_SINT
  2238. >0 lelong 29 R8G8B8_SRGB
  2239. >0 lelong 30 B8G8R8_UNORM
  2240. >0 lelong 31 B8G8R8_SNORM
  2241. #>0 lelong 32 B8G8R8_USCALED
  2242. #>0 lelong 33 B8G8R8_SSCALED
  2243. >0 lelong 34 B8G8R8_UINT
  2244. >0 lelong 35 B8G8R8_SINT
  2245. >0 lelong 36 B8G8R8_SRGB
  2246. >0 lelong 37 R8G8B8A8_UNORM
  2247. >0 lelong 38 R8G8B8A8_SNORM
  2248. #>0 lelong 39 R8G8B8A8_USCALED
  2249. #>0 lelong 40 R8G8B8A8_SSCALED
  2250. >0 lelong 41 R8G8B8A8_UINT
  2251. >0 lelong 42 R8G8B8A8_SINT
  2252. >0 lelong 43 R8G8B8A8_SRGB
  2253. >0 lelong 44 B8G8R8A8_UNORM
  2254. >0 lelong 45 B8G8R8A8_SNORM
  2255. #>0 lelong 46 B8G8R8A8_USCALED
  2256. #>0 lelong 47 B8G8R8A8_SSCALED
  2257. >0 lelong 48 B8G8R8A8_UINT
  2258. >0 lelong 49 B8G8R8A8_SINT
  2259. >0 lelong 50 B8G8R8A8_SRGB
  2260. #>0 lelong 51 A8B8G8R8_UNORM_PACK32
  2261. #>0 lelong 52 A8B8G8R8_SNORM_PACK32
  2262. #>0 lelong 53 A8B8G8R8_USCALED_PACK32
  2263. #>0 lelong 54 A8B8G8R8_SSCALED_PACK32
  2264. #>0 lelong 55 A8B8G8R8_UINT_PACK32
  2265. #>0 lelong 56 A8B8G8R8_SINT_PACK32
  2266. #>0 lelong 57 A8B8G8R8_SRGB_PACK32
  2267. >0 lelong 58 A2R10G10B10_UNORM_PACK32
  2268. >0 lelong 59 A2R10G10B10_SNORM_PACK32
  2269. #>0 lelong 60 A2R10G10B10_USCALED_PACK32
  2270. #>0 lelong 61 A2R10G10B10_SSCALED_PACK32
  2271. >0 lelong 62 A2R10G10B10_UINT_PACK32
  2272. >0 lelong 63 A2R10G10B10_SINT_PACK32
  2273. >0 lelong 64 A2B10G10R10_UNORM_PACK32
  2274. >0 lelong 65 A2B10G10R10_SNORM_PACK32
  2275. #>0 lelong 66 A2B10G10R10_USCALED_PACK32
  2276. #>0 lelong 67 A2B10G10R10_SSCALED_PACK32
  2277. >0 lelong 68 A2B10G10R10_UINT_PACK32
  2278. >0 lelong 69 A2B10G10R10_SINT_PACK32
  2279. >0 lelong 70 R16_UNORM
  2280. >0 lelong 71 R16_SNORM
  2281. #>0 lelong 72 R16_USCALED
  2282. #>0 lelong 73 R16_SSCALED
  2283. >0 lelong 74 R16_UINT
  2284. >0 lelong 75 R16_SINT
  2285. >0 lelong 76 R16_SFLOAT
  2286. >0 lelong 77 R16G16_UNORM
  2287. >0 lelong 78 R16G16_SNORM
  2288. #>0 lelong 79 R16G16_USCALED
  2289. #>0 lelong 80 R16G16_SSCALED
  2290. >0 lelong 81 R16G16_UINT
  2291. >0 lelong 82 R16G16_SINT
  2292. >0 lelong 83 R16G16_SFLOAT
  2293. >0 lelong 84 R16G16B16_UNORM
  2294. >0 lelong 85 R16G16B16_SNORM
  2295. #>0 lelong 86 R16G16B16_USCALED
  2296. #>0 lelong 87 R16G16B16_SSCALED
  2297. >0 lelong 88 R16G16B16_UINT
  2298. >0 lelong 89 R16G16B16_SINT
  2299. >0 lelong 90 R16G16B16_SFLOAT
  2300. >0 lelong 91 R16G16B16A16_UNORM
  2301. >0 lelong 92 R16G16B16A16_SNORM
  2302. #>0 lelong 93 R16G16B16A16_USCALED
  2303. #>0 lelong 94 R16G16B16A16_SSCALED
  2304. >0 lelong 95 R16G16B16A16_UINT
  2305. >0 lelong 96 R16G16B16A16_SINT
  2306. >0 lelong 97 R16G16B16A16_SFLOAT
  2307. >0 lelong 98 R32_UINT
  2308. >0 lelong 99 R32_SINT
  2309. >0 lelong 100 R32_SFLOAT
  2310. >0 lelong 101 R32G32_UINT
  2311. >0 lelong 102 R32G32_SINT
  2312. >0 lelong 103 R32G32_SFLOAT
  2313. >0 lelong 104 R32G32B32_UINT
  2314. >0 lelong 105 R32G32B32_SINT
  2315. >0 lelong 106 R32G32B32_SFLOAT
  2316. >0 lelong 107 R32G32B32A32_UINT
  2317. >0 lelong 108 R32G32B32A32_SINT
  2318. >0 lelong 109 R32G32B32A32_SFLOAT
  2319. >0 lelong 110 R64_UINT
  2320. >0 lelong 111 R64_SINT
  2321. >0 lelong 112 R64_SFLOAT
  2322. >0 lelong 113 R64G64_UINT
  2323. >0 lelong 114 R64G64_SINT
  2324. >0 lelong 115 R64G64_SFLOAT
  2325. >0 lelong 116 R64G64B64_UINT
  2326. >0 lelong 117 R64G64B64_SINT
  2327. >0 lelong 118 R64G64B64_SFLOAT
  2328. >0 lelong 119 R64G64B64A64_UINT
  2329. >0 lelong 120 R64G64B64A64_SINT
  2330. >0 lelong 121 R64G64B64A64_SFLOAT
  2331. >0 lelong 122 B10G11R11_UFLOAT_PACK32
  2332. >0 lelong 123 E5B9G9R9_UFLOAT_PACK32
  2333. >0 lelong 124 D16_UNORM
  2334. >0 lelong 125 X8_D24_UNORM_PACK32
  2335. >0 lelong 126 D32_SFLOAT
  2336. >0 lelong 127 S8_UINT
  2337. >0 lelong 128 D16_UNORM_S8_UINT
  2338. >0 lelong 129 D24_UNORM_S8_UINT
  2339. >0 lelong 130 D32_SFLOAT_S8_UINT
  2340. >0 lelong 131 BC1_RGB_UNORM_BLOCK
  2341. >0 lelong 132 BC1_RGB_SRGB_BLOCK
  2342. >0 lelong 133 BC1_RGBA_UNORM_BLOCK
  2343. >0 lelong 134 BC1_RGBA_SRGB_BLOCK
  2344. >0 lelong 135 BC2_UNORM_BLOCK
  2345. >0 lelong 136 BC2_SRGB_BLOCK
  2346. >0 lelong 137 BC3_UNORM_BLOCK
  2347. >0 lelong 138 BC3_SRGB_BLOCK
  2348. >0 lelong 139 BC4_UNORM_BLOCK
  2349. >0 lelong 140 BC4_SNORM_BLOCK
  2350. >0 lelong 141 BC5_UNORM_BLOCK
  2351. >0 lelong 142 BC5_SNORM_BLOCK
  2352. >0 lelong 143 BC6H_UFLOAT_BLOCK
  2353. >0 lelong 144 BC6H_SFLOAT_BLOCK
  2354. >0 lelong 145 BC7_UNORM_BLOCK
  2355. >0 lelong 146 BC7_SRGB_BLOCK
  2356. >0 lelong 147 ETC2_R8G8B8_UNORM_BLOCK
  2357. >0 lelong 148 ETC2_R8G8B8_SRGB_BLOCK
  2358. >0 lelong 149 ETC2_R8G8B8A1_UNORM_BLOCK
  2359. >0 lelong 150 ETC2_R8G8B8A1_SRGB_BLOCK
  2360. >0 lelong 151 ETC2_R8G8B8A8_UNORM_BLOCK
  2361. >0 lelong 152 ETC2_R8G8B8A8_SRGB_BLOCK
  2362. >0 lelong 153 EAC_R11_UNORM_BLOCK
  2363. >0 lelong 154 EAC_R11_SNORM_BLOCK
  2364. >0 lelong 155 EAC_R11G11_UNORM_BLOCK
  2365. >0 lelong 156 EAC_R11G11_SNORM_BLOCK
  2366. >0 lelong 157 ASTC_4x4_UNORM_BLOCK
  2367. >0 lelong 158 ASTC_4x4_SRGB_BLOCK
  2368. >0 lelong 159 ASTC_5x4_UNORM_BLOCK
  2369. >0 lelong 160 ASTC_5x4_SRGB_BLOCK
  2370. >0 lelong 161 ASTC_5x5_UNORM_BLOCK
  2371. >0 lelong 162 ASTC_5x5_SRGB_BLOCK
  2372. >0 lelong 163 ASTC_6x5_UNORM_BLOCK
  2373. >0 lelong 164 ASTC_6x5_SRGB_BLOCK
  2374. >0 lelong 165 ASTC_6x6_UNORM_BLOCK
  2375. >0 lelong 166 ASTC_6x6_SRGB_BLOCK
  2376. >0 lelong 167 ASTC_8x5_UNORM_BLOCK
  2377. >0 lelong 168 ASTC_8x5_SRGB_BLOCK
  2378. >0 lelong 169 ASTC_8x6_UNORM_BLOCK
  2379. >0 lelong 170 ASTC_8x6_SRGB_BLOCK
  2380. >0 lelong 171 ASTC_8x8_UNORM_BLOCK
  2381. >0 lelong 172 ASTC_8x8_SRGB_BLOCK
  2382. >0 lelong 173 ASTC_10x5_UNORM_BLOCK
  2383. >0 lelong 174 ASTC_10x5_SRGB_BLOCK
  2384. >0 lelong 175 ASTC_10x6_UNORM_BLOCK
  2385. >0 lelong 176 ASTC_10x6_SRGB_BLOCK
  2386. >0 lelong 177 ASTC_10x8_UNORM_BLOCK
  2387. >0 lelong 178 ASTC_10x8_SRGB_BLOCK
  2388. >0 lelong 179 ASTC_10x10_UNORM_BLOCK
  2389. >0 lelong 180 ASTC_10x10_SRGB_BLOCK
  2390. >0 lelong 181 ASTC_12x10_UNORM_BLOCK
  2391. >0 lelong 182 ASTC_12x10_SRGB_BLOCK
  2392. >0 lelong 183 ASTC_12x12_UNORM_BLOCK
  2393. >0 lelong 184 ASTC_12x12_SRGB_BLOCK
  2394. >0 lelong 1000156000 G8B8G8R8_422_UNORM
  2395. >0 lelong 1000156001 B8G8R8G8_422_UNORM
  2396. >0 lelong 1000156002 G8_B8_R8_3PLANE_420_UNORM
  2397. >0 lelong 1000156003 G8_B8R8_2PLANE_420_UNORM
  2398. >0 lelong 1000156004 G8_B8_R8_3PLANE_422_UNORM
  2399. >0 lelong 1000156005 G8_B8R8_2PLANE_422_UNORM
  2400. >0 lelong 1000156006 G8_B8_R8_3PLANE_444_UNORM
  2401. >0 lelong 1000156007 R10X6_UNORM_PACK16
  2402. >0 lelong 1000156008 R10X6G10X6_UNORM_2PACK16
  2403. >0 lelong 1000156009 R10X6G10X6B10X6A10X6_UNORM_4PACK16
  2404. >0 lelong 1000156010 G10X6B10X6G10X6R10X6_422_UNORM_4PACK16
  2405. >0 lelong 1000156011 B10X6G10X6R10X6G10X6_422_UNORM_4PACK16
  2406. >0 lelong 1000156012 G10X6_B10X6_R10X6_3PLANE_420_UNORM_3PACK16
  2407. >0 lelong 1000156013 G10X6_B10X6R10X6_2PLANE_420_UNORM_3PACK16
  2408. >0 lelong 1000156014 G10X6_B10X6_R10X6_3PLANE_422_UNORM_3PACK16
  2409. >0 lelong 1000156015 G10X6_B10X6R10X6_2PLANE_422_UNORM_3PACK16
  2410. >0 lelong 1000156016 G10X6_B10X6_R10X6_3PLANE_444_UNORM_3PACK16
  2411. >0 lelong 1000156017 R12X4_UNORM_PACK16
  2412. >0 lelong 1000156018 R12X4G12X4_UNORM_2PACK16
  2413. >0 lelong 1000156019 R12X4G12X4B12X4A12X4_UNORM_4PACK16
  2414. >0 lelong 1000156020 G12X4B12X4G12X4R12X4_422_UNORM_4PACK16
  2415. >0 lelong 1000156021 B12X4G12X4R12X4G12X4_422_UNORM_4PACK16
  2416. >0 lelong 1000156022 G12X4_B12X4_R12X4_3PLANE_420_UNORM_3PACK16
  2417. >0 lelong 1000156023 G12X4_B12X4R12X4_2PLANE_420_UNORM_3PACK16
  2418. >0 lelong 1000156024 G12X4_B12X4_R12X4_3PLANE_422_UNORM_3PACK16
  2419. >0 lelong 1000156025 G12X4_B12X4R12X4_2PLANE_422_UNORM_3PACK16
  2420. >0 lelong 1000156026 G12X4_B12X4_R12X4_3PLANE_444_UNORM_3PACK16
  2421. >0 lelong 1000156027 G16B16G16R16_422_UNORM
  2422. >0 lelong 1000156028 B16G16R16G16_422_UNORM
  2423. >0 lelong 1000156029 G16_B16_R16_3PLANE_420_UNORM
  2424. >0 lelong 1000156030 G16_B16R16_2PLANE_420_UNORM
  2425. >0 lelong 1000156031 G16_B16_R16_3PLANE_422_UNORM
  2426. >0 lelong 1000156032 G16_B16R16_2PLANE_422_UNORM
  2427. >0 lelong 1000156033 G16_B16_R16_3PLANE_444_UNORM
  2428. >0 lelong 1000054000 PVRTC1_2BPP_UNORM_BLOCK_IMG
  2429. >0 lelong 1000054001 PVRTC1_4BPP_UNORM_BLOCK_IMG
  2430. >0 lelong 1000054002 PVRTC2_2BPP_UNORM_BLOCK_IMG
  2431. >0 lelong 1000054003 PVRTC2_4BPP_UNORM_BLOCK_IMG
  2432. >0 lelong 1000054004 PVRTC1_2BPP_SRGB_BLOCK_IMG
  2433. >0 lelong 1000054005 PVRTC1_4BPP_SRGB_BLOCK_IMG
  2434. >0 lelong 1000054006 PVRTC2_2BPP_SRGB_BLOCK_IMG
  2435. >0 lelong 1000054007 PVRTC2_4BPP_SRGB_BLOCK_IMG
  2436. >0 lelong 1000066000 ASTC_4x4_SFLOAT_BLOCK_EXT
  2437. >0 lelong 1000066001 ASTC_5x4_SFLOAT_BLOCK_EXT
  2438. >0 lelong 1000066002 ASTC_5x5_SFLOAT_BLOCK_EXT
  2439. >0 lelong 1000066003 ASTC_6x5_SFLOAT_BLOCK_EXT
  2440. >0 lelong 1000066004 ASTC_6x6_SFLOAT_BLOCK_EXT
  2441. >0 lelong 1000066005 ASTC_8x5_SFLOAT_BLOCK_EXT
  2442. >0 lelong 1000066006 ASTC_8x6_SFLOAT_BLOCK_EXT
  2443. >0 lelong 1000066007 ASTC_8x8_SFLOAT_BLOCK_EXT
  2444. >0 lelong 1000066008 ASTC_10x5_SFLOAT_BLOCK_EXT
  2445. >0 lelong 1000066009 ASTC_10x6_SFLOAT_BLOCK_EXT
  2446. >0 lelong 1000066010 ASTC_10x8_SFLOAT_BLOCK_EXT
  2447. >0 lelong 1000066011 ASTC_10x10_SFLOAT_BLOCK_EXT
  2448. >0 lelong 1000066012 ASTC_12x10_SFLOAT_BLOCK_EXT
  2449. >0 lelong 1000066013 ASTC_12x12_SFLOAT_BLOCK_EXT
  2450. # Main KTX2 header.
  2451. 0 string \xABKTX\ 20\xBB\r\n\x1A\n Khronos KTX2 texture
  2452. >20 lelong x \b, %u
  2453. >24 lelong >1 x %u
  2454. >28 lelong >1 x %u
  2455. >32 lelong >1 \b, %u layers
  2456. >36 lelong >1 \b, %u faces
  2457. >40 lelong >1 \b, %u mipmaps
  2458. >44 lelong >0 \b,
  2459. >>44 use khronos-ktx2-supercompression
  2460. >12 lelong >0 \b,
  2461. >>12 use khronos-ktx2-vkFormat
  2462. # Type: Valve VTF texture.
  2463. # From: David Korth <gerbilsoft@gerbilsoft.com>
  2464. # References:
  2465. # - https://developer.valvesoftware.com/wiki/Valve_Texture_Format
  2466. # VTF image formats.
  2467. 0 name vtf-image-format
  2468. >0 lelong 0 RGBA8888
  2469. >0 lelong 1 ABGR8888
  2470. >0 lelong 2 RGB888
  2471. >0 lelong 3 BGR888
  2472. >0 lelong 4 RGB565
  2473. >0 lelong 5 I8
  2474. >0 lelong 6 IA88
  2475. >0 lelong 7 P8
  2476. >0 lelong 8 A8
  2477. >0 lelong 9 RGB888 (bluescreen)
  2478. >0 lelong 10 BGR888 (bluescreen)
  2479. >0 lelong 11 ARGB8888
  2480. >0 lelong 12 BGRA8888
  2481. >0 lelong 13 DXT1
  2482. >0 lelong 14 DXT3
  2483. >0 lelong 15 DXT5
  2484. >0 lelong 16 BGRx8888
  2485. >0 lelong 17 BGR565
  2486. >0 lelong 18 BGRx5551
  2487. >0 lelong 19 BGRA4444
  2488. >0 lelong 20 DXT1+A1
  2489. >0 lelong 21 BGRA5551
  2490. >0 lelong 22 UV88
  2491. >0 lelong 23 UVWQ8888
  2492. >0 lelong 24 RGBA16161616F
  2493. >0 lelong 25 RGBA16161616
  2494. >0 lelong 26 UVLX8888
  2495. # Main VTF header.
  2496. 0 string VTF\0 Valve Texture Format
  2497. >4 lelong x v%u
  2498. >8 lelong x \b.%u
  2499. >0x10 leshort x \b, %u
  2500. >0x12 leshort >1 x %u
  2501. >4 lequad 0x0000000700000002
  2502. >>0x3F leshort >1 x %u
  2503. >0x18 leshort >1 \b, %u frames
  2504. >0x38 byte x \b, mipmaps: %u
  2505. >0x34 lelong >-1 \b,
  2506. >>0x34 use vtf-image-format
  2507. # Type: Valve VTF3 (PS3) texture.
  2508. # From: David Korth <gerbilsoft@gerbilsoft.com>
  2509. 0 string VTF3 Valve Texture Format (PS3)
  2510. >0x14 beshort x \b, %u
  2511. >0x16 beshort x \b x %u
  2512. >0x10 belong&0x2000 0 \b, DXT1
  2513. >0x10 belong&0x2000 0x2000 \b, DXT5
  2514. # Type: ASTC texture.
  2515. # From: David Korth <gerbilsoft@gerbilsoft.com>
  2516. # References:
  2517. # - https://stackoverflow.com/questions/22600678/determine-internal-format-of-given-astc-compressed-image-through-its-header
  2518. # - https://stackoverflow.com/a/22682244
  2519. 0 lelong 0x5ca1ab13 ASTC
  2520. >4 byte x %u
  2521. >5 byte x \bx%u
  2522. >6 byte >1 \bx%u
  2523. # X, Y, and Z dimensions are stored as 24-bit LE.
  2524. # Pretend it's 32-bit and mask off the high byte.
  2525. >7 lelong&0x00FFFFFF x texture, %u
  2526. >10 lelong&0x00FFFFFF x x %u
  2527. >13 lelong&0x00FFFFFF >1 x %u
  2528. # Zebra Metafile graphic
  2529. # http://www.fileformat.info/format/zbr/egff.htm
  2530. 0 beshort 0x9a02 Zebra Metafile graphic
  2531. >2 leshort 1 (version 1.x)
  2532. >2 leshort 2 (version 1.1x or 1.2x)
  2533. >2 leshort 3 (version 1.49)
  2534. >2 leshort 4 (version 1.50)
  2535. >4 string x (comment = %s)
  2536. # Microsoft Paint graphic
  2537. # http://www.fileformat.info/format/mspaint/egff.htm
  2538. 0 string DanM icrosoft Paint image data (version 1.x)
  2539. >4 leshort x (%d
  2540. >>6 leshort x x %d)
  2541. 0 string LinS Microsoft Paint image data (version 2.0)
  2542. >4 leshort x (%d
  2543. >>6 leshort x x %d)
  2544. # reMarkable tablet internal file format (https://www.remarkable.com/)
  2545. # https://github.com/ax3l/lines-are-beautiful
  2546. # https://plasma.ninja/blog/devices/remarkable/binary/format/2017/12/26/\
  2547. # reMarkable-lines-file-format.html#what-to-do-next
  2548. # from Axel Huebl
  2549. 0 string reMarkable
  2550. >11 string lines
  2551. >>17 string with
  2552. >>>22 string selections
  2553. >>>>33 string and
  2554. >>>>>37 string layers
  2555. >>>>>>43 lelong x reMarkable tablet notebook lines, 1404 x 1872, %x page(s)
  2556. # newer per-page files for the reMarkable
  2557. 0 string reMarkable
  2558. >11 string .lines
  2559. >>18 string file,
  2560. >>>24 string version=
  2561. >>>>32 byte x reMarkable tablet page (v%c), 1404 x 1872,
  2562. >>>>>43 lelong x %d layer(s)
  2563. # Type: PVR3 texture.
  2564. # From: David Korth <gerbilsoft@gerbilsoft.com>
  2565. # References:
  2566. # - http://cdn.imgtec.com/sdk-documentation/PVR+File+Format.Specification.pdf
  2567. # PVR3 pixel formats.
  2568. 0 name pvr3-pixel-format
  2569. >0 ulelong 0 PVRTC 2bpp RGB
  2570. >0 ulelong 1 PVRTC 2bpp RGBA
  2571. >0 ulelong 2 PVRTC 4bpp RGB
  2572. >0 ulelong 3 PVRTC 4bpp RGBA
  2573. >0 ulelong 4 PVRTC-II 2bpp
  2574. >0 ulelong 5 PVRTC-II 4bpp
  2575. >0 ulelong 6 ETC1
  2576. >0 ulelong 7 DXT1
  2577. >0 ulelong 8 DXT2
  2578. >0 ulelong 9 DXT3
  2579. >0 ulelong 10 DXT4
  2580. >0 ulelong 11 DXT5
  2581. >0 ulelong 12 BC4
  2582. >0 ulelong 13 BC5
  2583. >0 ulelong 14 BC6
  2584. >0 ulelong 15 BC7
  2585. >0 ulelong 16 UYVY
  2586. >0 ulelong 17 YUY2
  2587. >0 ulelong 18 BW1bpp
  2588. >0 ulelong 19 R9G9B9E5 Shared Exponent
  2589. >0 ulelong 20 RGBG8888
  2590. >0 ulelong 21 GRGB8888
  2591. >0 ulelong 22 ETC2 RGB
  2592. >0 ulelong 23 ETC2 RGBA
  2593. >0 ulelong 24 ETC2 RGB A1
  2594. >0 ulelong 25 EAC R11
  2595. >0 ulelong 26 EAC RG11
  2596. >0 ulelong 27 ASTC_4x4
  2597. >0 ulelong 28 ASTC_5x4
  2598. >0 ulelong 29 ASTC_5x5
  2599. >0 ulelong 30 ASTC_6x5
  2600. >0 ulelong 31 ASTC_6x6
  2601. >0 ulelong 32 ASTC_8x5
  2602. >0 ulelong 33 ASTC_8x6
  2603. >0 ulelong 34 ASTC_8x8
  2604. >0 ulelong 35 ASTC_10x5
  2605. >0 ulelong 36 ASTC_10x6
  2606. >0 ulelong 37 ASTC_10x8
  2607. >0 ulelong 38 ASTC_10x10
  2608. >0 ulelong 39 ASTC_12x10
  2609. >0 ulelong 40 ASTC_12x12
  2610. >0 ulelong 41 ASTC_3x3x3
  2611. >0 ulelong 42 ASTC_4x3x3
  2612. >0 ulelong 43 ASTC_4x4x3
  2613. >0 ulelong 44 ASTC_4x4x4
  2614. >0 ulelong 45 ASTC_5x4x4
  2615. >0 ulelong 46 ASTC_5x5x4
  2616. >0 ulelong 47 ASTC_5x5x5
  2617. >0 ulelong 48 ASTC_6x5x5
  2618. >0 ulelong 49 ASTC_6x6x5
  2619. >0 ulelong 50 ASTC_6x6x6
  2620. 0 string PVR\x03 PowerVR 3.0 texture:
  2621. >0x18 ulelong x %u x
  2622. >0x1C ulelong x %u
  2623. >0x20 ulelong >1 x %u
  2624. >0x08 byte x \b,
  2625. >0x0C ulelong 0
  2626. >>0x08 use pvr3-pixel-format
  2627. >0x0C ulelong !0
  2628. >>0x08 byte !0 %c
  2629. >>>0x0C byte !0 \b%u
  2630. >>0x09 byte !0 \b%c
  2631. >>>0x0D byte !0 \b%u
  2632. >>0x0A byte !0 \b%c
  2633. >>>0x0E byte !0 \b%u
  2634. >>0x0B byte !0 \b%c
  2635. >>>0x0F byte !0 \b%u
  2636. >0x10 ulelong 1 \b, sRGB
  2637. >0x04 ulelong&0x02 0x02 \b, premultiplied alpha
  2638. 0 string \x03RVP PowerVR 3.0 texture: BE,
  2639. >0x18 ubelong x %u x
  2640. >0x1C ubelong x %u
  2641. >0x20 ubelong >1 x %u
  2642. >0x08 byte x \b,
  2643. >0x0C ubelong 0
  2644. >>0x08 use pvr3-pixel-format
  2645. >0x0C ubelong !0
  2646. >>0x0B byte !0 %c
  2647. >>>0x0F byte !0 \b%u
  2648. >>0x0A byte !0 \b%c
  2649. >>>0x0E byte !0 \b%u
  2650. >>0x09 byte !0 \b%c
  2651. >>>0x0D byte !0 \b%u
  2652. >>0x08 byte !0 \b%c
  2653. >>>0x0C byte !0 \b%u
  2654. >0x10 ubelong 1 \b, sRGB
  2655. >0x04 ubelong&0x02 0x02 \b, premultiplied alpha
  2656. # Type: Microsoft Xbox XPR0 texture.
  2657. # From: David Korth <gerbilsoft@gerbilsoft.com>
  2658. # References:
  2659. # - https://github.com/Cxbx-Reloaded/Cxbx-Reloaded/blob/develop/src/core/hle/D3D8/XbD3D8Types.h
  2660. # XPR pixel formats.
  2661. 0 name xbox-xpr-pixel-format
  2662. >0 byte 0x00 L8
  2663. >0 byte 0x01 AL8
  2664. >0 byte 0x02 ARGB1555
  2665. >0 byte 0x03 RGB555
  2666. >0 byte 0x04 ARGB4444
  2667. >0 byte 0x05 RGB565
  2668. >0 byte 0x06 ARGB8888
  2669. >0 byte 0x07 xRGB8888
  2670. >0 byte 0x0B P8
  2671. >0 byte 0x0C DXT1
  2672. >0 byte 0x0E DXT2
  2673. >0 byte 0x0F DXT4
  2674. >0 byte 0x10 Linear ARGB1555
  2675. >0 byte 0x11 Linear RGB565
  2676. >0 byte 0x12 Linear ARGB8888
  2677. >0 byte 0x13 Linear L8
  2678. >0 byte 0x16 Linear R8B8
  2679. >0 byte 0x17 Linear G8B8
  2680. >0 byte 0x19 A8
  2681. >0 byte 0x1A A8L8
  2682. >0 byte 0x1B Linear AL8
  2683. >0 byte 0x1C Linear RGB555
  2684. >0 byte 0x1D Linear ARGB4444
  2685. >0 byte 0x1E Linear xRGB8888
  2686. >0 byte 0x1F Linear A8
  2687. >0 byte 0x20 Linear A8L8
  2688. >0 byte 0x24 YUY2
  2689. >0 byte 0x25 UYVY
  2690. >0 byte 0x27 L6V5U5
  2691. >0 byte 0x28 V8U8
  2692. >0 byte 0x29 R8B8
  2693. >0 byte 0x2A D24S8
  2694. >0 byte 0x2B F24S8
  2695. >0 byte 0x2C D16
  2696. >0 byte 0x2D F16
  2697. >0 byte 0x2E Linear D24S8
  2698. >0 byte 0x2F Linear F24S8
  2699. >0 byte 0x30 Linear D16
  2700. >0 byte 0x31 Linear F16
  2701. >0 byte 0x32 L16
  2702. >0 byte 0x33 V16U16
  2703. >0 byte 0x35 Linear L16
  2704. >0 byte 0x36 Linear V16U16
  2705. >0 byte 0x37 Linear L6V5U5
  2706. >0 byte 0x38 RGBA5551
  2707. >0 byte 0x39 RGBA4444
  2708. >0 byte 0x3A QWVU8888
  2709. >0 byte 0x3B BGRA8888
  2710. >0 byte 0x3C RGBA8888
  2711. >0 byte 0x3D Linear RGBA5551
  2712. >0 byte 0x3E Linear RGBA4444
  2713. >0 byte 0x3F Linear ABGR8888
  2714. >0 byte 0x40 Linear BGRA8888
  2715. >0 byte 0x41 Linear RGBA8888
  2716. >0 byte 0x64 Vertex Data
  2717. 0 string XPR0 Microsoft Xbox XPR0 texture
  2718. >0x19 byte x \b, format:
  2719. >>0x19 use xbox-xpr-pixel-format
  2720. # ILDA Image Data Transfer Format
  2721. # https://www.ilda.com/resources/StandardsDocs/ILDA_IDTF14_rev011.pdf
  2722. #
  2723. # Updated by Chuck Hein (laser@geekdude.com)
  2724. #
  2725. 0 string ILDA ILDA Image Data Transfer Format
  2726. >7 byte 0x00 3D Coordinates with Indexed Color
  2727. >7 byte 0x01 2D Coordinates with Indexed Color
  2728. >7 byte 0x02 Color Palette
  2729. >7 byte 0x04 3D Coordinates with True Color
  2730. >7 byte 0x05 2D Coordinates with True Color
  2731. >8 string >0 \b, palette %s
  2732. >16 string >0 \b, company %s
  2733. >24 beshort >0 \b, number of records %d
  2734. >>26 beshort x \b, palette number %d
  2735. >>28 beshort >0 \b, number of frames %d
  2736. >>30 byte >0 \b, projector number %d
  2737. # Dropbox "lepton" compressed jpeg format
  2738. # https://github.com/dropbox/lepton
  2739. 0 belong&0xfffff0ff 0xcf84005a Lepton image file
  2740. >2 byte x (version %d)
  2741. # Apple QuickTake camera raw images
  2742. # https://en.wikipedia.org/wiki/Apple_QuickTake
  2743. # dcraw can decode them
  2744. 0 name quicktake
  2745. >4 belong 8
  2746. >>544 beshort x \b, %dx
  2747. >>546 beshort x \b%d
  2748. >4 belong 4
  2749. >>546 beshort x \b, %dx
  2750. >>544 beshort x \b%d
  2751. 0 string qktk Apple QuickTake 100 Raw Image
  2752. >0 use quicktake
  2753. 0 string qktn
  2754. >4 byte 0 Apple QuickTake 150 Raw Image
  2755. >4 byte >0 Apple QuickTake 200 Raw Image
  2756. >0 use quicktake
  2757. # From: Joerg Jenderek
  2758. # URL: http://fileformats.archiveteam.org/wiki/Corel_Photo-Paint_image
  2759. # Reference: http://blog.argasinski.eu/wp-content/uploads/2011/08/cpt-specification-0.01.pdf
  2760. 0 string CPT
  2761. >4 string FILE Corel Photo-Paint image, version
  2762. # version like 7, 9 or 8
  2763. >>3 ubyte x %c,
  2764. !:mime image/x-corel-cpt
  2765. !:ext cpt
  2766. # if blocks_array_offset available jump blockNumber*8 bytes
  2767. >>0x34 ulelong >0
  2768. >>>(0x28.l*8) ubyte x
  2769. # jump additional stored blocks_array_offset bytes forward to object block
  2770. >>>>&(0x34.l-1) ulelong x %u
  2771. # object height in pixels
  2772. >>>>>&0 ulelong x x %u
  2773. # if no blocks_array_offset available jump blockNumber*8 bytes
  2774. >>0x34 ulelong =0
  2775. >>>(0x28.l*8) ubyte x
  2776. # jump additional 0x13C bytes forward to object block
  2777. >>>>&0x13B ulelong x %u
  2778. >>>>>&0 ulelong x x %u
  2779. # image color model used
  2780. >>0x8 ulelong x
  2781. >>>0x8 ulelong 0x1 RGB 24 bits
  2782. >>>0x8 ulelong 0x3 CMYK 24 bits
  2783. >>>0x8 ulelong 0x5 greyscale 8 bits
  2784. >>>0x8 ulelong 0x6 black and white 1 bit
  2785. >>>0x8 ulelong 0xA RGB 8 bits
  2786. # palette_length number of colors * 3 in case of 8-bit RGB paletted image
  2787. # 0 otherwise. Allowed values: 0 or [1..256] * 3
  2788. #>>0xC ulelong >0 \b, palette length %u
  2789. >>>>0xC ulelong/3 <256 \b, %u colors
  2790. >>>0x8 ulelong 0xB LAB
  2791. >>>0x8 ulelong 0xC RGB 48 bits
  2792. >>>0x8 ulelong 0xE greyscale 16 bits
  2793. # this should not happen
  2794. >>>0x8 default x color model
  2795. >>>>0x8 ulelong x %#x
  2796. # bit 1 in CPT file flags: UCS-2 file comment present
  2797. >>0x31 ubyte &0x02
  2798. # look for comment marker
  2799. >>>0x100 search/0xc9d \4\2\0\0
  2800. # UCS-2 file comment
  2801. >>>>&0 lestring16 x "%s"
  2802. # if no UCS-2 is present show ANSI file comment[112] if available
  2803. >>0x31 ubyte&0x02 =0
  2804. >>>0x3C string >\0 "%-.112s"
  2805. # reserved seems to be always 0
  2806. #>>0x10 ulelong >0 \b, reserved1 %u
  2807. # horizontal real dpi = dpi_h * 25.4 / 10**6
  2808. >>0x18 ulelong x \b, %u micro dots/mm
  2809. # image vertical DPI in CPT DPI unit
  2810. #>>0x1C ulelong x \b, %u micro dots/mm
  2811. # reserved seems to be always 0
  2812. #>>0x20 ulelong >0 \b, reserved2 %u
  2813. #>>0x24 ulelong >0 \b, reserved3 %u
  2814. # blocks_count; number of CPT_Block blocks. Allowed values: > 0
  2815. >>0x28 ulelong x \b, %u block
  2816. # plural s
  2817. >>0x28 ulelong !1 \bs
  2818. # CPT file flags
  2819. # lower byte of CPT file flags: 0x94~CPT9FILE 0x01~often CPT7FILE 0x8C~CPT8FILE
  2820. #>>0x30 ubyte x \b, lower flags %#x
  2821. # upper byte of CPT file flags:
  2822. #>>0x31 ubyte >0 \b, upper flags %#x
  2823. # bit 2 in CPT file flags: unknown
  2824. #>>0x31 ubyte &0x04 \b, with UNKNOWN
  2825. # bits 3-7 in CPT file flags: unknown, seem to be often 0
  2826. # show unusual flag combinations
  2827. >>0x31 ubyte&0xFC >0
  2828. >>>0x30 uleshort x \b, flags %#4.4x
  2829. # reserved seems to be always 0
  2830. #>>0x32 uleshort >0 \b, reserved4 %#x
  2831. # blocks_array_offset is always 0 for CPT7 and CPT8 files created by PP7-PP8
  2832. # typical values like: 13Ch 154h 43Ch 4F0h DA8h
  2833. >>0x34 ulelong x \b, array offset %#x
  2834. # reserved seems to be often 0
  2835. >>0x38 ulelong >0 \b, reserved5 %#x
  2836. # possible next master block
  2837. #>>0x100 ubequad !0 \b, next block=%#llx...
  2838. # bit 0: ICC profile block present
  2839. >>0x31 ubyte &0x01 \b, with ICC profile
  2840. # check for characteristic string acsp of color profile for DEBUGGING
  2841. #>>>0x178 string x icc=%.4s
  2842. # display ICC/ICM color profile by ./icc
  2843. #>>>0x154 use color-profile
  2844. # Type: Crunch compressed texture.
  2845. # From: David Korth <gerbilsoft@gerbilsoft.com>
  2846. # References:
  2847. # - https://github.com/BinomialLLC/crunch/blob/44c8402e24441c7524ca364941fd224ab3b971e9/inc/crn_decomp.h#L267
  2848. 0 ubelong 0x4878004A Crunch compressed texture:
  2849. >0x0C ubeshort x %u x
  2850. >0x0E ubeshort x %u
  2851. >0x12 ubyte 0 \b, DXT1
  2852. >0x12 ubyte 1 \b, DXT3
  2853. >0x12 ubyte 2 \b, DXT5
  2854. >0x12 ubyte 3 \b, DXT5 CCxY
  2855. >0x12 ubyte 4 \b, DXT5 xGxR
  2856. >0x12 ubyte 5 \b, DXT5 xGBR
  2857. >0x12 ubyte 6 \b, DXT5 AGBR
  2858. >0x12 ubyte 7 \b, DXn XY
  2859. >0x12 ubyte 8 \b, DXn YX
  2860. >0x12 ubyte 9 \b, DXT5 Alpha
  2861. >0x12 ubyte 10 \b, ETC1
  2862. >0x10 ubyte >1 \b, %u images
  2863. >0x11 ubyte >1 \b, %u faces
  2864. # TODO: Flags at 0x13? (ubeshort)
  2865. # Type: BasisLZ compressed texture.
  2866. # From: David Korth <gerbilsoft@gerbilsoft.com>
  2867. # References:
  2868. # - https://github.com/BinomialLLC/basis_universal/blob/master/spec/basis_spec.txt
  2869. 0 uleshort 0x4273
  2870. >0x04 uleshort 0x4D BasisLZ
  2871. >>0x02 uleshort x v%x compressed texture:
  2872. >>0x14 ubyte 0 ETC1S
  2873. >>0x14 ubyte 1 UASTC 4x4
  2874. >>0x0E ulelong&0xFFFFFF >1 \b, %u slices
  2875. >>0x11 ulelong&0xFFFFFF >1 \b, %u images
  2876. >>0x15 uleshort&0x02 2 \b, Y-flipped
  2877. # MIME registration: https://www.iana.org/assignments/media-types/model/e57
  2878. # Sample files: http://www.libe57.org/data.html
  2879. # Reference implementation: http://www.libe57.org/
  2880. # https://www.ri.cmu.edu/pub_files/2011/1/2011-huber-e57-v3.pdf
  2881. 0 string ASTM-E57 ASTM E57 three-dimensional model
  2882. !:mime model/e57
  2883. !:ext e57