// DIE's signature file
// Author: hypn0 <hypn0@mail.ru>

init("image","");

function detect(bShowType,bShowVersion,bShowOptions)
{
    if(Binary.compare("0a0501..00000000"))
    {
        bDetected=1;
        sName="ZSoft image (.PCX)";
    }
    else if(Binary.compare("d7cdc69a0000"))
    {
        bDetected=1;
        sName="Windows MetaFile (.WMF)";
    }
    else if(Binary.compare("..0101000000011800000000"))
    {
        bDetected=1;
        sName="Targa bitmap (.TGA)";
    }
    else if(Binary.compare("00000a000000011800000000"))
    {
        bDetected=1;
        sName="Targa bitmap (.TGA)";
    }
    else if(Binary.compare("'TRUEVISION-XFILE.'", Binary.getSize()-18))
    {
        bDetected=1;
        sName="Targa bitmap (New TGA format) (.TGA)";
    }
    else if(Binary.compare("ff4fff51002f0000"))
    {
        bDetected=1;
        sName="JPEG-2000 Code Stream (.JP2)";
    }
    else if(Binary.compare("0000000C6A50....................'ftypjp2'..........'jp2'20"))
    {
        bDetected=1;
        sName="LuraWave JPEG-2000 (.JP2)";
    }
    else if(Binary.compare("'8BPS'00010000"))
    {
        bDetected=1;
        sName="Adobe Photoshop (.PSD)";
    }
    else if(Binary.compare("'P4'0a"))
    {
        bDetected=1;
        sName="Unix Portable BitMap (.PBM)";
    }
    else if(Binary.compare("'P5'0a")||Binary.compare("'P6'0a"))
    {
        bDetected=1;
        sName="Portable BitMap Package (.PPM)";
    }
    else if(Binary.compare("01da010100"))
    {
        bDetected=1;
        sName="Silicon Graphics bitmap (.SGI)";
    }
    else if(Binary.compare("'DDS '7C00000007100000"))
    {
        bDetected=1;
        sName="DirectX DirectDraw Surface (.DDS)";
    }
    else if(Binary.compare("010009000003............................................'WMFC'"))
    {
        bDetected=1;
        sName="Windows Metafile (old Win 3.x format) (.WMF)";
    }
    else if(Binary.compare("8B'JNG'0D0A1A0A00000010'JHDR'"))
    {
        bDetected=1;
        sName="JPEG Network Graphics (.JNG)";
    }
    else if(Binary.compare("01000000640000000000000000000000")&&Binary.compare("'EMF'000001", 0x29))
    {
        bDetected=1;
        sName="Windows Enhanced Metafile (.EMF)";
    }
    else if(Binary.compare("'AT&TFORM'........'DJVM'"))
    {
        bDetected=1;
        sName="DjVu image (.DJVU)";
    }

    return result(bShowType,bShowVersion,bShowOptions);
}
