mirror of
https://github.com/lovell/sharp.git
synced 2025-12-19 07:15:08 +01:00
Add support for loading images through ImageMagick as a buffer
This commit is contained in:
@@ -537,6 +537,24 @@ describe('Input/output', function() {
|
||||
});
|
||||
}
|
||||
|
||||
if (semver.gte(sharp.libvipsVersion(), '8.0.0')) {
|
||||
it('Load GIF from Buffer [libvips ' + sharp.libvipsVersion() + '>=8.0.0]', function(done) {
|
||||
var inputGifBuffer = fs.readFileSync(fixtures.inputGif);
|
||||
sharp(inputGifBuffer)
|
||||
.resize(320, 240)
|
||||
.jpeg()
|
||||
.toBuffer(function(err, data, info) {
|
||||
if (err) throw err;
|
||||
assert.strictEqual(true, data.length > 0);
|
||||
assert.strictEqual(data.length, info.size);
|
||||
assert.strictEqual('jpeg', info.format);
|
||||
assert.strictEqual(320, info.width);
|
||||
assert.strictEqual(240, info.height);
|
||||
done();
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
if (semver.gte(sharp.libvipsVersion(), '7.42.0')) {
|
||||
describe('Ouput raw, uncompressed image data [libvips ' + sharp.libvipsVersion() + '>=7.42.0]', function() {
|
||||
it('1 channel greyscale image', function(done) {
|
||||
|
||||
Reference in New Issue
Block a user