Skip to content

Embed URL

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
simple comparison of identify command vs binding
var imagick = require('imagick');
var imagemagick = require('imagemagick');
var path = require('path');
var assert = require('assert');
args = [
'-format',
'~~~%w~~~%h~~~%x~~~%C',
path.resolve('./logo.png'),
];
console.log('using:', args.join(' '));
function test(count, start, lib, args, end) {
if (count <= 0) {
end(start);
return;
}
lib.identify(args, function (error, metadata) {
assert.strictEqual(metadata.trim(), '~~~245~~~66~~~72 Undefined~~~Zip');
test(--count, start, lib, args, end);
});
};
var COUNT = 1000;
test(COUNT, Date.now(), imagick, args, function (start) {
console.log('imagick did', COUNT, 'in', (Date.now()-start)/1000, 'seconds');
test(COUNT, Date.now(), imagemagick, args, function (start) {
console.log('imagemagick did', COUNT, 'in', (Date.now()-start)/1000, 'seconds');
});
});
/* output
using: -format ~~~%w~~~%h~~~%x~~~%C /home/tjfontaine/development/test/logo.png
imagick did 1000 in 0.323 seconds
imagemagick did 1000 in 5.366 seconds
*/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.