Skip to content

Commit

Permalink
Merge pull request Modernizr#1036 from patrickkettner/jpeg-xr
Browse files Browse the repository at this point in the history
add jpeg xr test
  • Loading branch information
patrickkettner committed Nov 26, 2013
2 parents 5cd728d + 0663530 commit 1ffc829
Showing 1 changed file with 30 additions and 0 deletions.
30 changes: 30 additions & 0 deletions feature-detects/img/jpegxr.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
/*!
{
"name": "JPEG XR (extended range)",
"async": true,
"aliases": ["jpeg-xr"],
"property": "jpegxr",
"tags": ["image"],
"notes": [{
"name": "Wikipedia Article",
"href": "http://en.wikipedia.org/wiki/JPEG_XR"
}]
}
!*/
/* DOC
Test for JPEG XR support
*/
define(['Modernizr', 'addTest'], function( Modernizr, addTest ) {

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

image.onload = image.onerror = function() {
addTest('jpegxr', image.width == 1, { aliases: ['jpeg-xr'] });
};

image.src = 'data:image/vnd.ms-photo;base64,SUm8AQgAAAAFAAG8AQAQAAAASgAAAIC8BAABAAAAAQAAAIG8BAABAAAAAQAAAMC8BAABAAAAWgAAAMG8BAABAAAAHwAAAAAAAAAkw91vA07+S7GFPXd2jckNV01QSE9UTwAZAYBxAAAAABP/gAAEb/8AAQAAAQAAAA==';
});
});

0 comments on commit 1ffc829

Please sign in to comment.