Guard use of smartcrop premultiplied option #3710

This commit is contained in:
Lovell Fuller 2023-07-09 09:57:20 +01:00
parent 2f67823c3d
commit 3434eef5b9
2 changed files with 5 additions and 0 deletions

View File

@ -16,6 +16,9 @@ Requires libvips v8.14.2
[#3674](https://github.com/lovell/sharp/pull/3674)
[@bianjunjie1981](https://github.com/bianjunjie1981)
* Guard use of smartcrop premultiplied option to prevent warning (regression in 0.32.1).
[#3710](https://github.com/lovell/sharp/issues/3710)
* Prevent over-compute in affine-based rotate before resize.
[#3722](https://github.com/lovell/sharp/issues/3722)

View File

@ -477,7 +477,9 @@ class PipelineWorker : public Napi::AsyncWorker {
image = image.smartcrop(baton->width, baton->height, VImage::option()
->set("interesting", baton->position == 16 ? VIPS_INTERESTING_ENTROPY : VIPS_INTERESTING_ATTENTION)
#if (VIPS_MAJOR_VERSION >= 8 && VIPS_MINOR_VERSION >= 15)
->set("premultiplied", shouldPremultiplyAlpha)
#endif
->set("attention_x", &attention_x)
->set("attention_y", &attention_y));
baton->hasCropOffset = true;