diff options
author | Lars Henrik Mai <lars.mai@kontinui.de> | 2014-09-21 12:25:47 +0200 |
---|---|---|
committer | Lars Henrik Mai <lars.mai@kontinui.de> | 2014-09-21 12:25:47 +0200 |
commit | 7cc7910df63d19e7ebc67bb1156437f0559712d7 (patch) | |
tree | 66f972354559fe05b7a97efccd08fc363c91cf4d /source/bower_components/modernizr/feature-detects/img-apng.js | |
parent | 450a01136a510adc4c96ff12e05e00a2ce550c8f (diff) |
add foundation via bower
Diffstat (limited to 'source/bower_components/modernizr/feature-detects/img-apng.js')
-rw-r--r-- | source/bower_components/modernizr/feature-detects/img-apng.js | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/source/bower_components/modernizr/feature-detects/img-apng.js b/source/bower_components/modernizr/feature-detects/img-apng.js new file mode 100644 index 0000000..069ac93 --- /dev/null +++ b/source/bower_components/modernizr/feature-detects/img-apng.js @@ -0,0 +1,26 @@ +// Animated PNG +// http://en.wikipedia.org/wiki/APNG +// By Addy Osmani +(function () { + + if (!Modernizr.canvas) return false; + + var image = new Image(), + canvas = document.createElement('canvas'), + ctx = canvas.getContext('2d'); + + + image.onload = function () { + Modernizr.addTest('apng', function () { + if (typeof canvas.getContext == 'undefined') { + return false; + } else { + ctx.drawImage(image, 0, 0); + return ctx.getImageData(0, 0, 1, 1).data[3] === 0; + } + }); + }; + + image.src = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAACGFjVEwAAAABAAAAAcMq2TYAAAANSURBVAiZY2BgYPgPAAEEAQB9ssjfAAAAGmZjVEwAAAAAAAAAAQAAAAEAAAAAAAAAAAD6A+gBAbNU+2sAAAARZmRBVAAAAAEImWNgYGBgAAAABQAB6MzFdgAAAABJRU5ErkJggg=="; + +}()); |