fixture-images
v0.1.5
Published
Animated GIF/PNG/WEBP and Static GIF/PNG/WEBP/BMP/JPG/JXR/PSD/TIF
Downloads
8
Readme
Fixture images
animated.GIF
animated.PNG
animated.WEBP
still.GIF
still.PNG
still.WEBP
still.JPG
still.JXR(JPEG-XR)
still.BMP
still.PSD
still.TIF
Usage
Via npm
$ npm install fixture-images --save-dev
var animated= require('fixture-images').animated;
console.log(animated.gif);// [47,49,46,38,39,61,...]
Via bower
$ bower install fixture-images --save-dev
<script src="/bower_components/fixture-images/all.min.js"></script>
<script>
var animated= fixtureImages.animated;
console.log(animated.gif);// [47,49,46,38,39,61,...]
</script>
Via http/https
in Node.js
$ npm install request --save-dev
var url= 'http://cdn.rawgit.com/59naga/fixture-images/master/animated.GIF';
var request= require('request');
request.get({url:url,encoding:null},function(error,response,buffer){
console.log(buffer);// [47,49,46,38,39,61,...]
});
in Browser
<script>
var url= 'https://cdn.rawgit.com/59naga/fixture-images/master/animated.GIF';
var xhr= new XMLHttpRequest;
xhr.open('GET',url,true);
xhr.responseType= 'arraybuffer';
xhr.send();
xhr.onload= function(){
var binary= new Uint8Array(xhr.response);
var blob= new Blob([binary],{type:'image/gif'});
window.open(URL.createObjectURL(blob));
}
</script>