Socket
Socket
Sign inDemoInstall

image-size

Package Overview
Dependencies
0
Maintainers
3
Versions
65
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 0.5.0 to 0.5.1

2

lib/types/tiff.js

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

// if (code === 256 || code === 257) {
if (length === 1 && type === 3) {
if (length === 1 && (type === 3 || type === 4)) {
tags[code] = readValue(buffer, isBigEndian);

@@ -69,0 +69,0 @@ }

@@ -13,6 +13,17 @@ 'use strict';

function calculate (buffer) {
var chunkHeader = buffer.toString('ascii', 12, 16);
buffer = buffer.slice(20, 30);
// Extended webp stream signature
if (chunkHeader === 'VP8X') {
var extendedHeader = buffer[0];
var validStart = (extendedHeader & 0xc0) === 0;
var validEnd = (extendedHeader & 0x01) === 0;
if (validStart && validEnd) {
return calculateExtended(buffer);
} else {
return false;
}
}
// Lossless webp stream signature

@@ -32,2 +43,9 @@ if (chunkHeader === 'VP8 ' && buffer[0] !== 0x2f) {

function calculateExtended (buffer) {
return {
'width': 1 + buffer.readUIntLE(4, 3),
'height': 1 + buffer.readUIntLE(7, 3)
}
}
function calculateLossless (buffer) {

@@ -34,0 +52,0 @@ return {

{
"name": "image-size",
"version": "0.5.0",
"version": "0.5.1",
"description": "get dimensions of any image file",

@@ -43,8 +43,8 @@ "main": "lib/index.js",

"expect.js": "^0.3.1",
"glob": "^6.0.1",
"glob": "^7.1.1",
"istanbul": "^0.4.0",
"jshint": "^2.8.0",
"mocha": "^2.3.4",
"mocha": "^3.2.0",
"sinon": "^1.17.2"
}
}
SocketSocket SOC 2 Logo

Product

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

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc