Expose libvips' op-cache max items #76

This commit is contained in:
Lovell Fuller
2014-08-19 20:30:21 +01:00
parent e45956db6c
commit 8ef0851a49
4 changed files with 88 additions and 18 deletions

View File

@@ -18,6 +18,10 @@ var outputTiff = path.join(fixturesPath, "output.tiff");
var inputJpgWithExif = path.join(fixturesPath, "Landscape_8.jpg"); // https://github.com/recurser/exif-orientation-examples/blob/master/Landscape_8.jpg
// Ensure cache limits can be set
sharp.cache(0); // Disable
sharp.cache(50, 500); // 50MB, 500 items
async.series([
// Resize with exact crop
function(done) {
@@ -339,5 +343,12 @@ async.series([
});
var pipeline = sharp().resize(320, 240);
readable.pipe(pipeline).pipe(writable)
},
// Verify internal counters
function(done) {
var counters = sharp.counters();
assert.strictEqual(0, counters.queue);
assert.strictEqual(0, counters.process);
done();
}
]);