mirror of
https://github.com/lovell/sharp.git
synced 2025-07-09 10:30:15 +02:00
Add test for progressive JPEG output
This commit is contained in:
parent
bd96a49de6
commit
7ad7193b1e
@ -263,7 +263,34 @@ describe('Input/output', function() {
|
||||
done();
|
||||
});
|
||||
|
||||
it('Progressive image', function(done) {
|
||||
it('Progressive JPEG image', function(done) {
|
||||
sharp(fixtures.inputJpg)
|
||||
.resize(320, 240)
|
||||
.progressive(false)
|
||||
.toBuffer(function(err, nonProgressiveData, nonProgressiveInfo) {
|
||||
if (err) throw err;
|
||||
assert.strictEqual(true, nonProgressiveData.length > 0);
|
||||
assert.strictEqual(nonProgressiveData.length, nonProgressiveInfo.size);
|
||||
assert.strictEqual('jpeg', nonProgressiveInfo.format);
|
||||
assert.strictEqual(320, nonProgressiveInfo.width);
|
||||
assert.strictEqual(240, nonProgressiveInfo.height);
|
||||
sharp(fixtures.inputJpg)
|
||||
.resize(320, 240)
|
||||
.progressive()
|
||||
.toBuffer(function(err, progressiveData, progressiveInfo) {
|
||||
if (err) throw err;
|
||||
assert.strictEqual(true, progressiveData.length > 0);
|
||||
assert.strictEqual(progressiveData.length, progressiveInfo.size);
|
||||
assert.strictEqual(false, progressiveData.length === nonProgressiveData.length);
|
||||
assert.strictEqual('jpeg', progressiveInfo.format);
|
||||
assert.strictEqual(320, progressiveInfo.width);
|
||||
assert.strictEqual(240, progressiveInfo.height);
|
||||
done();
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
it('Progressive PNG image', function(done) {
|
||||
sharp(fixtures.inputJpg)
|
||||
.resize(320, 240)
|
||||
.png()
|
||||
|
Loading…
x
Reference in New Issue
Block a user