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

impro

Package Overview
Dependencies
Maintainers
2
Versions
25
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

impro - npm Package Compare versions

Comparing version 0.14.1 to 0.14.2

4

CHANGELOG.md

@@ -0,1 +1,5 @@

### v0.14.2 (2023-12-18)
- [Account for gifsicle outputting warnings on stderr.](https://github.com/papandreou/impro/commit/e8339609941e03d543b0f1af2d207a058438d140) ([Alex J Burke](mailto:alex@alexjeffburke.com))
### v0.14.1 (2023-12-17)

@@ -2,0 +6,0 @@

2

package.json
{
"name": "impro",
"version": "0.14.1",
"version": "0.14.2",
"description": "Image processing engine",

@@ -5,0 +5,0 @@ "author": "Andreas Lind <andreaslindpetersen@gmail.com>",

@@ -79,3 +79,7 @@ const errors = require('../errors');

if (args.length > 0) {
pipeline._attach(new StdinoutStream('gifsicle', binPath, args));
pipeline._attach(
new StdinoutStream('gifsicle', binPath, args, {
filterStderr: (line) => !line.startsWith('gifsicle: warning:'),
})
);
seenOperationThatMustComeBeforeExtract = false;

@@ -82,0 +86,0 @@ if (allGifsicleArgs.length > 0) allGifsicleArgs.push(';');

@@ -6,4 +6,8 @@ const childProcess = require('child_process');

function noopFilterStderr() {
return true;
}
module.exports = class StdinoutStream extends Stream.Transform {
constructor(name, binary, args) {
constructor(name, binary, args, options) {
super();

@@ -14,2 +18,3 @@

this.errorline = null;
this.filterStderr = null;
this.logger = null;

@@ -22,2 +27,9 @@ this.process = null;

this.logger = debug(name);
options = options || {};
if (typeof options.filterStderr === 'function') {
this.filterStderr = options.filterStderr;
} else {
this.filterStderr = noopFilterStderr;
}
}

@@ -87,10 +99,24 @@

const decodeStderr = (line) => {
let errorMessage;
try {
errorMessage = line.toString();
} catch (e) {
return 'undecodeable output on stderr';
}
if (!errorMessage) {
// empty line output on stderr => ignore
return null;
} else if (!this.filterStderr(errorMessage)) {
// filter indicated a non-error => ignore
return null;
}
return errorMessage;
};
this.process.stderr.on('data', (line) => {
if (this.errorline === null) {
if (this.errorline !== null) {
// ignore
} else if ((this.errorline = decodeStderr(line)) !== null) {
this.hasErrored = true;
try {
this.errorline = line.toString();
} catch (e) {
this.errorline = 'undecodeable error';
}
}

@@ -97,0 +123,0 @@ });

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