#------------------------------------------------------------------------------
# images:  file(1) magic for image formats (see also "iff")
#
# originally from jef@helios.ee.lbl.gov (Jef Poskanzer),
# additions by janl@ifi.uio.no as well as others. Jan also suggested
# merging several one- and two-line files into here.
#
# little magic: PCX (first byte is 0x0a)
# no magic: Targa

# PBMPLUS images
# The next byte following the magic is always whitespace.
0	string		P1		pbm.xpm,xbm.xpm:::$viewImage,$edit:::PBM image text
0	string		P2		pgm.xpm,xbm.xpm:::$viewImage,$edit:::PGM image text
0	string		P3		ppm.xpm,xpm.xpm:::$viewImage,$edit:::PPM image text
0	string		P4		pbm.xpm,xbm.xpm:::$viewImage:::PBM "rawbits" image data
0	string		P5		pgm.xpm,xbm.xpm:::$viewImage:::PGM "rawbits" image data
0	string		P6		ppm.xpm,xpm.xpm:::$viewImage:::PPM "rawbits" image data

# NIFF (Navy Interchange File Format, a modification of TIFF) images
0	string		IIN1		tiff.xpm,xpm.xpm:::$viewImage:::NIFF image data

# Tag Image File Format, from Daniel Quinlan (quinlan@yggdrasil.com)
# The second word of TIFF files is the TIFF version number, 42, which has
# never changed.  The TIFF specification recommends testing for it.
0	string		MM\x00\x2a	ppm.xpm,xpm.xpm:::$viewImage:::TIFF image, big-endian
0	string		II\x2a\x00	ppm.xpm,xpm.xpm:::$viewImage:::TIFF image, little-endian

# PNG [Portable Network Graphics, or "PNG's Not GIF"] images
# (Greg Roelofs, newt@uchicago.edu)
#
# 137 P N G \r \n ^Z \n [4-byte length] H E A D [HEAD data] [HEAD crc] ...
#
0	string		\x89PNG		picture.xpm,prism.xpm:::$viewImage:::PNG image data,

# GIF
0	string		GIF8		gif.xpm,gif_s.xpm:darkmagenta::$viewImage:::GIF image data

# ITC (CMU WM) raster files.  It is essentially a byte-reversed Sun raster,
# 1 plane, no encoding.
0	string		\361\0\100\273	picture.xpm,prism.xpm:::$viewImage:::CMU window manager ...

# Magick Image File Format
0	string		id=ImageMagick	picture.xpm,prism.xpm:::$viewImage:::MIFF image data

# Artisan
0	long		1123028772	picture.xpm,prism.xpm:::$viewImage:::Artisan image data

# FIG (Facility for Interactive Generation of figures), an object-based format
0	string		#FIG		fig.xpm,xbm.xpm:blue3::$viewFig:::FIG image text

# PHIGS
0	string		ARF_BEGARF		picture.xpm,prism.xpm:::$viewImage:::PHIGS clear text archive
0	string		@(#)SunPHIGS		picture.xpm,prism.xpm:::$viewImage:::SunPHIGS
# version number follows, in the form m.n

# GKS (Graphics Kernel System)
0	string		GKSM		picture.xpm,prism.xpm:::$viewImage:::GKS Metafile

# CGM image files
0	string		BEGMF		clear text Computer Graphics Metafile
# XXX - questionable magic
0	beshort&0xffe0	0x0020		binary Computer Graphics Metafile
0	beshort		0x3020		character Computer Graphics Metafile

# JPEG images
# SunOS 5.5.1 had
#
#	0	string		\377\330\377\340	JPEG file
#	0	string		\377\330\377\356	JPG file
#
# both of which turn into "JPEG image data" here.
#
0	beshort		0xffd8		jpeg.xpm,jpeg_s.xpm:::$viewImage:::JPEG image data
# HSI is Handmade Software's proprietary JPEG encoding scheme
0	string		hsi1		jepg.xpm,jpeg_s.xpm:::$viewImage:::JPEG image data, HSI proprietary

# PC bitmaps (OS/2, Windoze BMP files)  (Greg Roelofs, newt@uchicago.edu)
0	string		BM		picture.xpm,xbm.xpm:::$viewImage:::PC bitmap data
0	string		IC		picture.xpm,xbm.xpm:::$viewImage:::PC icon data
0	string		PI		picture.xpm,xbm.xpm:::$viewImage:::PC pointer image data
0	string		CI		picture.xpm,xbm.xpm:::$viewImage:::PC color icon data
0	string		CP		picture.xpm,xbm.xpm:::$viewImage:::PC color pointer image data
# Conflicts with other entries [BABYL]

# XPM icons (Greg Roelofs, newt@uchicago.edu)
# note possible collision with C/REXX entry in c-lang; currently commented out
0	string		/*\ XPM\ */	XPM.xpm,xpm.xpm:::$viewImage,$edit:::X pixmap image text

# Utah Raster Toolkit RLE images (janl@ifi.uio.no)
0	leshort		0xcc52		rle.xpm,gif_s.xpm:::$viewImage:::RLE image data,

# Sun raster images, from Daniel Quinlan (quinlan@yggdrasil.com)
0	belong		0x59a66a95	ras.xpm,gif_s.xpm:::$viewImage:::Sun raster image data

# SGI image file format, from Daniel Quinlan (quinlan@yggdrasil.com)
# file://sgi.com/graphics/SGIIMAGESPEC
0	beshort		474		rgb.xpm,gif_s.xpm:::$viewImage:::SGI image data

0	string		IT01		picture.xpm,xbm.xpm:::$viewImage:::FIT image data
#
0	string		IT02		picture.xpm,xbm.xpm:::$viewImage:::FIT image data
#
2048	string		PCD_IPI		picture.xpm,xbm.xpm:::$viewImage:::Kodak Photo CD image pack file
0	string		PCD_OPA		picture.xpm,xbm.xpm:::$viewImage:::Kodak Photo CD overview pack file

# FITS format.  Jeff Uphoff <juphoff@tarsier.cv.nrao.edu>
# FITS is the Flexible Image Transport System, the de facto standard for
# data and image transfer, storage, etc., for the astronomical community.
# (FITS floating point formats are big-endian.)
0	string	SIMPLE\ \ =	picture.xpm,xbm.xpm:::$viewImage:::FITS image data

# From SunOS 5.5.1 "/etc/magic" - appeared right before Sun raster image
# stuff.
#
0	beshort		0x1010		picture.xpm,xbm.xpm:::$viewImage:::PEX Binary Archive

# pbm:  file(1) magic for Portable Bitmap files
#
# XXX - byte order?
#
0	short	0x2a17	   pbm.xpm,xbm.xpm:::$viewImage:::"compact bitmap" format (Poskanzer)

