mirror of
https://github.com/lovell/sharp.git
synced 2025-12-19 07:15:08 +01:00
Allow use of failOnError with Stream-based input #1691
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
'use strict';
|
||||
|
||||
const assert = require('assert');
|
||||
const fs = require('fs');
|
||||
|
||||
const sharp = require('../../');
|
||||
const fixtures = require('../fixtures');
|
||||
@@ -72,4 +73,10 @@ describe('failOnError', function () {
|
||||
done(err.message.includes('VipsJpeg: Premature end of JPEG file') ? undefined : err);
|
||||
});
|
||||
});
|
||||
|
||||
it('handles stream-based input', function () {
|
||||
const writable = sharp({ failOnError: false });
|
||||
fs.createReadStream(fixtures.inputJpgTruncated).pipe(writable);
|
||||
return writable.toBuffer();
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user