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

meta("image");

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

    bDetected = bDetected || Boolean(sName);

    return result();
}