Socket
Socket
Sign inDemoInstall

image-size

Package Overview
Dependencies
Maintainers
3
Versions
65
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

image-size - npm Package Compare versions

Comparing version 0.5.5 to 0.6.0

lib/types/cur.js

10

bin/image-size.js

@@ -25,6 +25,8 @@ #!/usr/bin/env node

var size = imageSize(image);
var label = green[0] + size.width + green[1] +
grey[0] + 'x' + grey[1] +
green[0] + size.height + green[1];
console.info(label, '-', grey[0] + image + grey[1]);
(size.images || [size]).forEach(function (size) {
var label = green[0] + size.width + green[1] +
grey[0] + 'x' + grey[1] +
green[0] + size.height + green[1];
console.info(label, '-', grey[0] + image + grey[1]);
});
} else {

@@ -31,0 +33,0 @@ console.error('file doesn\'t exist - ', image);

2

lib/types.js

@@ -5,3 +5,5 @@ 'use strict';

'bmp',
'cur',
'gif',
'ico',
'jpg',

@@ -8,0 +10,0 @@ 'png',

{
"name": "image-size",
"version": "0.5.5",
"version": "0.6.0",
"description": "get dimensions of any image file",

@@ -11,3 +11,3 @@ "main": "lib/index.js",

"engines": {
"node": ">=0.10.0"
"node": ">=4.0"
},

@@ -37,3 +37,5 @@ "bin": {

"webp",
"svg"
"svg",
"ico",
"cur"
],

@@ -40,0 +42,0 @@ "author": "netroy <aditya@netroy.in> (http://netroy.in/)",

@@ -14,3 +14,5 @@ # image-size

* BMP
* CUR
* GIF
* ICO
* JPEG

@@ -52,2 +54,16 @@ * PNG

### Multi-size
If the target file is an icon (.ico) or a cursor (.cur), the `width` and `height` will be the ones of the first found image.
An additional `images` array is available and returns the dimensions of all the available images
```javascript
var sizeOf = require('image-size');
var images = sizeOf('images/multi-size.ico').images;
for (const dimensions of images) {
console.log(dimensions.width, dimensions.height);
}
```
### Using a URL

@@ -54,0 +70,0 @@

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