browser-image-size
Advanced tools
Comparing version 1.0.1 to 1.0.2
1.0.2 / 2015-04-14 | ||
================== | ||
* Use object-url to create and revoke url | ||
1.0.1 / 2015-04-14 | ||
@@ -3,0 +9,0 @@ ================== |
/* istanbul ignore next */ | ||
var DOMURL = window.URL || window.webkitURL || window | ||
var DOMURL = require('object-url') | ||
@@ -11,3 +11,3 @@ /** | ||
return new Promise(function (resolve, reject) { | ||
var url = typeof image === 'string' ? image : DOMURL.createObjectURL(image) | ||
var url = typeof image === 'string' ? image : DOMURL.create(image) | ||
if (!url) throw new Error('Must use a valid image') | ||
@@ -18,3 +18,3 @@ | ||
if (typeof image !== 'string') | ||
DOMURL.revokeObjectURL(url) | ||
DOMURL.revoke(url) | ||
resolve({width: img.width, height: img.height}) | ||
@@ -25,3 +25,3 @@ } | ||
if (typeof image !== 'string') | ||
DOMURL.revokeObjectURL(url) | ||
DOMURL.revoke(url) | ||
reject(err) | ||
@@ -28,0 +28,0 @@ } |
{ | ||
"name": "browser-image-size", | ||
"version": "1.0.1", | ||
"version": "1.0.2", | ||
"description": "Get image size in the browser", | ||
@@ -35,3 +35,6 @@ "main": "lib/index.js", | ||
"zuul": "^2.1.1" | ||
}, | ||
"dependencies": { | ||
"object-url": "^1.0.0" | ||
} | ||
} |
Sorry, the diff of this file is not supported yet
5424
1
+ Addedobject-url@^1.0.0
+ Addedobject-url@1.0.0(transitive)