// Detect It Easy: detection rule file
// Author: LinXP

meta("image", "DirectDraw Surface (.DDS)");

function detect() {
    if (Binary.getSize() >= 0x40) {
        if (Binary.compare("'DDS '7C000000")) {
            bDetected = true;
            if (Binary.isVerbose()) {
                sOption(Binary.read_uint32(0x0C) + "x" + Binary.read_uint32(0x10));
                var sFourCC = Binary.getString(0x54, 0x04);
                if (sFourCC) {
                    sOption("compressed: " + sFourCC);
                } else {
                    sOption("uncompressed");
                }
                if (Binary.read_uint32(0x1C)) {
                    sOption("MipMap");
                }
            }
        }
    }

    return result();
}