function decode(dataURI) {
        if (!/data:image\//.test(dataURI)) {
            log.error("image-data-uri", "It seems that it is not an Image Data URI. Couldn't match \"data:image/\"");
            return null;
        }

        let regExMatches = dataURI.match("data:(image/.*);base64,(.*)");
        return {
            imageType: regExMatches[1],
            dataBase64: regExMatches[2],
            dataBuffer: new Buffer(regExMatches[2], "base64")
        };
    }
Decode the data:image/ URI
@param {string} dataURI data:image/ URI to decode
@returns {?object} An object with properties "imageType" and "dataBase64".
The former is the image type, e.g., "png", and the latter is a base64
encoded string of the image's binary data. If it fails to parse, returns
null instead of an object.