mirror of
https://github.com/lovell/sharp.git
synced 2025-12-19 07:15:08 +01:00
Add support for Buffer and Stream-based TIFF output
This commit is contained in:
@@ -837,6 +837,20 @@ describe('Input/output', function () {
|
||||
});
|
||||
});
|
||||
|
||||
it('Save TIFF to Buffer', function (done) {
|
||||
sharp(fixtures.inputTiff)
|
||||
.resize(320, 240)
|
||||
.toBuffer(function (err, data, info) {
|
||||
if (err) throw err;
|
||||
assert.strictEqual(true, data.length > 0);
|
||||
assert.strictEqual(data.length, info.size);
|
||||
assert.strictEqual('tiff', info.format);
|
||||
assert.strictEqual(320, info.width);
|
||||
assert.strictEqual(240, info.height);
|
||||
done();
|
||||
});
|
||||
});
|
||||
|
||||
it('Invalid WebP quality throws error', function () {
|
||||
assert.throws(function () {
|
||||
sharp().webp({ quality: 101 });
|
||||
@@ -914,7 +928,7 @@ describe('Input/output', function () {
|
||||
});
|
||||
});
|
||||
|
||||
it('TIFF deflate compression with hoizontal predictor shrinks test file', function (done) {
|
||||
it('TIFF deflate compression with horizontal predictor shrinks test file', function (done) {
|
||||
const startSize = fs.statSync(fixtures.inputTiffUncompressed).size;
|
||||
sharp(fixtures.inputTiffUncompressed)
|
||||
.tiff({
|
||||
|
||||
Reference in New Issue
Block a user