probe-image-size
Advanced tools
Comparing version 2.0.0 to 2.0.1
@@ -0,1 +1,7 @@ | ||
2.0.1 / 2016-07-01 | ||
------------------ | ||
- Fixed bug in streams cleanup condition. | ||
2.0.0 / 2016-06-25 | ||
@@ -2,0 +8,0 @@ ------------------ |
{ | ||
"name": "probe-image-size", | ||
"version": "2.0.0", | ||
"version": "2.0.1", | ||
"description": "Get image size without full download (JPG, GIF, PNG, WebP, BMP, TIFF, PSD)", | ||
@@ -5,0 +5,0 @@ "keywords": [ |
@@ -11,3 +11,10 @@ probe-image-size | ||
Key features: | ||
- small size, no heavy dependencies | ||
- works with remote and local data | ||
- effective with big images (speed/memory), download minimal data from remotes | ||
- easy to browserify (splitted to components) | ||
Install | ||
@@ -29,3 +36,13 @@ ------- | ||
probe('http://example.com/image.jpg', function (err, result) { | ||
console.log(result); // => { width: xx, height: yy, type: 'jpg', mime: 'image/jpeg', wUnits: 'px', hUnits: 'px' } | ||
console.log(result); // => | ||
/* | ||
{ | ||
width: xx, | ||
height: yy, | ||
type: 'jpg', | ||
mime: 'image/jpeg', | ||
wUnits: 'px', | ||
hUnits: 'px' | ||
} | ||
*/ | ||
}); | ||
@@ -36,3 +53,3 @@ | ||
probe({ url: 'http://example.com/image.jpg', timeout: 5000 }, function (err, result) { | ||
console.log(result); // => { width: xx, height: yy, length: zz, type: 'jpg', mime: 'image/jpeg', wUnits: 'px', hUnits: 'px' } | ||
console.log(result); | ||
}); | ||
@@ -43,3 +60,3 @@ | ||
probe('http://example.com/image.jpg').then(function (result) { | ||
console.log(result); // => { width: xx, height: yy, type: 'jpg', mime: 'image/jpeg', wUnits: 'px', hUnits: 'px' } | ||
console.log(result); | ||
}); | ||
@@ -53,3 +70,2 @@ | ||
console.log(result); | ||
// => { width: xx, height: yy, type: 'jpg', mime: 'image/jpeg', wUnits: 'px', hUnits: 'px' } | ||
@@ -65,3 +81,3 @@ // terminate input, depends on stream type, | ||
console.log(probe.sync(data)); // => { width: xx, height: yy, type: 'jpg', mime: 'image/jpeg', wUnits: 'px', hUnits: 'px' } | ||
console.log(probe.sync(data)); | ||
``` | ||
@@ -68,0 +84,0 @@ |
@@ -36,8 +36,6 @@ 'use strict'; | ||
if (strm) { | ||
stream.unpipe(strm); | ||
strm.end(); | ||
i = pStreams.indexOf(strm); | ||
if (i) { | ||
stream.unpipe(pStreams[i]); | ||
pStreams[i].end(); | ||
pStreams.splice(i, 1); | ||
} | ||
if (i >= 0) pStreams.splice(i, 1); | ||
return; | ||
@@ -44,0 +42,0 @@ } |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
141
40202
1094