Add failOnError option to fail-fast on bad input image data (#976)

This commit is contained in:
Matthew McEachen
2017-10-08 01:55:11 -07:00
committed by Lovell Fuller
parent 382d476271
commit b4d72bd544
10 changed files with 103 additions and 4 deletions

View File

@@ -249,7 +249,9 @@ class PipelineWorker : public Nan::AsyncWorker {
}
if (shrink_on_load > 1) {
// Reload input using shrink-on-load
vips::VOption *option = VImage::option()->set("shrink", shrink_on_load);
vips::VOption *option = VImage::option()
->set("shrink", shrink_on_load)
->set("fail", baton->input->failOnError);
if (baton->input->buffer != nullptr) {
VipsBlob *blob = vips_blob_new(nullptr, baton->input->buffer, baton->input->bufferLength);
if (inputImageType == ImageType::JPEG) {