Socket
Socket
Sign inDemoInstall

image-size

Package Overview
Dependencies
0
Maintainers
1
Versions
65
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 0.0.3 to 0.0.5

lib/bmp.js

14

index.js
var fs = require('fs');
var path = require('path');
var detector = require('./lib/detector');
var handlers = {
'png': require('./lib/png'),
'gif': require('./lib/gif')
};
var libpath = process.env.TEST_COV ? './lib-cov/' : './lib/';
var detector = require(libpath + 'detector');
var handlers = {};
['png', 'gif', 'bmp'].forEach(function (type) {
handlers[type] = require(libpath + type);
});
module.exports = function (filepath) {

@@ -29,4 +31,4 @@

} else {
throw new Error('unsupported file type');
throw new TypeError('unsupported file type');
}
};

@@ -21,3 +21,3 @@ module.exports = function (buffer) {

if ('IHDR' !== buffer.toString('ascii', 12, 16)) {
throw new Error('invalid png');
throw new TypeError('invalid png');
}

@@ -24,0 +24,0 @@ return 'png';

{
"name": "image-size",
"version": "0.0.3",
"version": "0.0.5",
"description": "get dimensions of any image file",

@@ -10,3 +10,3 @@ "main": "index.js",

"scripts": {
"test": "node_modules/.bin/mocha --ui bdd --reporter spec specs/*.spec.js"
"test": "make"
},

@@ -27,4 +27,5 @@ "repository": {

"devDependencies": {
"mocha": "~1.12.0"
"mocha": "~1.12.0",
"expect.js": "~0.2.0"
}
}

@@ -23,6 +23,6 @@ #### Work in progress

* GIF
* BMP
##### Upcoming
* JPEG
* BMP
* WebP

@@ -29,0 +29,0 @@ * TIFF

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc