mirror of
https://github.com/lovell/sharp.git
synced 2025-12-19 07:15:08 +01:00
Prevent error when cumulative rounding below target #1154
This commit is contained in:
@@ -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));
|
||||
|
||||
Reference in New Issue
Block a user