1284194Sdelphij
2284194Sdelphij#------------------------------------------------------------------------------
3284194Sdelphij# $File: images,v 1.102 2015/01/02 02:36:35 christos Exp $
4284194Sdelphij# images:  file(1) magic for image formats (see also "iff", and "c-lang" for
5284194Sdelphij# XPM bitmaps)
6284194Sdelphij#
7284194Sdelphij# originally from jef@helios.ee.lbl.gov (Jef Poskanzer),
8284194Sdelphij# additions by janl@ifi.uio.no as well as others. Jan also suggested
9284194Sdelphij# merging several one- and two-line files into here.
10284194Sdelphij#
11284194Sdelphij# little magic: PCX (first byte is 0x0a)
12284194Sdelphij
13284194Sdelphij# Targa - matches `povray', `ppmtotga' and `xv' outputs
14284194Sdelphij# by Philippe De Muyter <phdm@macqel.be>
15284194Sdelphij# at 2, byte ImgType must be 1, 2, 3, 9, 10 or 11
16284194Sdelphij# at 1, byte CoMapType must be 1 if ImgType is 1 or 9, 0 otherwise
17284194Sdelphij# at 3, leshort Index is 0 for povray, ppmtotga and xv outputs
18284194Sdelphij# `xv' recognizes only a subset of the following (RGB with pixelsize = 24)
19284194Sdelphij# `tgatoppm' recognizes a superset (Index may be anything)
20284194Sdelphij1	belong&0xfff7ffff	0x01010000	Targa image data - Map
21284194Sdelphij!:strength + 2
22284194Sdelphij>2	byte&8			8		- RLE
23284194Sdelphij>12	leshort			>0		%d x
24284194Sdelphij>14	leshort			>0		%d
25284194Sdelphij1	belong&0xfff7ffff	0x00020000	Targa image data - RGB
26284194Sdelphij!:strength + 2
27284194Sdelphij>2	byte&8			8		- RLE
28284194Sdelphij>12	leshort			>0		%d x
29284194Sdelphij>14	leshort			>0		%d
30284194Sdelphij1	belong&0xfff7ffff	0x00030000	Targa image data - Mono
31284194Sdelphij!:strength + 2
32284194Sdelphij>2	byte&8			8		- RLE
33284194Sdelphij>12	leshort			>0		%d x
34284194Sdelphij>14	leshort			>0		%d
35284194Sdelphij
36284194Sdelphij# PBMPLUS images
37284194Sdelphij# The next byte following the magic is always whitespace.
38284194Sdelphij# strength is changed to try these patterns before "x86 boot sector"
39284194Sdelphij0	search/1	P1		
40284194Sdelphij>3	regex		=[0-9]{0,50}\ [0-9]{0,50}		Netpbm PBM image text
41284194Sdelphij>3	regex		=[0-9]{1,50}\ 		\b, size = %sx
42284194Sdelphij>>3	regex		=\ [0-9]{1,50}	\b%s
43284194Sdelphij!:strength + 45
44284194Sdelphij!:mime	image/x-portable-bitmap
45284194Sdelphij0	search/1	P2		
46284194Sdelphij>3	regex		=[0-9]{0,50}\ [0-9]{0,50}		Netpbm PGM image text
47284194Sdelphij>3	regex		=[0-9]{1,50}\ 		\b, size = %sx
48284194Sdelphij>>3	regex		=\ [0-9]{1,50}	\b%s
49284194Sdelphij!:strength + 45
50284194Sdelphij!:mime	image/x-portable-greymap
51284194Sdelphij0	search/1	P3
52284194Sdelphij>3	regex		=[0-9]{0,50}\ [0-9]{0,50}		Netpbm PPM image text
53284194Sdelphij>3	regex		=[0-9]{1,50}\ 		\b, size = %sx
54284194Sdelphij>>3	regex		=\ [0-9]{1,50}	\b%s
55284194Sdelphij!:strength + 45
56284194Sdelphij!:mime	image/x-portable-pixmap
57284194Sdelphij0	string		P4		
58284194Sdelphij>3	regex		=[0-9]{0,50}\ [0-9]{0,50}		Netpbm PBM "rawbits" image data
59284194Sdelphij>3	regex		=[0-9]{1,50}\ 		\b, size = %sx
60284194Sdelphij>>3	regex		=\ [0-9]{1,50}	\b%s
61284194Sdelphij!:strength + 45
62284194Sdelphij!:mime	image/x-portable-bitmap
63284194Sdelphij0	string		P5		
64284194Sdelphij>3	regex		=[0-9]{0,50}\ [0-9]{0,50}		Netpbm PGM "rawbits" image data
65284194Sdelphij>3	regex		=[0-9]{1,50}\ 		\b, size = %sx
66284194Sdelphij>>3	regex		=\ [0-9]{1,50}	\b%s
67284194Sdelphij!:strength + 45
68284194Sdelphij!:mime	image/x-portable-greymap
69284194Sdelphij0	string		P6		
70284194Sdelphij>3	regex		=[0-9]{0,50}\ [0-9]{0,50}		Netpbm PPM "rawbits" image data
71284194Sdelphij>3	regex		=[0-9]{1,50}\ 		\b, size = %sx
72284194Sdelphij>>3	regex		=\ [0-9]{1,50}	\b%s
73284194Sdelphij!:strength + 45
74284194Sdelphij!:mime	image/x-portable-pixmap
75284194Sdelphij0	string		P7		Netpbm PAM image file
76284194Sdelphij!:mime	image/x-portable-pixmap
77284194Sdelphij
78284194Sdelphij# From: bryanh@giraffe-data.com (Bryan Henderson)
79284194Sdelphij0	string		\117\072	Solitaire Image Recorder format
80284194Sdelphij>4	string		\013		MGI Type 11
81284194Sdelphij>4	string		\021		MGI Type 17
82284194Sdelphij0	string		.MDA		MicroDesign data
83284194Sdelphij>21	byte		48		version 2
84284194Sdelphij>21	byte		51		version 3
85284194Sdelphij0	string		.MDP		MicroDesign page data
86284194Sdelphij>21	byte		48		version 2
87284194Sdelphij>21	byte		51		version 3
88284194Sdelphij
89284194Sdelphij# NIFF (Navy Interchange File Format, a modification of TIFF) images
90284194Sdelphij# [GRR:  this *must* go before TIFF]
91284194Sdelphij0	string		IIN1		NIFF image data
92284194Sdelphij!:mime	image/x-niff
93284194Sdelphij
94284194Sdelphij# Canon RAW version 1 (CRW) files are a type of Canon Image File Format
95284194Sdelphij# (CIFF) file. These are apparently all little-endian.
96284194Sdelphij# From: Adam Buchbinder <adam.buchbinder@gmail.com>
97284194Sdelphij# URL: http://www.sno.phy.queensu.ca/~phil/exiftool/canon_raw.html
98284194Sdelphij0	string		II\x1a\0\0\0HEAPCCDR	Canon CIFF raw image data
99284194Sdelphij!:mime	image/x-canon-crw
100284194Sdelphij>16	leshort		x	\b, version %d.
101284194Sdelphij>14	leshort		x	\b%d
102284194Sdelphij
103284194Sdelphij# Canon RAW version 2 (CR2) files are a kind of TIFF with an extra magic
104284194Sdelphij# number. Put this above the TIFF test to make sure we detect them.
105284194Sdelphij# These are apparently all little-endian.
106284194Sdelphij# From: Adam Buchbinder <adam.buchbinder@gmail.com>
107284194Sdelphij# URL: http://libopenraw.freedesktop.org/wiki/Canon_CR2
108284194Sdelphij0	string		II\x2a\0\x10\0\0\0CR	Canon CR2 raw image data
109284194Sdelphij!:mime	image/x-canon-cr2
110284194Sdelphij>10	byte		x	\b, version %d.
111284194Sdelphij>11	byte		x	\b%d
112284194Sdelphij
113284194Sdelphij# Tag Image File Format, from Daniel Quinlan (quinlan@yggdrasil.com)
114284194Sdelphij# The second word of TIFF files is the TIFF version number, 42, which has
115284194Sdelphij# never changed.  The TIFF specification recommends testing for it.
116284194Sdelphij0	string		MM\x00\x2a	TIFF image data, big-endian
117284194Sdelphij!:mime	image/tiff
118284194Sdelphij>(4.L)	use		\^tiff_ifd
119284194Sdelphij0	string		II\x2a\x00	TIFF image data, little-endian
120284194Sdelphij!:mime	image/tiff
121284194Sdelphij>(4.l)	use		tiff_ifd
122284194Sdelphij
123284194Sdelphij0	name		tiff_ifd
124284194Sdelphij>0	leshort		x		\b, direntries=%d
125284194Sdelphij>2	use		tiff_entry
126284194Sdelphij
127284194Sdelphij0	name		tiff_entry
128284194Sdelphij# NewSubFileType
129284194Sdelphij>0	leshort		0xfe
130284194Sdelphij>>12	use		tiff_entry
131284194Sdelphij>0	leshort		0x100
132284194Sdelphij>>4	lelong		1
133284194Sdelphij>>>12	use		tiff_entry
134284194Sdelphij>>>8	leshort		x		\b, width=%d
135284194Sdelphij>0	leshort		0x101
136284194Sdelphij>>4	lelong		1
137284194Sdelphij>>>8	leshort		x		\b, height=%d
138284194Sdelphij>>>12	use		tiff_entry
139284194Sdelphij>0	leshort		0x102
140284194Sdelphij>>8	leshort		x		\b, bps=%d
141284194Sdelphij>>12	use		tiff_entry
142284194Sdelphij>0	leshort		0x103
143284194Sdelphij>>4	lelong		1		\b, compression=
144284194Sdelphij>>>8	leshort		1		\bnone
145284194Sdelphij>>>8	leshort		2		\bhuffman
146284194Sdelphij>>>8	leshort		3		\bbi-level group 3
147284194Sdelphij>>>8	leshort		4		\bbi-level group 4
148284194Sdelphij>>>8	leshort		5		\bLZW
149284194Sdelphij>>>8	leshort		6		\bJPEG (old)
150284194Sdelphij>>>8	leshort		7		\bJPEG
151284194Sdelphij>>>8	leshort		8		\bdeflate
152284194Sdelphij>>>8	leshort		9		\bJBIG, ITU-T T.85
153284194Sdelphij>>>8	leshort		0xa		\bJBIG, ITU-T T.43
154284194Sdelphij>>>8	leshort		0x7ffe		\bNeXT RLE 2-bit
155284194Sdelphij>>>8	leshort		0x8005		\bPackBits (Macintosh RLE)
156284194Sdelphij>>>8	leshort		0x8029		\bThunderscan RLE
157284194Sdelphij>>>8	leshort		0x807f		\bRasterPadding (CT or MP)
158284194Sdelphij>>>8	leshort		0x8080		\bRLE (Line Work)
159284194Sdelphij>>>8	leshort		0x8081		\bRLE (High-Res Cont-Tone)
160284194Sdelphij>>>8	leshort		0x8082		\bRLE (Binary Line Work)
161284194Sdelphij>>>8	leshort		0x80b2		\bDeflate (PKZIP)
162284194Sdelphij>>>8	leshort		0x80b3		\bKodak DCS
163284194Sdelphij>>>8	leshort		0x8765		\bJBIG
164284194Sdelphij>>>8	leshort		0x8798		\bJPEG2000
165284194Sdelphij>>>8	leshort		0x8799		\bNikon NEF Compressed
166284194Sdelphij>>>8	default		x	
167284194Sdelphij>>>>8	leshort		x		\b(unknown 0x%x)
168284194Sdelphij>>>12	use		tiff_entry
169284194Sdelphij>0	leshort		0x106		\b, PhotometricIntepretation=
170284194Sdelphij>>8	leshort		0		\bWhiteIsZero
171284194Sdelphij>>8	leshort		1		\bBlackIsZero
172284194Sdelphij>>8	leshort		2		\bRGB
173284194Sdelphij>>8	leshort		3		\bRGB Palette
174284194Sdelphij>>8	leshort		4		\bTransparency Mask
175284194Sdelphij>>8	leshort		5		\bCMYK
176284194Sdelphij>>8	leshort		6		\bYCbCr
177284194Sdelphij>>8	leshort		8		\bCIELab
178284194Sdelphij>>>8	leshort		x		\b(unknown=0x%x)
179284194Sdelphij>>12	use		tiff_entry
180284194Sdelphij# FillOrder
181284194Sdelphij>0	leshort		0x10a
182284194Sdelphij>>4	lelong		1
183284194Sdelphij>>>12	use		tiff_entry
184284194Sdelphij# DocumentName
185284194Sdelphij>0	leshort		0x10d
186284194Sdelphij>>(8.l)	string		x		\b, name=%s
187284194Sdelphij>>>12	use		tiff_entry
188284194Sdelphij# ImageDescription
189284194Sdelphij>0	leshort		0x10e
190284194Sdelphij>>(8.l)	string		x		\b, description=%s
191284194Sdelphij>>>12	use		tiff_entry
192284194Sdelphij# Make
193284194Sdelphij>0	leshort		0x10f
194284194Sdelphij>>(8.l)	string		x		\b, manufacturer=%s
195284194Sdelphij>>>12	use		tiff_entry
196284194Sdelphij# Model
197284194Sdelphij>0	leshort		0x110
198284194Sdelphij>>(8.l)	string		x		\b, model=%s
199284194Sdelphij>>>12	use		tiff_entry
200284194Sdelphij# StripOffsets
201284194Sdelphij>0	leshort		0x111
202284194Sdelphij>>12	use		tiff_entry
203284194Sdelphij# Orientation
204284194Sdelphij>0	leshort		0x112		\b, orientation=
205284194Sdelphij>>8	leshort		1		\bupper-left
206284194Sdelphij>>8	leshort		3		\blower-right
207284194Sdelphij>>8	leshort		6		\bupper-right
208284194Sdelphij>>8	leshort		8		\blower-left
209284194Sdelphij>>8	leshort		9		\bundefined
210284194Sdelphij>>8	default		x
211284194Sdelphij>>>8	leshort		x		\b[*%d*]
212284194Sdelphij>>12	use		tiff_entry
213284194Sdelphij# XResolution
214284194Sdelphij>0	leshort		0x11a
215284194Sdelphij>>8	lelong		x		\b, xresolution=%d
216284194Sdelphij>>12	use		tiff_entry
217284194Sdelphij# YResolution
218284194Sdelphij>0	leshort		0x11b
219284194Sdelphij>>8	lelong		x		\b, yresolution=%d
220284194Sdelphij>>12	use		tiff_entry
221284194Sdelphij# ResolutionUnit
222284194Sdelphij>0	leshort		0x128
223284194Sdelphij>>8	leshort		x		\b, resolutionunit=%d
224284194Sdelphij>>12	use		tiff_entry
225284194Sdelphij# Software
226284194Sdelphij>0	leshort		0x131
227284194Sdelphij>>(8.l)	string		x		\b, software=%s
228284194Sdelphij>>12	use		tiff_entry
229284194Sdelphij# Datetime
230284194Sdelphij>0	leshort		0x132
231284194Sdelphij>>(8.l)	string		x		\b, datetime=%s
232284194Sdelphij>>12	use		tiff_entry
233284194Sdelphij# HostComputer
234284194Sdelphij>0	leshort		0x13c
235284194Sdelphij>>(8.l)	string		x		\b, hostcomputer=%s
236284194Sdelphij>>12	use		tiff_entry
237284194Sdelphij# WhitePoint
238284194Sdelphij>0	leshort		0x13e
239284194Sdelphij>>12	use		tiff_entry
240284194Sdelphij# PrimaryChromaticities
241284194Sdelphij>0	leshort		0x13f
242284194Sdelphij>>12	use		tiff_entry
243284194Sdelphij# YCbCrCoefficients
244284194Sdelphij>0	leshort		0x211
245284194Sdelphij>>12	use		tiff_entry
246284194Sdelphij# YCbCrPositioning
247284194Sdelphij>0	leshort		0x213
248284194Sdelphij>>12	use		tiff_entry
249284194Sdelphij# ReferenceBlackWhite
250284194Sdelphij>0	leshort		0x214
251284194Sdelphij>>12	use		tiff_entry
252284194Sdelphij# Copyright
253284194Sdelphij>0	leshort		0x8298
254284194Sdelphij>>(8.l)	string		x		\b, copyright=%s
255284194Sdelphij>>12	use		tiff_entry
256284194Sdelphij# ExifOffset
257284194Sdelphij>0	leshort		0x8769
258284194Sdelphij>>12	use		tiff_entry
259284194Sdelphij# GPS IFD
260284194Sdelphij>0	leshort		0x8825		\b, GPS-Data
261284194Sdelphij>>12	use		tiff_entry
262284194Sdelphij
263284194Sdelphij#>0	leshort		x		\b, unknown=0x%x
264284194Sdelphij#>>12	use		tiff_entry
265284194Sdelphij
266284194Sdelphij0	string		MM\x00\x2b	Big TIFF image data, big-endian
267284194Sdelphij!:mime	image/tiff
268284194Sdelphij0	string		II\x2b\x00	Big TIFF image data, little-endian
269284194Sdelphij!:mime	image/tiff
270284194Sdelphij
271284194Sdelphij# PNG [Portable Network Graphics, or "PNG's Not GIF"] images
272284194Sdelphij# (Greg Roelofs, newt@uchicago.edu)
273284194Sdelphij# (Albert Cahalan, acahalan@cs.uml.edu)
274284194Sdelphij#
275284194Sdelphij# 137 P N G \r \n ^Z \n [4-byte length] H E A D [HEAD data] [HEAD crc] ...
276284194Sdelphij#
277284194Sdelphij0	string		\x89PNG\x0d\x0a\x1a\x0a		PNG image data
278284194Sdelphij!:mime	image/png
279284194Sdelphij>16	belong		x		\b, %d x
280284194Sdelphij>20	belong		x		%d,
281284194Sdelphij>24	byte		x		%d-bit
282284194Sdelphij>25	byte		0		grayscale,
283284194Sdelphij>25	byte		2		\b/color RGB,
284284194Sdelphij>25	byte		3		colormap,
285284194Sdelphij>25	byte		4		gray+alpha,
286284194Sdelphij>25	byte		6		\b/color RGBA,
287284194Sdelphij#>26	byte		0		deflate/32K,
288284194Sdelphij>28	byte		0		non-interlaced
289284194Sdelphij>28	byte		1		interlaced
290284194Sdelphij
291284194Sdelphij# possible GIF replacements; none yet released!
292284194Sdelphij# (Greg Roelofs, newt@uchicago.edu)
293284194Sdelphij#
294284194Sdelphij# GRR 950115:  this was mine ("Zip GIF"):
295284194Sdelphij0	string		GIF94z		ZIF image (GIF+deflate alpha)
296284194Sdelphij!:mime	image/x-unknown
297284194Sdelphij#
298284194Sdelphij# GRR 950115:  this is Jeremy Wohl's Free Graphics Format (better):
299284194Sdelphij#					
300284194Sdelphij0	string		FGF95a		FGF image (GIF+deflate beta)
301284194Sdelphij!:mime	image/x-unknown
302284194Sdelphij#
303284194Sdelphij# GRR 950115:  this is Thomas Boutell's Portable Bitmap Format proposal
304284194Sdelphij# (best; not yet implemented):
305284194Sdelphij#					
306284194Sdelphij0	string		PBF		PBF image (deflate compression)
307284194Sdelphij!:mime	image/x-unknown
308284194Sdelphij
309284194Sdelphij# GIF
310284194Sdelphij0	string		GIF8		GIF image data
311284194Sdelphij!:mime	image/gif
312284194Sdelphij!:apple	8BIMGIFf
313284194Sdelphij>4	string		7a		\b, version 8%s,
314284194Sdelphij>4	string		9a		\b, version 8%s,
315284194Sdelphij>6	leshort		>0		%d x
316284194Sdelphij>8	leshort		>0		%d
317284194Sdelphij#>10	byte		&0x80		color mapped,
318284194Sdelphij#>10	byte&0x07	=0x00		2 colors
319284194Sdelphij#>10	byte&0x07	=0x01		4 colors
320284194Sdelphij#>10	byte&0x07	=0x02		8 colors
321284194Sdelphij#>10	byte&0x07	=0x03		16 colors
322284194Sdelphij#>10	byte&0x07	=0x04		32 colors
323284194Sdelphij#>10	byte&0x07	=0x05		64 colors
324284194Sdelphij#>10	byte&0x07	=0x06		128 colors
325284194Sdelphij#>10	byte&0x07	=0x07		256 colors
326284194Sdelphij
327284194Sdelphij# ITC (CMU WM) raster files.  It is essentially a byte-reversed Sun raster,
328284194Sdelphij# 1 plane, no encoding.
329284194Sdelphij0	string		\361\0\100\273	CMU window manager raster image data
330284194Sdelphij>4	lelong		>0		%d x
331284194Sdelphij>8	lelong		>0		%d,
332284194Sdelphij>12	lelong		>0		%d-bit
333284194Sdelphij
334284194Sdelphij# Magick Image File Format
335284194Sdelphij0	string		id=ImageMagick	MIFF image data
336284194Sdelphij
337284194Sdelphij# Artisan
338284194Sdelphij0	long		1123028772	Artisan image data
339284194Sdelphij>4	long		1		\b, rectangular 24-bit
340284194Sdelphij>4	long		2		\b, rectangular 8-bit with colormap
341284194Sdelphij>4	long		3		\b, rectangular 32-bit (24-bit with matte)
342284194Sdelphij
343284194Sdelphij# FIG (Facility for Interactive Generation of figures), an object-based format
344284194Sdelphij0	search/1	#FIG		FIG image text
345284194Sdelphij>5	string		x		\b, version %.3s
346284194Sdelphij
347284194Sdelphij# PHIGS
348284194Sdelphij0	string		ARF_BEGARF		PHIGS clear text archive
349284194Sdelphij0	string		@(#)SunPHIGS		SunPHIGS
350284194Sdelphij# version number follows, in the form m.n
351284194Sdelphij>40	string		SunBin			binary
352284194Sdelphij>32	string		archive			archive
353284194Sdelphij
354284194Sdelphij# GKS (Graphics Kernel System)
355284194Sdelphij0	string		GKSM		GKS Metafile
356284194Sdelphij>24	string		SunGKS		\b, SunGKS
357284194Sdelphij
358284194Sdelphij# CGM image files
359284194Sdelphij0	string		BEGMF		clear text Computer Graphics Metafile
360284194Sdelphij
361284194Sdelphij# MGR bitmaps  (Michael Haardt, u31b3hs@pool.informatik.rwth-aachen.de)
362284194Sdelphij0	string	yz	MGR bitmap, modern format, 8-bit aligned
363284194Sdelphij0	string	zz	MGR bitmap, old format, 1-bit deep, 16-bit aligned
364284194Sdelphij0	string	xz	MGR bitmap, old format, 1-bit deep, 32-bit aligned
365284194Sdelphij0	string	yx	MGR bitmap, modern format, squeezed
366284194Sdelphij
367284194Sdelphij# Fuzzy Bitmap (FBM) images
368284194Sdelphij0	string		%bitmap\0	FBM image data
369284194Sdelphij>30	long		0x31		\b, mono
370284194Sdelphij>30	long		0x33		\b, color
371284194Sdelphij
372284194Sdelphij# facsimile data
373284194Sdelphij1	string		PC\ Research,\ Inc	group 3 fax data
374284194Sdelphij>29	byte		0		\b, normal resolution (204x98 DPI)
375284194Sdelphij>29	byte		1		\b, fine resolution (204x196 DPI)
376284194Sdelphij# From: Herbert Rosmanith <herp@wildsau.idv.uni.linz.at>
377284194Sdelphij0	string		Sfff		structured fax file
378284194Sdelphij
379284194Sdelphij# From: Joerg Jenderek <joerg.jen.der.ek@gmx.net>
380284194Sdelphij# most files with the extension .EPA and some with .BMP
381284194Sdelphij0	string		\x11\x06	Award BIOS Logo, 136 x 84
382284194Sdelphij!:mime	image/x-award-bioslogo
383284194Sdelphij0	string		\x11\x09	Award BIOS Logo, 136 x 126
384284194Sdelphij!:mime	image/x-award-bioslogo
385284194Sdelphij#0	string		\x07\x1f	BIOS Logo corrupted?
386284194Sdelphij# http://www.blackfiveservices.co.uk/awbmtools.shtml
387284194Sdelphij# http://biosgfx.narod.ru/v3/
388284194Sdelphij# http://biosgfx.narod.ru/abr-2/
389284194Sdelphij0	string		AWBM		
390284194Sdelphij>4	leshort		<1981		Award BIOS bitmap
391284194Sdelphij!:mime	image/x-award-bmp
392284194Sdelphij# image width is a multiple of 4
393284194Sdelphij>>4	leshort&0x0003	0		
394284194Sdelphij>>>4		leshort	x		\b, %d
395284194Sdelphij>>>6		leshort	x		x %d
396284194Sdelphij>>4	leshort&0x0003	>0		\b,
397284194Sdelphij>>>4	leshort&0x0003	=1		
398284194Sdelphij>>>>4		leshort	x		%d+3
399284194Sdelphij>>>4	leshort&0x0003	=2		
400284194Sdelphij>>>>4		leshort	x		%d+2
401284194Sdelphij>>>4	leshort&0x0003	=3		
402284194Sdelphij>>>>4		leshort	x		%d+1
403284194Sdelphij>>>6		leshort	x		x %d
404284194Sdelphij# at offset 8 starts imagedata followed by "RGB " marker
405284194Sdelphij
406284194Sdelphij# PC bitmaps (OS/2, Windows BMP files)  (Greg Roelofs, newt@uchicago.edu)
407284194Sdelphij# http://en.wikipedia.org/wiki/BMP_file_format#DIB_header_.\
408284194Sdelphij# 28bitmap_information_header.29
409284194Sdelphij0	string		BM
410284194Sdelphij>14	leshort		12		PC bitmap, OS/2 1.x format
411284194Sdelphij!:mime	image/x-ms-bmp
412284194Sdelphij>>18	leshort		x		\b, %d x
413284194Sdelphij>>20	leshort		x		%d
414284194Sdelphij>14	leshort		64		PC bitmap, OS/2 2.x format
415284194Sdelphij!:mime	image/x-ms-bmp
416284194Sdelphij>>18	leshort		x		\b, %d x
417284194Sdelphij>>20	leshort		x		%d
418284194Sdelphij>14	leshort		40		PC bitmap, Windows 3.x format
419284194Sdelphij!:mime	image/x-ms-bmp
420284194Sdelphij>>18	lelong		x		\b, %d x
421284194Sdelphij>>22	lelong		x		%d x
422284194Sdelphij>>28	leshort		x		%d
423284194Sdelphij>14	leshort		124		PC bitmap, Windows 98/2000 and newer format
424284194Sdelphij!:mime	image/x-ms-bmp
425284194Sdelphij>>18	lelong		x		\b, %d x
426284194Sdelphij>>22	lelong		x		%d x
427284194Sdelphij>>28	leshort		x		%d
428284194Sdelphij>14	leshort		108		PC bitmap, Windows 95/NT4 and newer format
429284194Sdelphij!:mime	image/x-ms-bmp
430284194Sdelphij>>18	lelong		x		\b, %d x
431284194Sdelphij>>22	lelong		x		%d x
432284194Sdelphij>>28	leshort		x		%d
433284194Sdelphij>14	leshort		128		PC bitmap, Windows NT/2000 format
434284194Sdelphij!:mime	image/x-ms-bmp
435284194Sdelphij>>18	lelong		x		\b, %d x
436284194Sdelphij>>22	lelong		x		%d x
437284194Sdelphij>>28	leshort		x		%d
438284194Sdelphij# Too simple - MPi
439284194Sdelphij#0	string		IC		PC icon data
440284194Sdelphij#0	string		PI		PC pointer image data
441284194Sdelphij#0	string		CI		PC color icon data
442284194Sdelphij#0	string		CP		PC color pointer image data
443284194Sdelphij# Conflicts with other entries [BABYL]
444284194Sdelphij#0	string		BA		PC bitmap array data
445284194Sdelphij
446284194Sdelphij# XPM icons (Greg Roelofs, newt@uchicago.edu)
447284194Sdelphij0	search/1	/*\ XPM\ */	X pixmap image text
448284194Sdelphij!:mime	image/x-xpmi
449284194Sdelphij
450284194Sdelphij# Utah Raster Toolkit RLE images (janl@ifi.uio.no)
451284194Sdelphij0	leshort		0xcc52		RLE image data,
452284194Sdelphij>6	leshort		x		%d x
453284194Sdelphij>8	leshort		x		%d
454284194Sdelphij>2	leshort		>0		\b, lower left corner: %d
455284194Sdelphij>4	leshort		>0		\b, lower right corner: %d
456284194Sdelphij>10	byte&0x1	=0x1		\b, clear first
457284194Sdelphij>10	byte&0x2	=0x2		\b, no background
458284194Sdelphij>10	byte&0x4	=0x4		\b, alpha channel
459284194Sdelphij>10	byte&0x8	=0x8		\b, comment
460284194Sdelphij>11	byte		>0		\b, %d color channels
461284194Sdelphij>12	byte		>0		\b, %d bits per pixel
462284194Sdelphij>13	byte		>0		\b, %d color map channels
463284194Sdelphij
464284194Sdelphij# image file format (Robert Potter, potter@cs.rochester.edu)
465284194Sdelphij0	string		Imagefile\ version-	iff image data
466284194Sdelphij# this adds the whole header (inc. version number), informative but longish
467284194Sdelphij>10	string		>\0		%s
468284194Sdelphij
469284194Sdelphij# Sun raster images, from Daniel Quinlan (quinlan@yggdrasil.com)
470284194Sdelphij0	belong		0x59a66a95	Sun raster image data
471284194Sdelphij>4	belong		>0		\b, %d x
472284194Sdelphij>8	belong		>0		%d,
473284194Sdelphij>12	belong		>0		%d-bit,
474284194Sdelphij#>16	belong		>0		%d bytes long,
475284194Sdelphij>20	belong		0		old format,
476284194Sdelphij#>20	belong		1		standard,
477284194Sdelphij>20	belong		2		compressed,
478284194Sdelphij>20	belong		3		RGB,
479284194Sdelphij>20	belong		4		TIFF,
480284194Sdelphij>20	belong		5		IFF,
481284194Sdelphij>20	belong		0xffff		reserved for testing,
482284194Sdelphij>24	belong		0		no colormap
483284194Sdelphij>24	belong		1		RGB colormap
484284194Sdelphij>24	belong		2		raw colormap
485284194Sdelphij#>28	belong		>0		colormap is %d bytes long
486284194Sdelphij
487284194Sdelphij# SGI image file format, from Daniel Quinlan (quinlan@yggdrasil.com)
488284194Sdelphij#
489284194Sdelphij# See
490284194Sdelphij#	http://reality.sgi.com/grafica/sgiimage.html
491284194Sdelphij#
492284194Sdelphij0	beshort		474		SGI image data
493284194Sdelphij#>2	byte		0		\b, verbatim
494284194Sdelphij>2	byte		1		\b, RLE
495284194Sdelphij#>3	byte		1		\b, normal precision
496284194Sdelphij>3	byte		2		\b, high precision
497284194Sdelphij>4	beshort		x		\b, %d-D
498284194Sdelphij>6	beshort		x		\b, %d x
499284194Sdelphij>8	beshort		x		%d
500284194Sdelphij>10	beshort		x		\b, %d channel
501284194Sdelphij>10	beshort		!1		\bs
502284194Sdelphij>80	string		>0		\b, "%s"
503284194Sdelphij
504284194Sdelphij0	string		IT01		FIT image data
505284194Sdelphij>4	belong		x		\b, %d x
506284194Sdelphij>8	belong		x		%d x
507284194Sdelphij>12	belong		x		%d
508284194Sdelphij#
509284194Sdelphij0	string		IT02		FIT image data
510284194Sdelphij>4	belong		x		\b, %d x
511284194Sdelphij>8	belong		x		%d x
512284194Sdelphij>12	belong		x		%d
513284194Sdelphij#
514284194Sdelphij2048	string		PCD_IPI		Kodak Photo CD image pack file
515284194Sdelphij>0xe02	byte&0x03	0x00		, landscape mode
516284194Sdelphij>0xe02	byte&0x03	0x01		, portrait mode
517284194Sdelphij>0xe02	byte&0x03	0x02		, landscape mode
518284194Sdelphij>0xe02	byte&0x03	0x03		, portrait mode
519284194Sdelphij0	string		PCD_OPA		Kodak Photo CD overview pack file
520284194Sdelphij
521284194Sdelphij# FITS format.  Jeff Uphoff <juphoff@tarsier.cv.nrao.edu>
522284194Sdelphij# FITS is the Flexible Image Transport System, the de facto standard for
523284194Sdelphij# data and image transfer, storage, etc., for the astronomical community.
524284194Sdelphij# (FITS floating point formats are big-endian.)
525284194Sdelphij0	string	SIMPLE\ \ =	FITS image data
526284194Sdelphij>109	string	8		\b, 8-bit, character or unsigned binary integer
527284194Sdelphij>108	string	16		\b, 16-bit, two's complement binary integer
528284194Sdelphij>107	string	\ 32		\b, 32-bit, two's complement binary integer
529284194Sdelphij>107	string	-32		\b, 32-bit, floating point, single precision
530284194Sdelphij>107	string	-64		\b, 64-bit, floating point, double precision
531284194Sdelphij
532284194Sdelphij# other images
533284194Sdelphij0	string	This\ is\ a\ BitMap\ file	Lisp Machine bit-array-file
534284194Sdelphij
535284194Sdelphij# From SunOS 5.5.1 "/etc/magic" - appeared right before Sun raster image
536284194Sdelphij# stuff.
537284194Sdelphij#
538284194Sdelphij0	beshort		0x1010		PEX Binary Archive
539284194Sdelphij
540284194Sdelphij# DICOM medical imaging data
541284194Sdelphij128	string	DICM			DICOM medical imaging data
542284194Sdelphij!:mime	application/dicom
543284194Sdelphij
544284194Sdelphij# XWD - X Window Dump file.
545284194Sdelphij#   As described in /usr/X11R6/include/X11/XWDFile.h
546284194Sdelphij#   used by the xwd program.
547284194Sdelphij#   Bradford Castalia, idaeim, 1/01
548284194Sdelphij#   updated by Adam Buchbinder, 2/09
549284194Sdelphij# The following assumes version 7 of the format; the first long is the length
550284194Sdelphij# of the header, which is at least 25 4-byte longs, and the one at offset 8
551284194Sdelphij# is a constant which is always either 1 or 2. Offset 12 is the pixmap depth,
552284194Sdelphij# which is a maximum of 32.
553284194Sdelphij0	belong	>100
554284194Sdelphij>8	belong	<3
555284194Sdelphij>>12	belong	<33
556284194Sdelphij>>>4	belong	7			XWD X Window Dump image data
557284194Sdelphij!:mime	image/x-xwindowdump
558284194Sdelphij>>>>100	string	>\0			\b, "%s"
559284194Sdelphij>>>>16	belong	x			\b, %dx
560284194Sdelphij>>>>20	belong	x			\b%dx
561284194Sdelphij>>>>12	belong	x			\b%d
562284194Sdelphij
563284194Sdelphij# PDS - Planetary Data System
564284194Sdelphij#   These files use Parameter Value Language in the header section.
565284194Sdelphij#   Unfortunately, there is no certain magic, but the following
566284194Sdelphij#   strings have been found to be most likely.
567284194Sdelphij0	string	NJPL1I00		PDS (JPL) image data
568284194Sdelphij2	string	NJPL1I			PDS (JPL) image data
569284194Sdelphij0	string	CCSD3ZF			PDS (CCSD) image data
570284194Sdelphij2	string	CCSD3Z			PDS (CCSD) image data
571284194Sdelphij0	string	PDS_			PDS image data
572284194Sdelphij0	string	LBLSIZE=		PDS (VICAR) image data
573284194Sdelphij
574284194Sdelphij# pM8x: ATARI STAD compressed bitmap format
575284194Sdelphij#
576284194Sdelphij# from Oskar Schirmer <schirmer@scara.com> Feb 2, 2001
577284194Sdelphij# p M 8 5/6 xx yy zz data...
578284194Sdelphij# Atari ST STAD bitmap is always 640x400, bytewise runlength compressed.
579284194Sdelphij# bytes either run horizontally (pM85) or vertically (pM86). yy is the
580284194Sdelphij# most frequent byte, xx and zz are runlength escape codes, where xx is
581284194Sdelphij# used for runs of yy.
582284194Sdelphij#
583284194Sdelphij0	string	pM85		Atari ST STAD bitmap image data (hor)
584284194Sdelphij>5	byte	0x00		(white background)
585284194Sdelphij>5	byte	0xFF		(black background)
586284194Sdelphij0	string	pM86		Atari ST STAD bitmap image data (vert)
587284194Sdelphij>5	byte	0x00		(white background)
588284194Sdelphij>5	byte	0xFF		(black background)
589284194Sdelphij
590284194Sdelphij# Gurkan Sengun <gurkan@linuks.mine.nu>, www.linuks.mine.nu
591284194Sdelphij# http://www.atarimax.com/jindroush.atari.org/afmtatr.html
592284194Sdelphij0	leshort	0x0296		Atari ATR image
593284194Sdelphij
594284194Sdelphij# XXX:
595284194Sdelphij# This is bad magic 0x5249 == 'RI' conflicts with RIFF and other
596284194Sdelphij# magic.
597284194Sdelphij# SGI RICE image file <mpruett@sgi.com>
598284194Sdelphij#0	beshort	0x5249		RICE image
599284194Sdelphij#>2	beshort	x		v%d
600284194Sdelphij#>4	beshort	x		(%d x
601284194Sdelphij#>6	beshort	x		%d)
602284194Sdelphij#>8	beshort	0		8 bit
603284194Sdelphij#>8	beshort	1		10 bit
604284194Sdelphij#>8	beshort	2		12 bit
605284194Sdelphij#>8	beshort	3		13 bit
606284194Sdelphij#>10	beshort	0		4:2:2
607284194Sdelphij#>10	beshort	1		4:2:2:4
608284194Sdelphij#>10	beshort	2		4:4:4
609284194Sdelphij#>10	beshort	3		4:4:4:4
610284194Sdelphij#>12	beshort	1		RGB
611284194Sdelphij#>12	beshort	2		CCIR601
612284194Sdelphij#>12	beshort	3		RP175
613284194Sdelphij#>12	beshort	4		YUV
614284194Sdelphij
615284194Sdelphij# PCX image files
616284194Sdelphij# From: Dan Fandrich <dan@coneharvesters.com>
617284194Sdelphij# updated by Joerg Jenderek at Feb 2013 by http://de.wikipedia.org/wiki/PCX
618284194Sdelphij# http://web.archive.org/web/20100206055706/http://www.qzx.com/pc-gpe/pcx.txt
619284194Sdelphij# GRR: original test was still too general as it catches xbase examples T5.DBT,T6.DBT with 0xa000000
620284194Sdelphij# 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
621284194Sdelphij0	ubelong&0xffF8fe00	0x0a000000	
622284194Sdelphij# for PCX bit depth > 0 
623284194Sdelphij>3	ubyte		>0	
624284194Sdelphij# test for valid versions
625284194Sdelphij>>1	ubyte		<6	
626284194Sdelphij>>>1	ubyte		!1	PCX
627284194Sdelphij!:mime	image/x-pcx
628284194Sdelphij#!:mime	image/pcx
629284194Sdelphij>>>>1	ubyte		0	ver. 2.5 image data
630284194Sdelphij>>>>1	ubyte		2	ver. 2.8 image data, with palette
631284194Sdelphij>>>>1	ubyte		3	ver. 2.8 image data, without palette
632284194Sdelphij>>>>1	ubyte		4	for Windows image data
633284194Sdelphij>>>>1	ubyte		5	ver. 3.0 image data
634284194Sdelphij>>>>4	uleshort	x	bounding box [%d,
635284194Sdelphij>>>>6	uleshort	x	%d] -
636284194Sdelphij>>>>8	uleshort	x	[%d,
637284194Sdelphij>>>>10	uleshort	x	%d],
638284194Sdelphij>>>>65	ubyte		>1	%d planes each of
639284194Sdelphij>>>>3	ubyte		x	%d-bit
640284194Sdelphij>>>>68	byte		1	colour,
641284194Sdelphij>>>>68	byte		2	grayscale,
642284194Sdelphij# this should not happen
643284194Sdelphij>>>>68	default		x	image,
644284194Sdelphij>>>>12	leshort		>0	%d x
645284194Sdelphij>>>>>14	uleshort	x	%d dpi,
646284194Sdelphij>>>>2	byte		0	uncompressed
647284194Sdelphij>>>>2	byte		1	RLE compressed
648284194Sdelphij
649284194Sdelphij# Adobe Photoshop
650284194Sdelphij# From: Asbjoern Sloth Toennesen <asbjorn@lila.io>
651284194Sdelphij0	string		8BPS Adobe Photoshop Image
652284194Sdelphij!:mime	image/vnd.adobe.photoshop
653284194Sdelphij>4   beshort 2 (PSB)
654284194Sdelphij>18  belong  x \b, %d x
655284194Sdelphij>14  belong  x %d,
656284194Sdelphij>24  beshort 0 bitmap
657284194Sdelphij>24  beshort 1 grayscale
658284194Sdelphij>>12 beshort 2 with alpha
659284194Sdelphij>24  beshort 2 indexed
660284194Sdelphij>24  beshort 3 RGB
661284194Sdelphij>>12 beshort 4 \bA
662284194Sdelphij>24  beshort 4 CMYK
663284194Sdelphij>>12 beshort 5 \bA
664284194Sdelphij>24  beshort 7 multichannel
665284194Sdelphij>24  beshort 8 duotone
666284194Sdelphij>24  beshort 9 lab
667284194Sdelphij>12  beshort > 1
668284194Sdelphij>>12  beshort x \b, %dx
669284194Sdelphij>12  beshort 1 \b,
670284194Sdelphij>22  beshort x %d-bit channel
671284194Sdelphij>12  beshort > 1 \bs
672284194Sdelphij
673284194Sdelphij# XV thumbnail indicator (ThMO)
674284194Sdelphij0	string		P7\ 332		XV thumbnail image data
675284194Sdelphij
676284194Sdelphij# NITF is defined by United States MIL-STD-2500A
677284194Sdelphij0	string	NITF	National Imagery Transmission Format
678284194Sdelphij>25	string	>\0	dated %.14s
679284194Sdelphij
680284194Sdelphij# GEM Image: Version 1, Headerlen 8 (Wolfram Kleff)
681284194Sdelphij0	belong		0x00010008	GEM Image data
682284194Sdelphij>12	beshort		x		%d x
683284194Sdelphij>14	beshort		x		%d,
684284194Sdelphij>4	beshort		x		%d planes,
685284194Sdelphij>8	beshort		x		%d x
686284194Sdelphij>10	beshort		x		%d pixelsize
687284194Sdelphij
688284194Sdelphij# GEM Metafile (Wolfram Kleff)
689284194Sdelphij0	lelong		0x0018FFFF	GEM Metafile data
690284194Sdelphij>4	leshort		x		version %d
691284194Sdelphij
692284194Sdelphij#
693284194Sdelphij# SMJPEG. A custom Motion JPEG format used by Loki Entertainment
694284194Sdelphij# Software Torbjorn Andersson <d91tan@Update.UU.SE>.
695284194Sdelphij#
696284194Sdelphij0	string	\0\nSMJPEG	SMJPEG
697284194Sdelphij>8	belong	x		%d.x data
698284194Sdelphij# According to the specification you could find any number of _TXT
699284194Sdelphij# headers here, but I can't think of any way of handling that. None of
700284194Sdelphij# the SMJPEG files I tried it on used this feature. Even if such a
701284194Sdelphij# file is encountered the output should still be reasonable.
702284194Sdelphij>16	string	_SND		\b,
703284194Sdelphij>>24	beshort	>0		%d Hz
704284194Sdelphij>>26	byte	8		8-bit
705284194Sdelphij>>26	byte	16		16-bit
706284194Sdelphij>>28	string	NONE		uncompressed
707284194Sdelphij# >>28	string	APCM		ADPCM compressed
708284194Sdelphij>>27	byte	1		mono
709284194Sdelphij>>28	byte	2		stereo
710284194Sdelphij# Help! Isn't there any way to avoid writing this part twice?
711284194Sdelphij>>32	string	_VID		\b,
712284194Sdelphij# >>>48	string	JFIF		JPEG
713284194Sdelphij>>>40	belong	>0		%d frames
714284194Sdelphij>>>44	beshort	>0		(%d x
715284194Sdelphij>>>46	beshort	>0		%d)
716284194Sdelphij>16	string	_VID		\b,
717284194Sdelphij# >>32	string	JFIF		JPEG
718284194Sdelphij>>24	belong	>0		%d frames
719284194Sdelphij>>28	beshort	>0		(%d x
720284194Sdelphij>>30	beshort	>0		%d)
721284194Sdelphij
722284194Sdelphij0	string	Paint\ Shop\ Pro\ Image\ File	Paint Shop Pro Image File
723284194Sdelphij
724284194Sdelphij# "thumbnail file" (icon)
725284194Sdelphij# descended from "xv", but in use by other applications as well (Wolfram Kleff)
726284194Sdelphij0       string          P7\ 332         XV "thumbnail file" (icon) data
727284194Sdelphij
728284194Sdelphij# taken from fkiss: (<yav@mte.biglobe.ne.jp> ?)
729284194Sdelphij0       string          KiSS            KISS/GS
730284194Sdelphij>4      byte            16              color
731284194Sdelphij>>5     byte            x               %d bit
732284194Sdelphij>>8     leshort         x               %d colors
733284194Sdelphij>>10    leshort         x               %d groups
734284194Sdelphij>4      byte            32              cell
735284194Sdelphij>>5     byte            x               %d bit
736284194Sdelphij>>8     leshort         x               %d x
737284194Sdelphij>>10    leshort         x               %d
738284194Sdelphij>>12    leshort         x               +%d
739284194Sdelphij>>14    leshort         x               +%d
740284194Sdelphij
741284194Sdelphij# Webshots (www.webshots.com), by John Harrison
742284194Sdelphij0       string          C\253\221g\230\0\0\0 Webshots Desktop .wbz file
743284194Sdelphij
744284194Sdelphij# Hercules DASD image files
745284194Sdelphij# From Jan Jaeger <jj@septa.nl>
746284194Sdelphij0       string  CKD_P370        Hercules CKD DASD image file
747284194Sdelphij>8      long    x               \b, %d heads per cylinder
748284194Sdelphij>12     long    x               \b, track size %d bytes
749284194Sdelphij>16     byte    x               \b, device type 33%2.2X
750284194Sdelphij
751284194Sdelphij0       string  CKD_C370        Hercules compressed CKD DASD image file
752284194Sdelphij>8      long    x               \b, %d heads per cylinder
753284194Sdelphij>12     long    x               \b, track size %d bytes
754284194Sdelphij>16     byte    x               \b, device type 33%2.2X
755284194Sdelphij
756284194Sdelphij0       string  CKD_S370        Hercules CKD DASD shadow file
757284194Sdelphij>8      long    x               \b, %d heads per cylinder
758284194Sdelphij>12     long    x               \b, track size %d bytes
759284194Sdelphij>16     byte    x               \b, device type 33%2.2X
760284194Sdelphij
761284194Sdelphij# Squeak images and programs - etoffi@softhome.net
762284194Sdelphij0	string		\146\031\0\0	Squeak image data
763284194Sdelphij0	search/1	'From\040Squeak	Squeak program text
764284194Sdelphij
765284194Sdelphij# partimage: file(1) magic for PartImage files (experimental, incomplete)
766284194Sdelphij# Author: Hans-Joachim Baader <hjb@pro-linux.de>
767284194Sdelphij0		string	PaRtImAgE-VoLuMe	PartImage
768284194Sdelphij>0x0020		string	0.6.1		file version %s
769284194Sdelphij>>0x0060	lelong	>-1		volume %d
770284194Sdelphij#>>0x0064 8 byte identifier
771284194Sdelphij#>>0x007c reserved
772284194Sdelphij>>0x0200	string	>\0		type %s
773284194Sdelphij>>0x1400	string	>\0		device %s,
774284194Sdelphij>>0x1600	string	>\0		original filename %s,
775284194Sdelphij# Some fields omitted
776284194Sdelphij>>0x2744	lelong	0		not compressed
777284194Sdelphij>>0x2744	lelong	1		gzip compressed
778284194Sdelphij>>0x2744	lelong	2		bzip2 compressed
779284194Sdelphij>>0x2744	lelong	>2		compressed with unknown algorithm
780284194Sdelphij>0x0020		string	>0.6.1		file version %s
781284194Sdelphij>0x0020		string	<0.6.1		file version %s
782284194Sdelphij
783284194Sdelphij# DCX is multi-page PCX, using a simple header of up to 1024
784284194Sdelphij# offsets for the respective PCX components.
785284194Sdelphij# From: Joerg Wunsch <joerg_wunsch@uriah.heep.sax.de>
786284194Sdelphij0	lelong	987654321	DCX multi-page PCX image data
787284194Sdelphij
788284194Sdelphij# Simon Walton <simonw@matteworld.com>
789284194Sdelphij# Kodak Cineon format for scanned negatives
790284194Sdelphij# http://www.kodak.com/US/en/motion/support/dlad/
791284194Sdelphij0	lelong  0xd75f2a80	Cineon image data
792284194Sdelphij>200	belong  >0		\b, %d x
793284194Sdelphij>204	belong  >0		%d
794284194Sdelphij
795284194Sdelphij
796284194Sdelphij# Bio-Rad .PIC is an image format used by microscope control systems
797284194Sdelphij# and related image processing software used by biologists.
798284194Sdelphij# From: Vebjorn Ljosa <vebjorn@ljosa.com>
799284194Sdelphij# BOOL values are two-byte integers; use them to rule out false positives.
800284194Sdelphij# http://web.archive.org/web/20050317223257/www.cs.ubc.ca/spider/ladic/text/biorad.txt
801284194Sdelphij# Samples: http://www.loci.wisc.edu/software/sample-data
802284194Sdelphij14	leshort <2
803284194Sdelphij>62	leshort <2
804284194Sdelphij>>54	leshort 12345		Bio-Rad .PIC Image File
805284194Sdelphij>>>0	leshort >0		%d x
806284194Sdelphij>>>2	leshort >0		%d,
807284194Sdelphij>>>4	leshort =1		1 image in file
808284194Sdelphij>>>4	leshort >1		%d images in file
809284194Sdelphij
810284194Sdelphij# From Jan "Yenya" Kasprzak <kas@fi.muni.cz>
811284194Sdelphij# The description of *.mrw format can be found at
812284194Sdelphij# http://www.dalibor.cz/minolta/raw_file_format.htm
813284194Sdelphij0	string	\000MRM			Minolta Dimage camera raw image data
814284194Sdelphij
815284194Sdelphij# Summary: DjVu image / document
816284194Sdelphij# Extension: .djvu
817284194Sdelphij# Reference: http://djvu.org/docs/DjVu3Spec.djvu
818284194Sdelphij# Submitted by: Stephane Loeuillet <stephane.loeuillet@tiscali.fr>
819284194Sdelphij# Modified by (1): Abel Cheung <abelcheung@gmail.com>
820284194Sdelphij0	string	AT&TFORM
821284194Sdelphij>12	string	DJVM		DjVu multiple page document
822284194Sdelphij!:mime	image/vnd.djvu
823284194Sdelphij>12	string	DJVU		DjVu image or single page document
824284194Sdelphij!:mime	image/vnd.djvu
825284194Sdelphij>12	string	DJVI		DjVu shared document
826284194Sdelphij!:mime	image/vnd.djvu
827284194Sdelphij>12	string	THUM		DjVu page thumbnails
828284194Sdelphij!:mime	image/vnd.djvu
829284194Sdelphij
830284194Sdelphij# Originally by Marc Espie
831284194Sdelphij# Modified by Robert Minsk <robertminsk at yahoo.com>
832284194Sdelphij# http://www.openexr.com/openexrfilelayout.pdf
833284194Sdelphij0	lelong		20000630	OpenEXR image data,
834284194Sdelphij!:mime image/x-exr
835284194Sdelphij>4	lelong&0x000000ff x		version %d,
836284194Sdelphij>4	lelong		^0x00000200	storage: scanline
837284194Sdelphij>4	lelong		&0x00000200	storage: tiled
838284194Sdelphij>8	search/0x1000	compression\0	\b, compression:
839284194Sdelphij>>&16	byte		0		none
840284194Sdelphij>>&16	byte		1		rle
841284194Sdelphij>>&16	byte		2		zips
842284194Sdelphij>>&16	byte		3		zip
843284194Sdelphij>>&16	byte		4		piz
844284194Sdelphij>>&16	byte		5		pxr24
845284194Sdelphij>>&16	byte		6		b44
846284194Sdelphij>>&16	byte		7		b44a
847284194Sdelphij>>&16	byte		>7		unknown
848284194Sdelphij>8	 search/0x1000	dataWindow\0	\b, dataWindow:
849284194Sdelphij>>&10	lelong		x		(%d
850284194Sdelphij>>&14	lelong		x		%d)-
851284194Sdelphij>>&18	lelong		x		\b(%d
852284194Sdelphij>>&22	lelong		x		%d)
853284194Sdelphij>8	search/0x1000	displayWindow\0	\b, displayWindow:
854284194Sdelphij>>&10	lelong		x		(%d
855284194Sdelphij>>&14	lelong		x		%d)-
856284194Sdelphij>>&18	lelong		x		\b(%d
857284194Sdelphij>>&22	lelong		x		%d)
858284194Sdelphij>8	search/0x1000	lineOrder\0	 \b, lineOrder:
859284194Sdelphij>>&14	byte		0		increasing y
860284194Sdelphij>>&14	byte		1		decreasing y
861284194Sdelphij>>&14	byte		2		random y
862284194Sdelphij>>&14	byte		>2		unknown
863284194Sdelphij
864284194Sdelphij# SMPTE Digital Picture Exchange Format, SMPTE DPX
865284194Sdelphij#
866284194Sdelphij# ANSI/SMPTE 268M-1994, SMPTE Standard for File Format for Digital
867284194Sdelphij# Moving-Picture Exchange (DPX), v1.0, 18 February 1994
868284194Sdelphij# Robert Minsk <robertminsk at yahoo.com>
869284194Sdelphij0	string		SDPX	DPX image data, big-endian,
870284194Sdelphij!:mime image/x-dpx
871284194Sdelphij>768	beshort		<4
872284194Sdelphij>>772	belong		x	%dx
873284194Sdelphij>>776	belong		x	\b%d,
874284194Sdelphij>768	beshort		>3
875284194Sdelphij>>776	belong		x	%dx
876284194Sdelphij>>772	belong		x	\b%d,
877284194Sdelphij>768	beshort		0	left to right/top to bottom
878284194Sdelphij>768	beshort		1	right to left/top to bottom
879284194Sdelphij>768	beshort		2	left to right/bottom to top
880284194Sdelphij>768	beshort		3	right to left/bottom to top
881284194Sdelphij>768	beshort		4	top to bottom/left to right
882284194Sdelphij>768	beshort		5	top to bottom/right to left
883284194Sdelphij>768	leshort		6	bottom to top/left to right
884284194Sdelphij>768	leshort		7	bottom to top/right to left
885284194Sdelphij
886284194Sdelphij# From: Tom Hilinski <tom.hilinski@comcast.net>
887284194Sdelphij# http://www.unidata.ucar.edu/packages/netcdf/
888284194Sdelphij0	string	CDF\001			NetCDF Data Format data
889284194Sdelphij
890284194Sdelphij#-----------------------------------------------------------------------
891284194Sdelphij# Hierarchical Data Format, used to facilitate scientific data exchange
892284194Sdelphij# specifications at http://hdf.ncsa.uiuc.edu/
893284194Sdelphij0	belong	0x0e031301	Hierarchical Data Format (version 4) data
894284194Sdelphij!:mime	application/x-hdf
895284194Sdelphij0	string	\211HDF\r\n\032\n	Hierarchical Data Format (version 5) data
896284194Sdelphij!:mime	application/x-hdf
897284194Sdelphij512	string	\211HDF\r\n\032\n	Hierarchical Data Format (version 5) with 512 bytes user block
898284194Sdelphij!:mime	application/x-hdf
899284194Sdelphij1024	string	\211HDF\r\n\032\n	Hierarchical Data Format (version 5) with 1k user block
900284194Sdelphij!:mime	application/x-hdf
901284194Sdelphij2048	string	\211HDF\r\n\032\n	Hierarchical Data Format (version 5) with 2k user block
902284194Sdelphij!:mime	application/x-hdf
903284194Sdelphij4096	string	\211HDF\r\n\032\n	Hierarchical Data Format (version 5) with 4k user block
904284194Sdelphij!:mime	application/x-hdf
905284194Sdelphij
906284194Sdelphij
907284194Sdelphij# From: Tobias Burnus <burnus@net-b.de>
908284194Sdelphij# Xara (for a while: Corel Xara) is a graphic package, see
909284194Sdelphij# http://www.xara.com/ for Windows and as GPL application for Linux
910284194Sdelphij0	string	XARA\243\243	Xara graphics file
911284194Sdelphij
912284194Sdelphij# http://www.cartesianinc.com/Tech/
913284194Sdelphij0	string	CPC\262		Cartesian Perceptual Compression image
914284194Sdelphij!:mime	image/x-cpi
915284194Sdelphij
916284194Sdelphij# From Albert Cahalan <acahalan@gmail.com>
917284194Sdelphij# puredigital used it for the CVS disposable camcorder
918284194Sdelphij#8       lelong  4       ZBM bitmap image data
919284194Sdelphij#>4      leshort x       %u x
920284194Sdelphij#>6      leshort x       %u
921284194Sdelphij
922284194Sdelphij# From Albert Cahalan <acahalan@gmail.com>
923284194Sdelphij# uncompressed 5:6:5 HighColor image for OLPC XO firmware icons
924284194Sdelphij0       string C565     OLPC firmware icon image data
925284194Sdelphij>4      leshort x       %u x
926284194Sdelphij>6      leshort x       %u
927284194Sdelphij
928284194Sdelphij# Applied Images - Image files from Cytovision
929284194Sdelphij# Gustavo Junior Alves <gjalves@gjalves.com.br>
930284194Sdelphij0	string	\xce\xda\xde\xfa	Cytovision Metaphases file
931284194Sdelphij0	string	\xed\xad\xef\xac	Cytovision Karyotype file
932284194Sdelphij0	string	\x0b\x00\x03\x00	Cytovision FISH Probe file
933284194Sdelphij0	string	\xed\xfe\xda\xbe	Cytovision FLEX file
934284194Sdelphij0	string	\xed\xab\xed\xfe	Cytovision FLEX file
935284194Sdelphij0	string	\xad\xfd\xea\xad	Cytovision RATS file
936284194Sdelphij
937284194Sdelphij# Wavelet Scalar Quantization format used in gray-scale fingerprint images
938284194Sdelphij# From Tano M Fotang <mfotang@quanteq.com>
939284194Sdelphij0	string	\xff\xa0\xff\xa8\x00	Wavelet Scalar Quantization image data
940284194Sdelphij
941284194Sdelphij# Type:		PCO B16 image files
942284194Sdelphij# URL:		http://www.pco.de/fileadmin/user_upload/db/download/MA_CWDCOPIE_0412b.pdf
943284194Sdelphij# From:		Florian Philipp <florian.philipp@binarywings.net>
944284194Sdelphij# Extension:	.b16
945284194Sdelphij# Description:	Pixel image format produced by PCO Camware, typically used
946284194Sdelphij#		together with PCO cameras.
947284194Sdelphij# Note:		Different versions exist for e.g. 8 bit and 16 bit images.
948284194Sdelphij#		Documentation is incomplete.
949284194Sdelphij0	string/b	PCO-	PCO B16 image data
950284194Sdelphij>12	lelong		x	\b, %dx
951284194Sdelphij>16	lelong		x	\b%d
952284194Sdelphij>20	lelong		0	\b, short header
953284194Sdelphij>20	lelong		-1	\b, extended header
954284194Sdelphij>>24	lelong		0	\b, grayscale
955284194Sdelphij>>>36	lelong		0	linear LUT
956284194Sdelphij>>>36	lelong		1	logarithmic LUT
957284194Sdelphij>>>28	lelong		x	[%d
958284194Sdelphij>>>32	lelong		x	\b,%d]
959284194Sdelphij>>24	lelong		1	\b, color
960284194Sdelphij>>>64	lelong		0	linear LUT
961284194Sdelphij>>>64	lelong		1	logarithmic LUT
962284194Sdelphij>>>40	lelong		x	r[%d
963284194Sdelphij>>>44	lelong		x	\b,%d]
964284194Sdelphij>>>48	lelong		x	g[%d
965284194Sdelphij>>>52	lelong		x	\b,%d]
966284194Sdelphij>>>56	lelong		x	b[%d
967284194Sdelphij>>>60	lelong		x	\b,%d]
968284194Sdelphij
969284194Sdelphij# Polar Monitor Bitmap (.pmb) used as logo for Polar Electro watches
970284194Sdelphij# From: Markus Heidelberg <markus.heidelberg at web.de>
971284194Sdelphij0	string/t	[BitmapInfo2]	Polar Monitor Bitmap text
972284194Sdelphij!:mime	image/x-polar-monitor-bitmap
973284194Sdelphij
974284194Sdelphij# From: Rick Richardson <rickrich@gmail.com>
975284194Sdelphij0	string	GARMIN\ BITMAP\ 01	Garmin Bitmap file
976284194Sdelphij
977284194Sdelphij# Type:	Ulead Photo Explorer5 (.pe5)
978284194Sdelphij# URL:	http://www.jisyo.com/cgibin/view.cgi?EXT=pe5 (Japanese)
979284194Sdelphij# From:	Simon Horman <horms@debian.org>
980284194Sdelphij0	string	IIO2H			Ulead Photo Explorer5
981284194Sdelphij
982284194Sdelphij# Type:	X11 cursor
983284194Sdelphij# URL:	http://webcvs.freedesktop.org/mime/shared-mime-info/freedesktop.org.xml.in?view=markup
984284194Sdelphij# From:	Mathias Brodala <info@noctus.net>
985284194Sdelphij0	string	Xcur			X11 cursor
986284194Sdelphij
987284194Sdelphij# Type:	Olympus ORF raw images.
988284194Sdelphij# URL:	http://libopenraw.freedesktop.org/wiki/Olympus_ORF
989284194Sdelphij# From:	Adam Buchbinder <adam.buchbinder@gmail.com>
990284194Sdelphij0	string		MMOR		Olympus ORF raw image data, big-endian
991284194Sdelphij!:mime	image/x-olympus-orf
992284194Sdelphij0	string		IIRO		Olympus ORF raw image data, little-endian
993284194Sdelphij!:mime	image/x-olympus-orf
994284194Sdelphij0	string		IIRS		Olympus ORF raw image data, little-endian
995284194Sdelphij!:mime	image/x-olympus-orf
996284194Sdelphij
997284194Sdelphij# Type: files used in modern AVCHD camcoders to store clip information
998284194Sdelphij# Extension: .cpi
999284194Sdelphij# From: Alexander Danilov <alexander.a.danilov@gmail.com>
1000284194Sdelphij0	string	HDMV0100	AVCHD Clip Information
1001284194Sdelphij
1002284194Sdelphij# From: Adam Buchbinder <adam.buchbinder@gmail.com>
1003284194Sdelphij# URL: http://local.wasp.uwa.edu.au/~pbourke/dataformats/pic/
1004284194Sdelphij# Radiance HDR; usually has .pic or .hdr extension.
1005284194Sdelphij0	string	#?RADIANCE\n	Radiance HDR image data
1006284194Sdelphij#!mime	image/vnd.radiance
1007284194Sdelphij
1008284194Sdelphij# From: Adam Buchbinder <adam.buchbinder@gmail.com>
1009284194Sdelphij# URL: http://www.mpi-inf.mpg.de/resources/pfstools/pfs_format_spec.pdf
1010284194Sdelphij# Used by the pfstools packages. The regex matches for the image size could
1011284194Sdelphij# probably use some work. The MIME type is made up; if there's one in
1012284194Sdelphij# actual common use, it should replace the one below.
1013284194Sdelphij0	string	PFS1\x0a	PFS HDR image data
1014284194Sdelphij#!mime	image/x-pfs
1015284194Sdelphij>1	regex	[0-9]*\ 		\b, %s
1016284194Sdelphij>>1	regex	\ [0-9]{4}		\bx%s
1017284194Sdelphij
1018284194Sdelphij# Type: Foveon X3F
1019284194Sdelphij# URL:  http://www.photofo.com/downloads/x3f-raw-format.pdf
1020284194Sdelphij# From: Adam Buchbinder <adam.buchbinder@gmail.com>
1021284194Sdelphij# Note that the MIME type isn't defined anywhere that I can find; if
1022284194Sdelphij# there's a canonical type for this format, it should replace this one.
1023284194Sdelphij0	string	FOVb	Foveon X3F raw image data
1024284194Sdelphij!:mime	image/x-x3f
1025284194Sdelphij>6	leshort	x	\b, version %d.
1026284194Sdelphij>4	leshort	x	\b%d
1027284194Sdelphij>28	lelong	x	\b, %dx
1028284194Sdelphij>32	lelong	x	\b%d
1029284194Sdelphij
1030284194Sdelphij# Paint.NET file
1031284194Sdelphij# From Adam Buchbinder <adam.buchbinder@gmail.com>
1032284194Sdelphij0	string	PDN3	Paint.NET image data
1033284194Sdelphij!:mime	image/x-paintnet
1034284194Sdelphij
1035284194Sdelphij# Not really an image.
1036284194Sdelphij# From: "Tano M. Fotang" <mfotang@quanteq.com>
1037284194Sdelphij0	string	\x46\x4d\x52\x00	ISO/IEC 19794-2 Format Minutiae Record (FMR)
1038284194Sdelphij
1039284194Sdelphij# WEBP https://developers.google.com/speed/webp/docs/riff_container
1040284194Sdelphij#0	string	RIFF
1041284194Sdelphij#>8	string	WEBP	Web/P image data
1042284194Sdelphij#>>4	lelong	x	\b, %d bytes
1043284194Sdelphij
1044284194Sdelphij# doc: http://www.shikino.co.jp/eng/products/images/FLOWER.jpg.zip
1045284194Sdelphij# example: http://www.shikino.co.jp/eng/products/images/FLOWER.wdp.zip
1046284194Sdelphij90	bequad		0x574D50484F544F00	JPEG-XR Image
1047284194Sdelphij>98	byte&0x08	=0x08			\b, hard tiling
1048284194Sdelphij>99	byte&0x80	=0x80			\b, tiling present
1049284194Sdelphij>99	byte&0x40	=0x40			\b, codestream present
1050284194Sdelphij>99	byte&0x38	x			\b, spatial xform=
1051284194Sdelphij>99	byte&0x38	0x00			\bTL
1052284194Sdelphij>99	byte&0x38	0x08			\bBL
1053284194Sdelphij>99	byte&0x38	0x10			\bTR
1054284194Sdelphij>99	byte&0x38	0x18			\bBR
1055284194Sdelphij>99	byte&0x38	0x20			\bBT
1056284194Sdelphij>99	byte&0x38	0x28			\bRB
1057284194Sdelphij>99	byte&0x38	0x30			\bLT
1058284194Sdelphij>99	byte&0x38	0x38			\bLB
1059284194Sdelphij>100	byte&0x80	=0x80			\b, short header
1060284194Sdelphij>>102	beshort+1	x			\b, %d
1061284194Sdelphij>>104	beshort+1	x			\bx%d
1062284194Sdelphij>100	byte&0x80	=0x00			\b, long header
1063284194Sdelphij>>102	belong+1	x			\b, %x
1064284194Sdelphij>>106	belong+1	x			\bx%x
1065284194Sdelphij>101	beshort&0xf	x			\b, bitdepth=
1066284194Sdelphij>>101	beshort&0xf	0x0			\b1-WHITE=1
1067284194Sdelphij>>101	beshort&0xf	0x1			\b8
1068284194Sdelphij>>101	beshort&0xf	0x2			\b16
1069284194Sdelphij>>101	beshort&0xf	0x3			\b16-SIGNED
1070284194Sdelphij>>101	beshort&0xf	0x4			\b16-FLOAT
1071284194Sdelphij>>101	beshort&0xf	0x5			\b(reserved 5)
1072284194Sdelphij>>101	beshort&0xf	0x6			\b32-SIGNED
1073284194Sdelphij>>101	beshort&0xf	0x7			\b32-FLOAT
1074284194Sdelphij>>101	beshort&0xf	0x8			\b5
1075284194Sdelphij>>101	beshort&0xf	0x9			\b10
1076284194Sdelphij>>101	beshort&0xf	0xa			\b5-6-5
1077284194Sdelphij>>101	beshort&0xf	0xb			\b(reserved %d)
1078284194Sdelphij>>101	beshort&0xf	0xc			\b(reserved %d)
1079284194Sdelphij>>101	beshort&0xf	0xd			\b(reserved %d)
1080284194Sdelphij>>101	beshort&0xf	0xe			\b(reserved %d)
1081284194Sdelphij>>101	beshort&0xf	0xf			\b1-BLACK=1
1082284194Sdelphij>101	beshort&0xf0	x			\b, colorfmt=
1083284194Sdelphij>>101	beshort&0xf0	0x00			\bYONLY
1084284194Sdelphij>>101	beshort&0xf0	0x10			\bYUV240
1085284194Sdelphij>>101	beshort&0xf0	0x20			\bYWV422
1086284194Sdelphij>>101	beshort&0xf0	0x30			\bYWV444
1087284194Sdelphij>>101	beshort&0xf0	0x40			\bCMYK
1088284194Sdelphij>>101	beshort&0xf0	0x50			\bCMYKDIRECT
1089284194Sdelphij>>101	beshort&0xf0	0x60			\bNCOMPONENT
1090284194Sdelphij>>101	beshort&0xf0	0x70			\bRGB
1091284194Sdelphij>>101	beshort&0xf0	0x80			\bRGBE
1092284194Sdelphij>>101	beshort&0xf0	>0x80			\b(reserved 0x%x)
1093284194Sdelphij
1094284194Sdelphij# From: Johan van der Knijff <johan.vanderknijff@kb.nl>
1095284194Sdelphij#
1096284194Sdelphij# BPG (Better Portable Graphics) format
1097284194Sdelphij# http://bellard.org/bpg/
1098284194Sdelphij# http://fileformats.archiveteam.org/wiki/BPG
1099284194Sdelphij#
1100284194Sdelphij0	string	\x42\x50\x47\xFB	BPG (Better Portable Graphics)
1101284194Sdelphij!:mime  image/bpg
1102