mirror of
https://github.com/lovell/sharp.git
synced 2025-12-19 07:15:08 +01:00
Ensure stats can be calculated for 1x1 input #2372
This commit is contained in:
@@ -462,6 +462,19 @@ describe('Image Stats', function () {
|
||||
})
|
||||
);
|
||||
|
||||
it('Entropy and sharpness of 1x1 input are zero', async () => {
|
||||
const { entropy, sharpness } = await sharp({
|
||||
create: {
|
||||
width: 1,
|
||||
height: 1,
|
||||
channels: 3,
|
||||
background: 'red'
|
||||
}
|
||||
}).stats();
|
||||
assert.strictEqual(entropy, 0);
|
||||
assert.strictEqual(sharpness, 0);
|
||||
});
|
||||
|
||||
it('Stream in, Callback out', function (done) {
|
||||
const readable = fs.createReadStream(fixtures.inputJpg);
|
||||
const pipeline = sharp().stats(function (err, stats) {
|
||||
|
||||
Reference in New Issue
Block a user