images revision 186690
11553Srgrimes#------------------------------------------------------------------------------
21553Srgrimes# images:  file(1) magic for image formats (see also "iff", and "c-lang" for
31553Srgrimes# XPM bitmaps)
41553Srgrimes#
51553Srgrimes# originally from jef@helios.ee.lbl.gov (Jef Poskanzer),
61553Srgrimes# additions by janl@ifi.uio.no as well as others. Jan also suggested
71553Srgrimes# merging several one- and two-line files into here.
81553Srgrimes#
91553Srgrimes# little magic: PCX (first byte is 0x0a)
101553Srgrimes
111553Srgrimes# Targa - matches `povray', `ppmtotga' and `xv' outputs
121553Srgrimes# by Philippe De Muyter <phdm@macqel.be>
131553Srgrimes# at 2, byte ImgType must be 1, 2, 3, 9, 10 or 11
141553Srgrimes# at 1, byte CoMapType must be 1 if ImgType is 1 or 9, 0 otherwise
151553Srgrimes# at 3, leshort Index is 0 for povray, ppmtotga and xv outputs
161553Srgrimes# `xv' recognizes only a subset of the following (RGB with pixelsize = 24)
171553Srgrimes# `tgatoppm' recognizes a superset (Index may be anything)
181553Srgrimes1	belong&0xfff7ffff	0x01010000	Targa image data - Map
191553Srgrimes>2	byte&8			8		- RLE
201553Srgrimes>12	leshort			>0		%hd x
211553Srgrimes>14	leshort			>0		%hd
221553Srgrimes1	belong&0xfff7ffff	0x00020000	Targa image data - RGB
231553Srgrimes>2	byte&8			8		- RLE
241553Srgrimes>12	leshort			>0		%hd x
251553Srgrimes>14	leshort			>0		%hd
261553Srgrimes1	belong&0xfff7ffff	0x00030000	Targa image data - Mono
271553Srgrimes>2	byte&8			8		- RLE
281553Srgrimes>12	leshort			>0		%hd x
291553Srgrimes>14	leshort			>0		%hd
301553Srgrimes
311553Srgrimes# PBMPLUS images
321553Srgrimes# The next byte following the magic is always whitespace.
331553Srgrimes0	search/1	P1		Netpbm PBM image text
341553Srgrimes!:mime	image/x-portable-bitmap
351553Srgrimes0	search/1	P2		Netpbm PGM image text
3631492Swollman!:mime	image/x-portable-greymap
371553Srgrimes0	search/1	P3		Netpbm PPM image text
381553Srgrimes!:mime	image/x-portable-pixmap
391553Srgrimes0	string		P4		Netpbm PBM "rawbits" image data
401553Srgrimes!:mime	image/x-portable-bitmap
411553Srgrimes0	string		P5		Netpbm PGM "rawbits" image data
4231492Swollman!:mime	image/x-portable-greymap
4315648Sjoerg0	string		P6		Netpbm PPM "rawbits" image data
4431492Swollman!:mime	image/x-portable-pixmap
4531492Swollman0	string		P7		Netpbm PAM image file
4650479Speter!:mime	image/x-portable-pixmap
471553Srgrimes
481553Srgrimes# From: bryanh@giraffe-data.com (Bryan Henderson)
491553Srgrimes0	string		\117\072	Solitaire Image Recorder format
501553Srgrimes>4	string		\013		MGI Type 11
511553Srgrimes>4	string		\021		MGI Type 17
521553Srgrimes0	string		.MDA		MicroDesign data
531553Srgrimes>21	byte		48		version 2
541553Srgrimes>21	byte		51		version 3
551553Srgrimes0	string		.MDP		MicroDesign page data
561553Srgrimes>21	byte		48		version 2
571553Srgrimes>21	byte		51		version 3
581553Srgrimes
591553Srgrimes# NIFF (Navy Interchange File Format, a modification of TIFF) images
601553Srgrimes# [GRR:  this *must* go before TIFF]
611553Srgrimes0	string		IIN1		NIFF image data
621553Srgrimes!:mime	image/x-niff
631553Srgrimes
641553Srgrimes# Tag Image File Format, from Daniel Quinlan (quinlan@yggdrasil.com)
651553Srgrimes# The second word of TIFF files is the TIFF version number, 42, which has
661553Srgrimes# never changed.  The TIFF specification recommends testing for it.
671553Srgrimes0	string		MM\x00\x2a	TIFF image data, big-endian
681553Srgrimes!:mime	image/tiff
691553Srgrimes0	string		II\x2a\x00	TIFF image data, little-endian
701553Srgrimes!:mime	image/tiff
711553Srgrimes
7215032Ssef# PNG [Portable Network Graphics, or "PNG's Not GIF"] images
7315032Ssef# (Greg Roelofs, newt@uchicago.edu)
7415703Sjoerg# (Albert Cahalan, acahalan@cs.uml.edu)
751553Srgrimes#
761553Srgrimes# 137 P N G \r \n ^Z \n [4-byte length] H E A D [HEAD data] [HEAD crc] ...
771553Srgrimes#
781553Srgrimes0	string		\x89PNG\x0d\x0a\x1a\x0a		PNG image
791553Srgrimes!:mime	image/png
801553Srgrimes>16	belong		x		\b, %ld x
811553Srgrimes>20	belong		x		%ld,
821553Srgrimes>24	byte		x		%d-bit
831553Srgrimes>25	byte		0		grayscale,
841553Srgrimes>25	byte		2		\b/color RGB,
851553Srgrimes>25	byte		3		colormap,
861553Srgrimes>25	byte		4		gray+alpha,
871553Srgrimes>25	byte		6		\b/color RGBA,
881553Srgrimes#>26	byte		0		deflate/32K,
891553Srgrimes>28	byte		0		non-interlaced
901553Srgrimes>28	byte		1		interlaced
911553Srgrimes
921553Srgrimes# possible GIF replacements; none yet released!
931553Srgrimes# (Greg Roelofs, newt@uchicago.edu)
941553Srgrimes#
951553Srgrimes# GRR 950115:  this was mine ("Zip GIF"):
961553Srgrimes0	string		GIF94z		ZIF image (GIF+deflate alpha)
971553Srgrimes!:mime	image/x-unknown
981553Srgrimes#
991553Srgrimes# GRR 950115:  this is Jeremy Wohl's Free Graphics Format (better):
1001553Srgrimes#					
10124831Sbrian0	string		FGF95a		FGF image (GIF+deflate beta)
1021553Srgrimes!:mime	image/x-unknown
1031553Srgrimes#
1041553Srgrimes# GRR 950115:  this is Thomas Boutell's Portable Bitmap Format proposal
1051553Srgrimes# (best; not yet implemented):
1061553Srgrimes#					
1071553Srgrimes0	string		PBF		PBF image (deflate compression)
1081553Srgrimes!:mime	image/x-unknown
1091553Srgrimes
1108857Srgrimes# GIF
1111553Srgrimes0	string		GIF8		GIF image data
1121553Srgrimes!:mime	image/gif
1131553Srgrimes>4	string		7a		\b, version 8%s,
1141553Srgrimes>4	string		9a		\b, version 8%s,
1151553Srgrimes>6	leshort		>0		%hd x
11624831Sbrian>8	leshort		>0		%hd
1171553Srgrimes#>10	byte		&0x80		color mapped,
11824831Sbrian#>10	byte&0x07	=0x00		2 colors
11924831Sbrian#>10	byte&0x07	=0x01		4 colors
1201553Srgrimes#>10	byte&0x07	=0x02		8 colors
1211553Srgrimes#>10	byte&0x07	=0x03		16 colors
12230407Sjoerg#>10	byte&0x07	=0x04		32 colors
12331492Swollman#>10	byte&0x07	=0x05		64 colors
12431492Swollman#>10	byte&0x07	=0x06		128 colors
1251553Srgrimes#>10	byte&0x07	=0x07		256 colors
12631492Swollman
12731492Swollman# ITC (CMU WM) raster files.  It is essentially a byte-reversed Sun raster,
12831492Swollman# 1 plane, no encoding.
12931492Swollman0	string		\361\0\100\273	CMU window manager raster image data
13031492Swollman>4	lelong		>0		%d x
13131492Swollman>8	lelong		>0		%d,
13231492Swollman>12	lelong		>0		%d-bit
13331492Swollman
13431492Swollman# Magick Image File Format
13531492Swollman0	string		id=ImageMagick	MIFF image data
13631492Swollman
1371553Srgrimes# Artisan
13831492Swollman0	long		1123028772	Artisan image data
13931492Swollman>4	long		1		\b, rectangular 24-bit
14031492Swollman>4	long		2		\b, rectangular 8-bit with colormap
14131492Swollman>4	long		3		\b, rectangular 32-bit (24-bit with matte)
14231492Swollman
1431553Srgrimes# FIG (Facility for Interactive Generation of figures), an object-based format
1441553Srgrimes0	search/1	#FIG		FIG image text
14531492Swollman>5	string		x		\b, version %.3s
14631492Swollman
1471553Srgrimes# PHIGS
1481553Srgrimes0	string		ARF_BEGARF		PHIGS clear text archive
1491553Srgrimes0	string		@(#)SunPHIGS		SunPHIGS
1501553Srgrimes# version number follows, in the form m.n
1511553Srgrimes>40	string		SunBin			binary
15215648Sjoerg>32	string		archive			archive
15315648Sjoerg
1541553Srgrimes# GKS (Graphics Kernel System)
15531492Swollman0	string		GKSM		GKS Metafile
15631492Swollman>24	string		SunGKS		\b, SunGKS
1571553Srgrimes
15831492Swollman# CGM image files
15931492Swollman0	string		BEGMF		clear text Computer Graphics Metafile
1601553Srgrimes
1611553Srgrimes# MGR bitmaps  (Michael Haardt, u31b3hs@pool.informatik.rwth-aachen.de)
1621553Srgrimes0	string	yz	MGR bitmap, modern format, 8-bit aligned
1631553Srgrimes0	string	zz	MGR bitmap, old format, 1-bit deep, 16-bit aligned
1641553Srgrimes0	string	xz	MGR bitmap, old format, 1-bit deep, 32-bit aligned
1651553Srgrimes0	string	yx	MGR bitmap, modern format, squeezed
1661553Srgrimes
1671553Srgrimes# Fuzzy Bitmap (FBM) images
1681553Srgrimes0	string		%bitmap\0	FBM image data
1691553Srgrimes>30	long		0x31		\b, mono
1701553Srgrimes>30	long		0x33		\b, color
1711553Srgrimes
1721553Srgrimes# facsimile data
1731553Srgrimes1	string		PC\ Research,\ Inc	group 3 fax data
1741553Srgrimes>29	byte		0		\b, normal resolution (204x98 DPI)
17531492Swollman>29	byte		1		\b, fine resolution (204x196 DPI)
17631492Swollman# From: Herbert Rosmanith <herp@wildsau.idv.uni.linz.at>
1771553Srgrimes0	string		Sfff		structured fax file
1781553Srgrimes
17931492Swollman
1801553Srgrimes# PC bitmaps (OS/2, Windows BMP files)  (Greg Roelofs, newt@uchicago.edu)
18131492Swollman0	string		BM
18231492Swollman>14	leshort		12		PC bitmap, OS/2 1.x format
1831553Srgrimes!:mime	image/x-ms-bmp
18431492Swollman>>18	leshort		x		\b, %d x
18531492Swollman>>20	leshort		x		%d
18631492Swollman>14	leshort		64		PC bitmap, OS/2 2.x format
1871553Srgrimes!:mime	image/x-ms-bmp
1881553Srgrimes>>18	leshort		x		\b, %d x
18931492Swollman>>20	leshort		x		%d
19031492Swollman>14	leshort		40		PC bitmap, Windows 3.x format
19131492Swollman!:mime	image/x-ms-bmp
1921553Srgrimes>>18	lelong		x		\b, %d x
1931553Srgrimes>>22	lelong		x		%d x
1941553Srgrimes>>28	leshort		x		%d
1951553Srgrimes>14	leshort		128		PC bitmap, Windows NT/2000 format
1961553Srgrimes!:mime	image/x-ms-bmp
1971553Srgrimes>>18	lelong		x		\b, %d x
1981553Srgrimes>>22	lelong		x		%d x
1991553Srgrimes>>28	leshort		x		%d
2001553Srgrimes# Too simple - MPi
20131492Swollman#0	string		IC		PC icon data
2021553Srgrimes#0	string		PI		PC pointer image data
2031553Srgrimes#0	string		CI		PC color icon data
2041553Srgrimes#0	string		CP		PC color pointer image data
2051553Srgrimes# Conflicts with other entries [BABYL]
2061553Srgrimes#0	string		BA		PC bitmap array data
20731492Swollman
20831492Swollman# XPM icons (Greg Roelofs, newt@uchicago.edu)
20931492Swollman# note possible collision with C/REXX entry in c-lang; currently commented out
2101553Srgrimes0	search/1	/*\ XPM\ */	X pixmap image text
2111553Srgrimes
2121553Srgrimes# Utah Raster Toolkit RLE images (janl@ifi.uio.no)
2131553Srgrimes0	leshort		0xcc52		RLE image data,
21431492Swollman>6	leshort		x		%d x
21531492Swollman>8	leshort		x		%d
21631492Swollman>2	leshort		>0		\b, lower left corner: %d
21731492Swollman>4	leshort		>0		\b, lower right corner: %d
2181553Srgrimes>10	byte&0x1	=0x1		\b, clear first
21931492Swollman>10	byte&0x2	=0x2		\b, no background
2201553Srgrimes>10	byte&0x4	=0x4		\b, alpha channel
2211553Srgrimes>10	byte&0x8	=0x8		\b, comment
2221553Srgrimes>11	byte		>0		\b, %d color channels
2231553Srgrimes>12	byte		>0		\b, %d bits per pixel
2241553Srgrimes>13	byte		>0		\b, %d color map channels
2251553Srgrimes
2261553Srgrimes# image file format (Robert Potter, potter@cs.rochester.edu)
2271553Srgrimes0	string		Imagefile\ version-	iff image data
2281553Srgrimes# this adds the whole header (inc. version number), informative but longish
2291553Srgrimes>10	string		>\0		%s
23015648Sjoerg
2311553Srgrimes# Sun raster images, from Daniel Quinlan (quinlan@yggdrasil.com)
23215648Sjoerg0	belong		0x59a66a95	Sun raster image data
23327748Simp>4	belong		>0		\b, %d x
2341553Srgrimes>8	belong		>0		%d,
2351553Srgrimes>12	belong		>0		%d-bit,
23631492Swollman#>16	belong		>0		%d bytes long,
23731492Swollman>20	belong		0		old format,
23831492Swollman#>20	belong		1		standard,
23931492Swollman>20	belong		2		compressed,
2401553Srgrimes>20	belong		3		RGB,
24131492Swollman>20	belong		4		TIFF,
2421553Srgrimes>20	belong		5		IFF,
2431553Srgrimes>20	belong		0xffff		reserved for testing,
2441553Srgrimes>24	belong		0		no colormap
2451553Srgrimes>24	belong		1		RGB colormap
2461553Srgrimes>24	belong		2		raw colormap
2471553Srgrimes#>28	belong		>0		colormap is %d bytes long
24831492Swollman
2491553Srgrimes# SGI image file format, from Daniel Quinlan (quinlan@yggdrasil.com)
2501553Srgrimes#
25131492Swollman# See
25231492Swollman#	http://reality.sgi.com/grafica/sgiimage.html
2531553Srgrimes#
25431492Swollman0	beshort		474		SGI image data
25531492Swollman#>2	byte		0		\b, verbatim
2561553Srgrimes>2	byte		1		\b, RLE
25731492Swollman#>3	byte		1		\b, normal precision
2581553Srgrimes>3	byte		2		\b, high precision
2591553Srgrimes>4	beshort		x		\b, %d-D
2601553Srgrimes>6	beshort		x		\b, %d x
2611553Srgrimes>8	beshort		x		%d
2621553Srgrimes>10	beshort		x		\b, %d channel
26315648Sjoerg>10	beshort		!1		\bs
26415648Sjoerg>80	string		>0		\b, "%s"
26531492Swollman
2661553Srgrimes0	string		IT01		FIT image data
2671553Srgrimes>4	belong		x		\b, %d x
2681553Srgrimes>8	belong		x		%d x
26915648Sjoerg>12	belong		x		%d
2701553Srgrimes#
2711553Srgrimes0	string		IT02		FIT image data
2721553Srgrimes>4	belong		x		\b, %d x
2731553Srgrimes>8	belong		x		%d x
2741553Srgrimes>12	belong		x		%d
27531492Swollman#
27631492Swollman2048	string		PCD_IPI		Kodak Photo CD image pack file
27731492Swollman>0xe02	byte&0x03	0x00		, landscape mode
2781553Srgrimes>0xe02	byte&0x03	0x01		, portrait mode
27915648Sjoerg>0xe02	byte&0x03	0x02		, landscape mode
28031492Swollman>0xe02	byte&0x03	0x03		, portrait mode
28131492Swollman0	string		PCD_OPA		Kodak Photo CD overview pack file
28231492Swollman
28331492Swollman# FITS format.  Jeff Uphoff <juphoff@tarsier.cv.nrao.edu>
28415648Sjoerg# FITS is the Flexible Image Transport System, the de facto standard for
28527748Simp# data and image transfer, storage, etc., for the astronomical community.
28615648Sjoerg# (FITS floating point formats are big-endian.)
28715648Sjoerg0	string	SIMPLE\ \ =	FITS image data
28815648Sjoerg>109	string	8		\b, 8-bit, character or unsigned binary integer
28915648Sjoerg>108	string	16		\b, 16-bit, two's complement binary integer
29031492Swollman>107	string	\ 32		\b, 32-bit, two's complement binary integer
29115648Sjoerg>107	string	-32		\b, 32-bit, floating point, single precision
2921553Srgrimes>107	string	-64		\b, 64-bit, floating point, double precision
2931553Srgrimes
29431492Swollman# other images
2951553Srgrimes0	string	This\ is\ a\ BitMap\ file	Lisp Machine bit-array-file
2961553Srgrimes
2971553Srgrimes# From SunOS 5.5.1 "/etc/magic" - appeared right before Sun raster image
29831492Swollman# stuff.
29931492Swollman#
30031492Swollman0	beshort		0x1010		PEX Binary Archive
3011553Srgrimes
3021553Srgrimes# DICOM medical imaging data
3031553Srgrimes128	string	DICM			DICOM medical imaging data
3041553Srgrimes!:mime	application/dicom
3051553Srgrimes
30631492Swollman# XWD - X Window Dump file.
30731492Swollman#   As described in /usr/X11R6/include/X11/XWDFile.h
30831492Swollman#   used by the xwd program.
30931492Swollman#   Bradford Castalia, idaeim, 1/01
31031492Swollman4	belong	7			XWD X Window Dump image data
31131492Swollman>100	string	>\0			\b, "%s"
3121553Srgrimes>16	belong	x			\b, %dx
31319202Simp>20	belong	x			\b%dx
31419202Simp>12	belong	x			\b%d
3151553Srgrimes
3161553Srgrimes# PDS - Planetary Data System
3171553Srgrimes#   These files use Parameter Value Language in the header section.
3181553Srgrimes#   Unfortunately, there is no certain magic, but the following
3191553Srgrimes#   strings have been found to be most likely.
3201553Srgrimes0	string	NJPL1I00		PDS (JPL) image data
3211553Srgrimes2	string	NJPL1I			PDS (JPL) image data
3221553Srgrimes0	string	CCSD3ZF			PDS (CCSD) image data
3231553Srgrimes2	string	CCSD3Z			PDS (CCSD) image data
3241553Srgrimes0	string	PDS_			PDS image data
3251553Srgrimes0	string	LBLSIZE=		PDS (VICAR) image data
3261553Srgrimes
3271553Srgrimes# pM8x: ATARI STAD compressed bitmap format
3281553Srgrimes#
3291553Srgrimes# from Oskar Schirmer <schirmer@scara.com> Feb 2, 2001
3301553Srgrimes# p M 8 5/6 xx yy zz data...
3311553Srgrimes# Atari ST STAD bitmap is always 640x400, bytewise runlength compressed.
3321553Srgrimes# bytes either run horizontally (pM85) or vertically (pM86). yy is the
3331553Srgrimes# most frequent byte, xx and zz are runlength escape codes, where xx is
3341553Srgrimes# used for runs of yy.
33531492Swollman#
33631492Swollman0	string	pM85		Atari ST STAD bitmap image data (hor)
3371553Srgrimes>5	byte	0x00		(white background)
3381553Srgrimes>5	byte	0xFF		(black background)
3391553Srgrimes0	string	pM86		Atari ST STAD bitmap image data (vert)
3401553Srgrimes>5	byte	0x00		(white background)
3411553Srgrimes>5	byte	0xFF		(black background)
3421553Srgrimes
3431553Srgrimes# G��rkan Seng��n <gurkan@linuks.mine.nu>, www.linuks.mine.nu
3441553Srgrimes# http://www.atarimax.com/jindroush.atari.org/afmtatr.html
3451553Srgrimes0	leshort	0x0296		Atari ATR image
3461553Srgrimes
34731492Swollman# XXX:
3481553Srgrimes# This is bad magic 0x5249 == 'RI' conflicts with RIFF and other
3491553Srgrimes# magic.
3501553Srgrimes# SGI RICE image file <mpruett@sgi.com>
3511553Srgrimes#0	beshort	0x5249		RICE image
3521553Srgrimes#>2	beshort	x		v%d
3531553Srgrimes#>4	beshort	x		(%d x
3541553Srgrimes#>6	beshort	x		%d)
35531492Swollman#>8	beshort	0		8 bit
3561553Srgrimes#>8	beshort	1		10 bit
3571553Srgrimes#>8	beshort	2		12 bit
3581553Srgrimes#>8	beshort	3		13 bit
3591553Srgrimes#>10	beshort	0		4:2:2
3601553Srgrimes#>10	beshort	1		4:2:2:4
3611553Srgrimes#>10	beshort	2		4:4:4
3621553Srgrimes#>10	beshort	3		4:4:4:4
3631553Srgrimes#>12	beshort	1		RGB
3641553Srgrimes#>12	beshort	2		CCIR601
3651553Srgrimes#>12	beshort	3		RP175
3661553Srgrimes#>12	beshort	4		YUV
3671553Srgrimes
3681553Srgrimes#------------------------------------------------------------------------------
3691553Srgrimes#
3701553Srgrimes# Marco Schmidt (marcoschmidt@users.sourceforge.net) -- an image  file format
3711553Srgrimes# for the EPOC operating system, which is used with PDAs like those from Psion
3721553Srgrimes#
37315648Sjoerg# see http://huizen.dds.nl/~frodol/psiconv/html/Index.html for a description
3741553Srgrimes# of various EPOC file formats
3751553Srgrimes
3761553Srgrimes0	string \x37\x00\x00\x10\x42\x00\x00\x10\x00\x00\x00\x00\x39\x64\x39\x47 EPOC MBM image file
3771553Srgrimes
3781553Srgrimes# PCX image files
3791553Srgrimes# From: Dan Fandrich <dan@coneharvesters.com>
3801553Srgrimes0	beshort		0x0a00	PCX ver. 2.5 image data
3811553Srgrimes0	beshort		0x0a02	PCX ver. 2.8 image data, with palette
3821553Srgrimes0	beshort		0x0a03	PCX ver. 2.8 image data, without palette
3831553Srgrimes0	beshort		0x0a04	PCX for Windows image data
3841553Srgrimes0	beshort		0x0a05	PCX ver. 3.0 image data
3851553Srgrimes>4	leshort		x      bounding box [%hd,
3861553Srgrimes>6	leshort		x      %hd] -
3871553Srgrimes>8	leshort		x      [%hd,
3881553Srgrimes>10	leshort		x      %hd],
3891553Srgrimes>65	byte		>1	%d planes each of
3901553Srgrimes>3	byte		x	%hhd-bit
3911553Srgrimes>68	byte		0	image,
3921553Srgrimes>68	byte		1	colour,
3931553Srgrimes>68	byte		2	grayscale,
3941553Srgrimes>68	byte		>2	image,
3951553Srgrimes>68	byte		<0	image,
3961553Srgrimes>12	leshort		>0	%hd x
3971553Srgrimes>>14	leshort		x      %hd dpi,
3981553Srgrimes>2	byte		0	uncompressed
3991553Srgrimes>2	byte		1	RLE compressed
40027748Simp
40127748Simp# Adobe Photoshop
40227748Simp0	string		8BPS Adobe Photoshop Image
40327748Simp!:mime	image/vnd.adobe.photoshop
40427748Simp
40527748Simp# XV thumbnail indicator (ThMO)
4061553Srgrimes0	string		P7\ 332		XV thumbnail image data
4071553Srgrimes
4081553Srgrimes# NITF is defined by United States MIL-STD-2500A
40927748Simp0	string	NITF	National Imagery Transmission Format
41027748Simp>25	string	>\0	dated %.14s
41131492Swollman
4121553Srgrimes# GEM Image: Version 1, Headerlen 8 (Wolfram Kleff)
4131553Srgrimes0	belong		0x00010008	GEM Image data
41431492Swollman>12	beshort		x		%d x
4151553Srgrimes>14	beshort		x		%d,
4161553Srgrimes>4	beshort		x		%d planes,
4171553Srgrimes>8	beshort		x		%d x
4181553Srgrimes>10	beshort		x		%d pixelsize
4191553Srgrimes
4201553Srgrimes# GEM Metafile (Wolfram Kleff)
4211553Srgrimes0	lelong		0x0018FFFF	GEM Metafile data
4221553Srgrimes>4	leshort		x		version %d
4231553Srgrimes
4241553Srgrimes#
4251553Srgrimes# SMJPEG. A custom Motion JPEG format used by Loki Entertainment
4261553Srgrimes# Software Torbjorn Andersson <d91tan@Update.UU.SE>.
4271553Srgrimes#
4281553Srgrimes0	string	\0\nSMJPEG	SMJPEG
4291553Srgrimes>8	belong	x		%d.x data
4301553Srgrimes# According to the specification you could find any number of _TXT
4311553Srgrimes# headers here, but I can't think of any way of handling that. None of
4321553Srgrimes# the SMJPEG files I tried it on used this feature. Even if such a
4331553Srgrimes# file is encountered the output should still be reasonable.
43427748Simp>16	string	_SND		\b,
43527748Simp>>24	beshort	>0		%d Hz
43627748Simp>>26	byte	8		8-bit
43727748Simp>>26	byte	16		16-bit
4381553Srgrimes>>28	string	NONE		uncompressed
4391553Srgrimes# >>28	string	APCM		ADPCM compressed
4401553Srgrimes>>27	byte	1		mono
4411553Srgrimes>>28	byte	2		stereo
4421553Srgrimes# Help! Isn't there any way to avoid writing this part twice?
44327748Simp>>32	string	_VID		\b,
4441553Srgrimes# >>>48	string	JFIF		JPEG
4451553Srgrimes>>>40	belong	>0		%d frames
44627748Simp>>>44	beshort	>0		(%d x
4471553Srgrimes>>>46	beshort	>0		%d)
4481553Srgrimes>16	string	_VID		\b,
4491553Srgrimes# >>32	string	JFIF		JPEG
45027748Simp>>24	belong	>0		%d frames
45127748Simp>>28	beshort	>0		(%d x
4521553Srgrimes>>30	beshort	>0		%d)
4531553Srgrimes
4541553Srgrimes0	string	Paint\ Shop\ Pro\ Image\ File	Paint Shop Pro Image File
45531492Swollman
45631492Swollman# "thumbnail file" (icon)
4571553Srgrimes# descended from "xv", but in use by other applications as well (Wolfram Kleff)
4581553Srgrimes0       string          P7\ 332         XV "thumbnail file" (icon) data
4591553Srgrimes
4601553Srgrimes# taken from fkiss: (<yav@mte.biglobe.ne.jp> ?)
4611553Srgrimes0       string          KiSS            KISS/GS
4621553Srgrimes>4      byte            16              color
46327748Simp>>5     byte            x               %d bit
46427748Simp>>8     leshort         x               %d colors
46527748Simp>>10    leshort         x               %d groups
46627748Simp>4      byte            32              cell
46727748Simp>>5     byte            x               %d bit
4681553Srgrimes>>8     leshort         x               %d x
4691553Srgrimes>>10    leshort         x               %d
4701553Srgrimes>>12    leshort         x               +%d
47127748Simp>>14    leshort         x               +%d
47227748Simp
4731553Srgrimes# Webshots (www.webshots.com), by John Harrison
4741553Srgrimes0       string          C\253\221g\230\0\0\0 Webshots Desktop .wbz file
4751553Srgrimes
47627748Simp# Hercules DASD image files
47727748Simp# From Jan Jaeger <jj@septa.nl>
4781553Srgrimes0       string  CKD_P370        Hercules CKD DASD image file
4791553Srgrimes>8      long    x               \b, %d heads per cylinder
4801553Srgrimes>12     long    x               \b, track size %d bytes
48131492Swollman>16     byte    x               \b, device type 33%2.2X
4821553Srgrimes
4831553Srgrimes0       string  CKD_C370        Hercules compressed CKD DASD image file
4841553Srgrimes>8      long    x               \b, %d heads per cylinder
4851553Srgrimes>12     long    x               \b, track size %d bytes
4861553Srgrimes>16     byte    x               \b, device type 33%2.2X
4871553Srgrimes
4881553Srgrimes0       string  CKD_S370        Hercules CKD DASD shadow file
4891553Srgrimes>8      long    x               \b, %d heads per cylinder
4901553Srgrimes>12     long    x               \b, track size %d bytes
4911553Srgrimes>16     byte    x               \b, device type 33%2.2X
49231492Swollman
4931553Srgrimes# Squeak images and programs - etoffi@softhome.net
4941553Srgrimes0	string		\146\031\0\0	Squeak image data
4951553Srgrimes0	search/1	'From\040Squeak	Squeak program text
4961553Srgrimes
4971553Srgrimes# partimage: file(1) magic for PartImage files (experimental, incomplete)
4981553Srgrimes# Author: Hans-Joachim Baader <hjb@pro-linux.de>
4991553Srgrimes0		string	PaRtImAgE-VoLuMe	PartImage
50015648Sjoerg>0x0020		string	0.6.1		file version %s
5011553Srgrimes>>0x0060	lelong	>-1		volume %ld
5021553Srgrimes#>>0x0064 8 byte identifier
5031553Srgrimes#>>0x007c reserved
5041553Srgrimes>>0x0200	string	>\0		type %s
5051553Srgrimes>>0x1400	string	>\0		device %s,
5061553Srgrimes>>0x1600	string	>\0		original filename %s,
5071553Srgrimes# Some fields omitted
5081553Srgrimes>>0x2744	lelong	0		not compressed
5091553Srgrimes>>0x2744	lelong	1		gzip compressed
5101553Srgrimes>>0x2744	lelong	2		bzip2 compressed
51131492Swollman>>0x2744	lelong	>2		compressed with unknown algorithm
51231492Swollman>0x0020		string	>0.6.1		file version %s
5131553Srgrimes>0x0020		string	<0.6.1		file version %s
5141553Srgrimes
5151553Srgrimes# DCX is multi-page PCX, using a simple header of up to 1024
5161553Srgrimes# offsets for the respective PCX components.
51731492Swollman# From: Joerg Wunsch <joerg_wunsch@uriah.heep.sax.de>
5181553Srgrimes0	lelong	987654321	DCX multi-page PCX image data
5191553Srgrimes
5201553Srgrimes# Simon Walton <simonw@matteworld.com>
52127748Simp# Kodak Cineon format for scanned negatives
52227748Simp# http://www.kodak.com/US/en/motion/support/dlad/
5231553Srgrimes0	lelong  0xd75f2a80	Cineon image data
5241553Srgrimes>200	belong  >0		\b, %ld x
5251553Srgrimes>204	belong  >0		%ld
5261553Srgrimes
5271553Srgrimes
5281553Srgrimes# Bio-Rad .PIC is an image format used by microscope control systems
5291553Srgrimes# and related image processing software used by biologists.
5301553Srgrimes# From: Vebjorn Ljosa <vebjorn@ljosa.com>
5311553Srgrimes54	leshort 12345		Bio-Rad .PIC Image File
5321553Srgrimes>0	leshort >0		%hd x
5331553Srgrimes>2	leshort >0		%hd,
5341553Srgrimes>4	leshort =1		1 image in file
5351553Srgrimes>4	leshort >1		%hd images in file
5361553Srgrimes
5371553Srgrimes# From Jan "Yenya" Kasprzak <kas@fi.muni.cz>
5381553Srgrimes# The description of *.mrw format can be found at
5391553Srgrimes# http://www.dalibor.cz/minolta/raw_file_format.htm
5401553Srgrimes0	string	\000MRM			Minolta Dimage camera raw image data
5411553Srgrimes
5421553Srgrimes# Summary: DjVu image / document
5431553Srgrimes# Extension: .djvu
54431492Swollman# Reference: http://djvu.org/docs/DjVu3Spec.djvu
54531492Swollman# Submitted by: Stephane Loeuillet <stephane.loeuillet@tiscali.fr>
5461553Srgrimes# Modified by (1): Abel Cheung <abelcheung@gmail.com>
5471553Srgrimes0	string	AT&TFORM
5481553Srgrimes!:mime	image/vnd.djvu
5491553Srgrimes>12	string	DJVM		DjVu multiple page document
5501553Srgrimes>12	string	DJVU		DjVu image or single page document
55131492Swollman>12	string	DJVI		DjVu shared document
5521553Srgrimes>12	string	THUM		DjVu page thumbnails
5531553Srgrimes
5541553Srgrimes
5551553Srgrimes# From Marc Espie
5561553Srgrimes0	lelong	20000630		OpenEXR image data
5571553Srgrimes
5581553Srgrimes# From: Tom Hilinski <tom.hilinski@comcast.net>
5591553Srgrimes# http://www.unidata.ucar.edu/packages/netcdf/
5601553Srgrimes0	string	CDF\001			NetCDF Data Format data
5611553Srgrimes
5621553Srgrimes#-----------------------------------------------------------------------
5631553Srgrimes# Hierarchical Data Format, used to facilitate scientific data exchange
5641553Srgrimes# specifications at http://hdf.ncsa.uiuc.edu/
5651553Srgrimes0	belong	0x0e031301	Hierarchical Data Format (version 4) data
5661553Srgrimes!:mime	application/x-hdf
5671553Srgrimes0	string	\211HDF\r\n\032	Hierarchical Data Format (version 5) data
56831492Swollman!:mime	application/x-hdf
56931492Swollman
57031492Swollman# From: Tobias Burnus <burnus@net-b.de>
5711553Srgrimes# Xara (for a while: Corel Xara) is a graphic package, see
57231492Swollman# http://www.xara.com/ for Windows and as GPL application for Linux
57331492Swollman0	string	XARA\243\243	Xara graphics file
57431492Swollman
5751553Srgrimes# http://www.cartesianinc.com/Tech/
5761553Srgrimes0	string	CPC\262		Cartesian Perceptual Compression image
5771553Srgrimes!:mime	image/x-cpi
5781553Srgrimes
5791553Srgrimes# From Albert Cahalan <acahalan@gmail.com>
5801553Srgrimes# puredigital used it for the CVS disposable camcorder
5811553Srgrimes#8       lelong  4       ZBM bitmap image data
5821553Srgrimes#>4      leshort x       %u x
5831553Srgrimes#>6      leshort x       %u
5841553Srgrimes
58531492Swollman# From Albert Cahalan <acahalan@gmail.com>
5861553Srgrimes# uncompressed 5:6:5 HighColor image for OLPC XO firmware icons
5871553Srgrimes0       string C565     OLPC firmware icon image data
5881553Srgrimes>4      leshort x       %u x
5891553Srgrimes>6      leshort x       %u
5901553Srgrimes
5911553Srgrimes# Applied Images - Image files from Cytovision
5925445Sjoerg# Gustavo Junior Alves <gjalves@gjalves.com.br>
5935445Sjoerg0	string	\xce\xda\xde\xfa	Cytovision Metaphases file
5941553Srgrimes0	string	\xed\xad\xef\xac	Cytovision Karyotype file
5951553Srgrimes0	string	\x0b\x00\x03\x00	Cytovision FISH Probe file
5961553Srgrimes0	string	\xed\xfe\xda\xbe	Cytovision FLEX file
5971553Srgrimes0	string	\xed\xab\xed\xfe	Cytovision FLEX file
59831492Swollman0	string	\xad\xfd\xea\xad	Cytovision RATS file
5991553Srgrimes
6001553Srgrimes# Wavelet Scalar Quantization format used in gray-scale fingerprint images
6018094Sjkh# From Tano M Fotang <mfotang@quanteq.com>
60231492Swollman0	string	\xff\xa0\xff\xa8\x00	Wavelet Scalar Quantization image data
6031553Srgrimes