Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

probe-image-size

Package Overview
Dependencies
Maintainers
1
Versions
32
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

probe-image-size - npm Package Compare versions

Comparing version 1.0.0 to 1.0.1

7

CHANGELOG.md

@@ -0,1 +1,8 @@

1.0.1 / 2015-09-14
------------------
- Return image length when possible.
- Support URLs in dev helper script.
1.0.0 / 2015-09-12

@@ -2,0 +9,0 @@ ------------------

12

lib/index.js

@@ -23,3 +23,3 @@

// prevent "possible EventEmitter memory leak" warnings
stream.setMaxListeners(Infinity);
stream.setMaxListeners(0);

@@ -56,2 +56,12 @@ async.map(parsers, function (parser, next) {

req.abort();
if (result) {
var length = res.headers['content-length'];
/* eslint-disable eqeqeq */
if (length == +length) {
result.length = +length;
}
}
callback(err, result);

@@ -58,0 +68,0 @@ });

2

package.json
{
"name": "probe-image-size",
"version": "1.0.0",
"version": "1.0.1",
"description": "Get image size without full download (JPG, GIF, PNG, WebP, BMP, TIFF, PSD)",

@@ -5,0 +5,0 @@ "keywords": [

@@ -33,3 +33,3 @@ probe-image-size

probe({ url: 'http://example.com/image.jpg', timeout: 5000 }, function (err, result) {
console.log(result); // => { width: xx, height: yy, type: 'jpg', mime: 'image/jpeg' }
console.log(result); // => { width: xx, height: yy, length: zz, type: 'jpg', mime: 'image/jpeg' }
});

@@ -59,3 +59,4 @@

- __String__ - URL to fetch
- __Object__ - options for [request](https://github.com/request/request)
- __Object__ - options for [request](https://github.com/request/request),
defaults are `{ timeout: 5000, maxRedirects: 2 }`
- __Stream__ - readable stream

@@ -69,2 +70,3 @@

height: YY,
length: ZZ, // byte length of the file (if available, HTTP only)
type: ..., // image 'type' (usual file name extention)

@@ -71,0 +73,0 @@ mime: ... // mime type

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc