// Detect It Easy: detection rule file format
// Authors: hypn0 <hypn0@mail.ru>, Kaens (TG@kaens)

init("image", "");

function detect(bShowType, bShowVersion, bShowOptions) {
    if (Binary.compare("d7cdc69a0000")) {
        bDetected = true;
        sName = "Windows MetaFile (.WMF)";
    } else if (Binary.compare("ff4fff51002f0000")) {
        bDetected = true;
        sName = "JPEG-2000 Code Stream (.JP2)";
    } else if (Binary.compare("0000000C6A50....................'ftypjp2'..........'jp2'20")) {
        bDetected = true;
        sName = "LuraWave JPEG-2000 (.JP2)";
    } else if (Binary.compare("'P4'0a")) {
        bDetected = true;
        sName = "Unix Portable BitMap (.PBM)";
    } else if (Binary.compare("'P5'0a") || Binary.compare("'P6'0a")) {
        bDetected = true;
        sName = "Portable BitMap Package (.PPM)";
    } else if (Binary.compare("01da010100")) {
        bDetected = true;
        sName = "Silicon Graphics bitmap (.SGI)";
    } else if (Binary.compare("010009000003............................................'WMFC'")) {
        bDetected = true;
        sName = "Windows Metafile (old Win 3.x format) (.WMF)";
    } else if (Binary.compare("01000000640000000000000000000000") && Binary.compare("'EMF'000001", 0x29)) {
        bDetected = true;
        sName = "Windows Enhanced Metafile (.EMF)";
    } else if (Binary.compare("'WGq'")) {
        bDetected = true;
        sName = "Liar-soft Windows Computer Graphics image (.WCG)";
    }

    return result(bShowType, bShowVersion, bShowOptions);
}