Prevent error when cumulative rounding below target #1154

This commit is contained in:
Lovell Fuller
2018-03-13 19:42:10 +00:00
parent 8f690236ed
commit f60f7dab12
3 changed files with 32 additions and 1 deletions

View File

@@ -482,6 +482,12 @@ class PipelineWorker : public Nan::AsyncWorker {
image = image.extract_area(left, top, width, height);
} else {
// Attention-based or Entropy-based crop
if (baton->width > image.width()) {
baton->width = image.width();
}
if (baton->height > image.height()) {
baton->height = image.height();
}
image = image.tilecache(VImage::option()
->set("access", baton->accessMethod)
->set("threaded", TRUE));