mirror of
https://github.com/lovell/sharp.git
synced 2025-07-09 18:40:16 +02:00
Affects interpolators with 4x4+ window size e.g. Bicubic, LBB, Nohalo Introduces blur before large affine to improve large PNG reductions
36 lines
1.1 KiB
JavaScript
Executable File
36 lines
1.1 KiB
JavaScript
Executable File
'use strict';
|
|
|
|
var assert = require('assert');
|
|
|
|
var sharp = require('../../index');
|
|
var fixtures = require('../fixtures');
|
|
|
|
describe('Sharpen', function() {
|
|
|
|
it('sharpen image is larger than non-sharpen', function(done) {
|
|
sharp(fixtures.inputJpg)
|
|
.resize(320, 240)
|
|
.sharpen(false)
|
|
.toBuffer(function(err, notSharpened, info) {
|
|
if (err) throw err;
|
|
assert.strictEqual(true, notSharpened.length > 0);
|
|
assert.strictEqual('jpeg', info.format);
|
|
assert.strictEqual(320, info.width);
|
|
assert.strictEqual(240, info.height);
|
|
sharp(fixtures.inputJpg)
|
|
.resize(320, 240)
|
|
.sharpen()
|
|
.toBuffer(function(err, sharpened, info) {
|
|
if (err) throw err;
|
|
assert.strictEqual(true, sharpened.length > 0);
|
|
assert.strictEqual(true, sharpened.length > notSharpened.length);
|
|
assert.strictEqual('jpeg', info.format);
|
|
assert.strictEqual(320, info.width);
|
|
assert.strictEqual(240, info.height);
|
|
done();
|
|
});
|
|
});
|
|
});
|
|
|
|
});
|