Skip to content

Instantly share code, notes, and snippets.

@rictorres
Created May 11, 2015 16:04
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rictorres/0fbbe8a05212d9cde7e0 to your computer and use it in GitHub Desktop.
Save rictorres/0fbbe8a05212d9cde7e0 to your computer and use it in GitHub Desktop.
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