image-size
Advanced tools
Comparing version 0.9.1 to 0.9.2
@@ -54,2 +54,3 @@ "use strict"; | ||
if (size <= 0) { | ||
yield handle.close(); | ||
throw new Error('Empty file'); | ||
@@ -73,3 +74,7 @@ } | ||
const descriptor = fs.openSync(filepath, 'r'); | ||
const size = fs.fstatSync(descriptor).size; | ||
const { size } = fs.fstatSync(descriptor); | ||
if (size <= 0) { | ||
fs.closeSync(descriptor); | ||
throw new Error('Empty file'); | ||
} | ||
const bufferSize = Math.min(size, MaxBufferSize); | ||
@@ -76,0 +81,0 @@ const buffer = Buffer.alloc(bufferSize); |
{ | ||
"name": "image-size", | ||
"version": "0.9.1", | ||
"version": "0.9.2", | ||
"description": "get dimensions of any image file", | ||
@@ -20,3 +20,2 @@ "main": "dist/index.js", | ||
"test": "nyc mocha", | ||
"coverage": "nyc report --reporter=text-lcov | coveralls", | ||
"clean": "rm -rf dist docs", | ||
@@ -50,19 +49,18 @@ "generate-docs": "typedoc", | ||
"devDependencies": { | ||
"@types/chai": "4.2.12", | ||
"@types/chai": "4.2.14", | ||
"@types/glob": "7.1.3", | ||
"@types/mocha": "8.0.3", | ||
"@types/node": "14.6.3", | ||
"@types/sinon": "9.0.5", | ||
"@typescript-eslint/eslint-plugin": "4.0.1", | ||
"@typescript-eslint/parser": "4.0.1", | ||
"@types/node": "14.11.10", | ||
"@types/sinon": "9.0.8", | ||
"@typescript-eslint/eslint-plugin": "4.4.1", | ||
"@typescript-eslint/parser": "4.4.1", | ||
"chai": "4.2.0", | ||
"coveralls": "3.1.0", | ||
"eslint": "7.8.1", | ||
"eslint": "7.11.0", | ||
"glob": "7.1.6", | ||
"mocha": "8.1.3", | ||
"mocha": "8.2.0", | ||
"nyc": "15.1.0", | ||
"sinon": "9.0.3", | ||
"sinon": "9.2.0", | ||
"ts-node": "9.0.0", | ||
"typedoc": "0.19.0", | ||
"typescript": "4.0.2" | ||
"typedoc": "0.19.2", | ||
"typescript": "4.0.3" | ||
}, | ||
@@ -69,0 +67,0 @@ "dependencies": { |
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
42939
16
1105