mirror of
https://github.com/lovell/sharp.git
synced 2025-07-10 11:00:14 +02:00
Ensure correct channel info for raw, greyscale output #1425
This commit is contained in:
parent
1e9093d781
commit
6f9699f605
@ -10,6 +10,9 @@ Requires libvips v8.7.0.
|
|||||||
[#1422](https://github.com/lovell/sharp/pull/1422)
|
[#1422](https://github.com/lovell/sharp/pull/1422)
|
||||||
[@SethWen](https://github.com/SethWen)
|
[@SethWen](https://github.com/SethWen)
|
||||||
|
|
||||||
|
* Ensure `channel` metadata is correct for raw, greyscale output.
|
||||||
|
[#1425](https://github.com/lovell/sharp/issues/1425)
|
||||||
|
|
||||||
* Add support for the "mitchell" kernel for image reductions.
|
* Add support for the "mitchell" kernel for image reductions.
|
||||||
[#1438](https://github.com/lovell/sharp/pull/1438)
|
[#1438](https://github.com/lovell/sharp/pull/1438)
|
||||||
[@Daiz](https://github.com/Daiz)
|
[@Daiz](https://github.com/Daiz)
|
||||||
|
@ -771,6 +771,7 @@ class PipelineWorker : public Nan::AsyncWorker {
|
|||||||
if (baton->greyscale || image.interpretation() == VIPS_INTERPRETATION_B_W) {
|
if (baton->greyscale || image.interpretation() == VIPS_INTERPRETATION_B_W) {
|
||||||
// Extract first band for greyscale image
|
// Extract first band for greyscale image
|
||||||
image = image[0];
|
image = image[0];
|
||||||
|
baton->channels = 1;
|
||||||
}
|
}
|
||||||
if (image.format() != VIPS_FORMAT_UCHAR) {
|
if (image.format() != VIPS_FORMAT_UCHAR) {
|
||||||
// Cast pixels to uint8 (unsigned char)
|
// Cast pixels to uint8 (unsigned char)
|
||||||
|
@ -1388,6 +1388,7 @@ describe('Input/output', function () {
|
|||||||
assert.strictEqual('raw', info.format);
|
assert.strictEqual('raw', info.format);
|
||||||
assert.strictEqual(32, info.width);
|
assert.strictEqual(32, info.width);
|
||||||
assert.strictEqual(24, info.height);
|
assert.strictEqual(24, info.height);
|
||||||
|
assert.strictEqual(1, info.channels);
|
||||||
done();
|
done();
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
Loading…
x
Reference in New Issue
Block a user