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