Skip to content

component/datauri-dimensions

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

datauri-dimensions

Parse the dimensions of a data URI png / jpeg

Installation

$ component install component/datauri-dimensions

Example

var size = require('datauri-dimensions');

var canvas = document.createElement('canvas');
canvas.width = 100;
canvas.height = 150;

var uri = canvas.toDataURL('image/jpeg');
console.log(size(uri));

var uri = canvas.toDataURL('image/png');
console.log(size(uri));

License

MIT

About

Return dimensions from a Data URI

Resources

Stars

Watchers

Forks

Packages

No packages published

Contributors 3

  •  
  •  
  •