mirror of
https://github.com/lovell/sharp.git
synced 2025-12-19 07:15:08 +01:00
Ensure op ordering is respected where possible #3319
Emit warnings when previous ops might be ignored Flip and flop now occur before rotate, if any
This commit is contained in:
@@ -791,4 +791,14 @@ describe('Resize dimensions', function () {
|
||||
sharp().resize(null, null, { position: 'unknown' });
|
||||
});
|
||||
});
|
||||
|
||||
it('Multiple resize emits warning', () => {
|
||||
let warningMessage = '';
|
||||
const s = sharp();
|
||||
s.on('warning', function (msg) { warningMessage = msg; });
|
||||
s.resize(1);
|
||||
assert.strictEqual(warningMessage, '');
|
||||
s.resize(2);
|
||||
assert.strictEqual(warningMessage, 'ignoring previous resize options');
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user