Improve consistency of validation error handling

Utilises common path of existing invalidParameterError
This commit is contained in:
Lovell Fuller
2019-07-26 14:58:49 +01:00
parent 28de243c11
commit 233b015d77
11 changed files with 110 additions and 135 deletions

View File

@@ -972,7 +972,7 @@ class PipelineWorker : public Nan::AsyncWorker {
->set("layout", baton->tileLayout)
->set("suffix", const_cast<char*>(suffix.data()))
->set("angle", CalculateAngleRotation(baton->tileAngle))
->set("skip-blanks", baton->skipBlanks);
->set("skip_blanks", baton->tileSkipBlanks);
// libvips chooses a default depth based on layout. Instead of replicating that logic here by
// not passing anything - libvips will handle choice
@@ -1380,7 +1380,7 @@ NAN_METHOD(pipeline) {
baton->tileOverlap = AttrTo<uint32_t>(options, "tileOverlap");
std::string tileContainer = AttrAsStr(options, "tileContainer");
baton->tileAngle = AttrTo<int32_t>(options, "tileAngle");
baton->skipBlanks = AttrTo<int32_t>(options, "skipBlanks");
baton->tileSkipBlanks = AttrTo<int32_t>(options, "tileSkipBlanks");
if (tileContainer == "zip") {
baton->tileContainer = VIPS_FOREIGN_DZ_CONTAINER_ZIP;
} else {