Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
function testWepP(callback) {
var webP = new Image();
webP.src = 'data:image/webp;base64,UklGRi4AAABXRUJQVlA4TCEAAAAvAUAAEB8wAiMw' +
'AgSSNtse/cXjxyCCmrYNWPwmHRH9jwMA';
webP.onload = webP.onerror = function () {
callback(webP.height === 2);
};
};
testWebP(function(supported) {
console.log((supported) ? "webP 0.2.0 supported!" : "webP not supported.");
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment