mirror of
https://github.com/lovell/sharp.git
synced 2025-07-09 10:30:15 +02:00
Ensure composite tile images fully decoded #3767
This commit is contained in:
parent
7f64d464de
commit
4340d60ccf
@ -6,6 +6,9 @@ Requires libvips v8.14.4
|
||||
|
||||
### v0.32.6 - TBD
|
||||
|
||||
* Ensure composite tile images are fully decoded (regression in 0.32.0).
|
||||
[#3767](https://github.com/lovell/sharp/issues/3767)
|
||||
|
||||
* Ensure `withMetadata` does not add default sRGB profile to RGB16 (regression in 0.32.5).
|
||||
[#3773](https://github.com/lovell/sharp/issues/3773)
|
||||
|
||||
|
@ -653,7 +653,7 @@ class PipelineWorker : public Napi::AsyncWorker {
|
||||
if (across != 0 || down != 0) {
|
||||
int left;
|
||||
int top;
|
||||
compositeImage = compositeImage.replicate(across, down);
|
||||
compositeImage = compositeImage.copy_memory().replicate(across, down);
|
||||
if (composite->hasOffset) {
|
||||
std::tie(left, top) = sharp::CalculateCrop(
|
||||
compositeImage.width(), compositeImage.height(), image.width(), image.height(),
|
||||
|
@ -472,4 +472,28 @@ describe('composite', () => {
|
||||
assert.strictEqual(b, 19);
|
||||
assert.strictEqual(a, 128);
|
||||
});
|
||||
|
||||
it('Ensure tiled overlay is fully decoded', async () => {
|
||||
const tile = await sharp({
|
||||
create: {
|
||||
width: 8, height: 513, channels: 3, background: 'red'
|
||||
}
|
||||
})
|
||||
.png({ compressionLevel: 0 })
|
||||
.toBuffer();
|
||||
|
||||
const { info } = await sharp({
|
||||
create: {
|
||||
width: 8, height: 514, channels: 3, background: 'green'
|
||||
}
|
||||
})
|
||||
.composite([{
|
||||
input: tile,
|
||||
tile: true
|
||||
}])
|
||||
.toBuffer({ resolveWithObject: true });
|
||||
|
||||
assert.strictEqual(info.width, 8);
|
||||
assert.strictEqual(info.height, 514);
|
||||
});
|
||||
});
|
||||
|
Loading…
x
Reference in New Issue
Block a user