Ensure correct channel info for raw, greyscale output #1425

This commit is contained in:
Lovell Fuller
2018-11-19 20:00:30 +00:00
parent 1e9093d781
commit 6f9699f605
3 changed files with 5 additions and 0 deletions

View File

@@ -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)