How to use the gemini-core.Image.fromBase64 function in gemini-core

To help you get started, we’ve selected a few gemini-core examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github gemini-testing / hermione / lib / worker / runner / test-runner / one-time-screenshooter.js View on Github external
async extendWithPageScreenshot(error) {
        if (!this._config.screenshotOnReject || error.screenshot || this._screenshotTaken) {
            return error;
        }

        this._screenshotTaken = true;
        this._browser.setHttpTimeout(this._config.screenshotOnRejectTimeout);

        try {
            const {value: base64} = await this._browser.publicAPI.screenshot();
            const size = Image.fromBase64(base64).getSize();

            error = _.extend(error, {screenshot: {base64, size}});
        } catch (e) {
            logger.warn(`WARN: Failed to take screenshot on reject: ${e}`);
        }

        this._browser.restoreHttpTimeout();

        return error;
    }
};
github gemini-testing / hermione / lib / browser / camera.js View on Github external
.then((screenData) => {
                const image = Image.fromBase64(screenData.value);

                return this._applyCalibration(image);
            });
    }