diff --git a/README.md b/README.md index fb63e462..ba61e2fd 100755 --- a/README.md +++ b/README.md @@ -19,16 +19,11 @@ Performance is 4x-8x faster than ImageMagick and 2x-4x faster than GraphicsMagic * Node.js v0.8+ * node-gyp -* libvips-dev 7.28+ (7.36+ for optimal JPEG Huffman coding) +* [libvips](https://github.com/jcupitt/libvips) v7.37+ -``` -sudo npm install -g node-gyp -sudo apt-get install libvips-dev -``` +For the sharpest results, please compile libvips from source. -When installed as a package, please symlink `vips-7.28.pc` (or later, installed with libvips-dev) as `/usr/lib/pkgconfig/vips.pc`. To do this in Ubuntu 13.04 (64-bit), use: - - sudo ln -s /usr/lib/x86_64-linux-gnu/pkgconfig/vips-7.28.pc /usr/lib/pkgconfig/vips.pc +If you prefer to run a stable, package-managed environment such as Ubuntu 12.04 LTS, [v0.0.3](https://github.com/lovell/sharp/tree/v0.0.3) will work with the libvips-dev package. ## Install @@ -84,7 +79,6 @@ sharp.embedBlack("input.png", "output.png", 200, 300, function(err) { ## Testing - npm install --dev sharp npm test ## Performance diff --git a/package.json b/package.json index a145ffb9..b9955590 100755 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "sharp", - "version": "0.0.5", + "version": "0.0.6", "author": "Lovell Fuller", "description": "High performance module to resize JPEG and PNG images using the libvips image processing library", "scripts": { diff --git a/src/sharp.cc b/src/sharp.cc index 07f81aab..a78d2015 100755 --- a/src/sharp.cc +++ b/src/sharp.cc @@ -126,12 +126,12 @@ void ResizeAsync(uv_work_t *work) { img = t[3]; if (EndsWith(baton->dst, ".jpg") || EndsWith(baton->dst, ".jpeg")) { - if (vips_jpegsave(img, baton->dst.c_str(), "Q", 80, "profile", "none", "optimize_coding", TRUE, NULL)) { + if (vips_foreign_save(img, baton->dst.c_str(), "strip", TRUE, "Q", 80, "optimize_coding", TRUE, NULL)) { (baton->err).append(vips_error_buffer()); vips_error_clear(); } } else if (EndsWith(baton->dst, ".png")) { - if (vips_pngsave(img, baton->dst.c_str(), "compression", 6, "interlace", FALSE, NULL)) { + if (vips_foreign_save(img, baton->dst.c_str(), "strip", TRUE, "compression", 6, "interlace", FALSE, NULL)) { (baton->err).append(vips_error_buffer()); vips_error_clear(); } diff --git a/tests/perf.js b/tests/perf.js index f796476a..95e96b86 100755 --- a/tests/perf.js +++ b/tests/perf.js @@ -115,7 +115,8 @@ async.series({ }).run(); } }, function(err, results) { - results.forEach(function(format, fastest) { - assert(fastest === "sharp", "sharp was slower than " + fastest + " for " + format); + assert(!err, err); + Object.keys(results).forEach(function(format) { + assert(results[format] == "sharp", "sharp was slower than " + results[format] + " for " + format); }); });