mirror of
https://github.com/lovell/sharp.git
synced 2025-12-19 07:15:08 +01:00
Ensure correct channel info for raw, greyscale output #1425
This commit is contained in:
@@ -771,6 +771,7 @@ class PipelineWorker : public Nan::AsyncWorker {
|
||||
if (baton->greyscale || image.interpretation() == VIPS_INTERPRETATION_B_W) {
|
||||
// Extract first band for greyscale image
|
||||
image = image[0];
|
||||
baton->channels = 1;
|
||||
}
|
||||
if (image.format() != VIPS_FORMAT_UCHAR) {
|
||||
// Cast pixels to uint8 (unsigned char)
|
||||
|
||||
Reference in New Issue
Block a user