Skip to content

Commit

Permalink
jpeg 2000 detection
Browse files Browse the repository at this point in the history
  • Loading branch information
EricWVGG committed Sep 28, 2015
1 parent ca5983f commit f18059a
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 0 deletions.
29 changes: 29 additions & 0 deletions feature-detects/img/jpeg2000.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
/*!
{
"name": "JPEG 2000",
"async": true,
"aliases": ["jpeg-2000", "jpg2"],
"property": "jpeg2000",
"tags": ["image"],
"authors": ["@eric_wvgg"],
"notes": [{
"name": "Wikipedia Article",
"href": "http://en.wikipedia.org/wiki/JPEG_2000"
}]
}
!*/
/* DOC
Test for JPEG 2000 support
*/
define(['Modernizr', 'addTest'], function(Modernizr, addTest) {

Modernizr.addAsyncTest(function() {
var image = new Image();

image.onload = image.onerror = function() {
addTest('jpeg2000', image.width == 1);
};

image.src = 'data:image/jp2;base64,/0//UQAyAAAAAAABAAAAAgAAAAAAAAAAAAAABAAAAAQAAAAAAAAAAAAEBwEBBwEBBwEBBwEB/1IADAAAAAEAAAQEAAH/XAAEQED/ZAAlAAFDcmVhdGVkIGJ5IE9wZW5KUEVHIHZlcnNpb24gMi4wLjD/kAAKAAAAAABYAAH/UwAJAQAABAQAAf9dAAUBQED/UwAJAgAABAQAAf9dAAUCQED/UwAJAwAABAQAAf9dAAUDQED/k8+kEAGvz6QQAa/PpBABr994EAk//9k=';
});
});
1 change: 1 addition & 0 deletions lib/config-all.json
Original file line number Diff line number Diff line change
Expand Up @@ -177,6 +177,7 @@
"iframe/srcdoc",
"img/apng",
"img/jpegxr",
"img/jpeg2000",
"img/sizes",
"img/srcset",
"img/webp",
Expand Down
1 change: 1 addition & 0 deletions test/browser/integration/caniuse.js
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@ window.caniusecb = function(caniuse) {
inlinesvg: 'svg-html5',
inputtypes: 'forms',
jpegxr: 'jpegxr',
jpeg2000: 'jpeg2000',
json: 'json',
localstorage: 'namevalue-storage',
mathml: 'mathml',
Expand Down

0 comments on commit f18059a

Please sign in to comment.