Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

probe-image-size

Package Overview
Dependencies
Maintainers
1
Versions
32
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

probe-image-size - npm Package Compare versions

Comparing version 7.1.0 to 7.1.1

6

CHANGELOG.md

@@ -9,2 +9,7 @@ # Changelog

## [7.1.1] - 2021-05-27
### Fixed
- Allow byte order mark at the start of SVG, #57.
## [7.1.0] - 2021-04-15

@@ -195,2 +200,3 @@ ### Fixed

[7.1.1]: https://github.com/nodeca/probe-image-size/compare/7.1.0...7.1.1
[7.1.0]: https://github.com/nodeca/probe-image-size/compare/7.0.1...7.1.0

@@ -197,0 +203,0 @@ [7.0.1]: https://github.com/nodeca/probe-image-size/compare/7.0.0...7.0.1

@@ -128,2 +128,3 @@ 'use strict';

var str = '';
var buf = null; // used to manage first chunk in IDENTIFY

@@ -134,5 +135,23 @@ var parser = new Transform({

switch (state) {
// identify step is needed to fail fast if the file isn't SVG
case STATE_IDENTIFY:
if (buf) {
// make sure that first chunk is at least 4 bytes (to do BOM skip later),
// last chunk was small
chunk = Buffer.concat([ buf, chunk ]);
buf = null;
}
if (data_len === 0 && chunk.length < 4) {
// make sure that first chunk is at least 4 bytes (to do BOM skip later),
// current chunk is small
buf = chunk;
break;
}
var i = 0, max = chunk.length;
// byte order mark, https://github.com/nodeca/probe-image-size/issues/57
if (data_len === 0 && chunk[0] === 0xEF && chunk[1] === 0xBB && chunk[2] === 0xBF) i = 3;
while (i < max && isWhiteSpace(chunk[i])) i++;

@@ -139,0 +158,0 @@

3

lib/parse_sync/svg.js

@@ -17,2 +17,5 @@ 'use strict';

// byte order mark, https://github.com/nodeca/probe-image-size/issues/57
if (buf[0] === 0xEF && buf[1] === 0xBB && buf[2] === 0xBF) i = 3;
while (i < max && isWhiteSpace(buf[i])) i++;

@@ -19,0 +22,0 @@

2

package.json
{
"name": "probe-image-size",
"version": "7.1.0",
"version": "7.1.1",
"description": "Get image size without full download (JPG, GIF, PNG, WebP, BMP, TIFF, PSD)",

@@ -5,0 +5,0 @@ "keywords": [

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