Prevent crop when at or below target dimensions #1134

This commit is contained in:
Lovell Fuller
2018-02-23 10:31:11 +00:00
parent 8b80626035
commit 5ab6f599fb
3 changed files with 26 additions and 1 deletions

View File

@@ -465,7 +465,10 @@ class PipelineWorker : public Nan::AsyncWorker {
->set("extend", VIPS_EXTEND_BACKGROUND)
->set("background", background));
} else if (baton->canvas != Canvas::IGNORE_ASPECT) {
} else if (
baton->canvas != Canvas::IGNORE_ASPECT &&
(image.width() > baton->width || image.height() > baton->height)
) {
// Crop/max/min
if (baton->crop < 9) {
// Gravity-based crop