Latest Threat Research:SANDWORM_MODE: Shai-Hulud-Style npm Worm Hijacks CI Workflows and Poisons AI Toolchains.Details
Socket
Book a DemoInstallSign in
Socket

colormatch

Package Overview
Dependencies
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

colormatch - npm Package Compare versions

Comparing version
0.0.2
to
0.0.3
+26
-9
extract.js

@@ -7,23 +7,39 @@ var spawn = require('child_process').spawn;

var convert = spawn('convert',[path,'-colors','16','-depth','8','-format', '%c', 'histogram:info:-']),
out = "",
err = "";
out = "",
err = "";
convert.stdout.on('data',function(data){
out += data.toString();
});
});
convert.stdout.on('data',function(data){
err += data.toString();
});
});
convert.on('exit',function(code){
err = code?(err?err:code):false;
// a big note. exit may be fired before or after close of stdout (0.8.20)
// to respond properly in any lib using spawn you really need to wait for both.
var exit,closed
, done = function(){
if(exit === undefined) process.exit(9);
err = exit?(err?err:exit):false;
var colors;
if(!err){
colors = parseImagickColors(out);
}
if(!colors.length){
console.log('no colors from parse:',out);
}
}
cb(exit?(err?err:exit):false,colors);
};
cb(code?(err?err:code):false,colors);
});
convert.on('exit',function(code){
exit = code;
if(closed) done();
});
convert.stdout.on('close',function(){
closed = true;
if(exit !== undefined) done();
});
convert.stdin.end();

@@ -33,2 +49,3 @@

//

@@ -35,0 +52,0 @@ //a valid color object response is []

{
"name": "colormatch"
, "description": "A module for extracting colors from images and for generating lookup ranges that accept rgb and outputs ranges of rgb values for db lookups. Right now it uses ImageMagik in a child process to reduce the colorspace and return the top colors of an image. Alterntives with node-canvas or an all js jpeg decoder could be used. The latterwith the same js color quantization algorthims that would be needed to reduce the colorspace of the former."
, "version": "0.0.2"
, "version": "0.0.3"
, "author": "Ryan Day <soldair@gmail.com>"

@@ -6,0 +6,0 @@ , "keywords": ["image", "indexing", "color", "search"]