image-size
Advanced tools
Comparing version 0.6.2 to 0.6.3
@@ -21,2 +21,6 @@ #!/usr/bin/env node | ||
function colorize(text, color) { | ||
return color[0] + text + color[1] | ||
} | ||
files.forEach(function (image) { | ||
@@ -26,7 +30,13 @@ try { | ||
var size = imageSize(image); | ||
var greyX = colorize('x', grey); | ||
var greyImage = colorize(image, grey); | ||
(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]); | ||
var greyType = ''; | ||
if (size.type) { | ||
greyType = colorize(' (' + size.type + ')', grey); | ||
} | ||
console.info( | ||
colorize(size.width, green) + greyX + colorize(size.height, green) | ||
+ ' - ' + greyImage + greyType | ||
); | ||
}); | ||
@@ -38,4 +48,4 @@ } else { | ||
// console.error(e.stack); | ||
console.error(red[0] + e.message + red[1], '-', image); | ||
console.error(colorize(e.message, red), '-', image); | ||
} | ||
}); |
@@ -9,2 +9,3 @@ 'use strict'; | ||
gif: require('./types/gif'), | ||
icns: require('./types/icns'), | ||
ico: require('./types/ico'), | ||
@@ -11,0 +12,0 @@ jpg: require('./types/jpg'), |
@@ -51,2 +51,3 @@ 'use strict'; | ||
// Extract IFD tags from TIFF metadata | ||
/* eslint-disable complexity */ | ||
function extractTags (buffer, isBigEndian) { | ||
@@ -77,2 +78,3 @@ var tags = {}; | ||
} | ||
/* eslint-enable complexity */ | ||
@@ -79,0 +81,0 @@ // Test if the TIFF is Big Endian or Little Endian |
@@ -12,2 +12,3 @@ 'use strict'; | ||
/* eslint-disable complexity */ | ||
function calculate (buffer) { | ||
@@ -42,2 +43,3 @@ var chunkHeader = buffer.toString('ascii', 12, 16); | ||
} | ||
/* eslint-enable complexity */ | ||
@@ -44,0 +46,0 @@ function calculateExtended (buffer) { |
{ | ||
"name": "image-size", | ||
"version": "0.6.2", | ||
"version": "0.6.3", | ||
"description": "get dimensions of any image file", | ||
@@ -37,2 +37,3 @@ "main": "lib/index.js", | ||
"svg", | ||
"icns", | ||
"ico", | ||
@@ -44,10 +45,10 @@ "cur" | ||
"devDependencies": { | ||
"coveralls": "^3.0.0", | ||
"eslint": "^4.13.1", | ||
"coveralls": "^3.0.1", | ||
"eslint": "^4.19.1", | ||
"expect.js": "^0.3.1", | ||
"glob": "^7.1.1", | ||
"mocha": "^4.0.1", | ||
"nyc": "^11.2.1", | ||
"sinon": "^4.0.2" | ||
"mocha": "^5.2.0", | ||
"nyc": "^11.9.0", | ||
"sinon": "^5.1.1" | ||
} | ||
} |
@@ -16,2 +16,3 @@ # image-size | ||
* GIF | ||
* ICNS | ||
* ICO | ||
@@ -18,0 +19,0 @@ * JPEG |
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
27494
20
749
127
6