mirror of
https://github.com/lovell/sharp.git
synced 2025-07-11 03:20:13 +02:00
Ensure affineInterpolator is correctly finalised (#3083)
This commit is contained in:
parent
4feee506cf
commit
115a6b10f6
@ -518,12 +518,14 @@ class PipelineWorker : public Napi::AsyncWorker {
|
||||
MultiPageUnsupported(nPages, "Affine");
|
||||
std::vector<double> background;
|
||||
std::tie(image, background) = sharp::ApplyAlpha(image, baton->affineBackground, shouldPremultiplyAlpha);
|
||||
vips::VInterpolate interp = vips::VInterpolate::new_from_name(
|
||||
const_cast<char*>(baton->affineInterpolator.data()));
|
||||
image = image.affine(baton->affineMatrix, VImage::option()->set("background", background)
|
||||
->set("idx", baton->affineIdx)
|
||||
->set("idy", baton->affineIdy)
|
||||
->set("odx", baton->affineOdx)
|
||||
->set("ody", baton->affineOdy)
|
||||
->set("interpolate", baton->affineInterpolator));
|
||||
->set("interpolate", interp));
|
||||
}
|
||||
|
||||
// Extend edges
|
||||
@ -1428,7 +1430,7 @@ Napi::Value pipeline(const Napi::CallbackInfo& info) {
|
||||
baton->affineIdy = sharp::AttrAsDouble(options, "affineIdy");
|
||||
baton->affineOdx = sharp::AttrAsDouble(options, "affineOdx");
|
||||
baton->affineOdy = sharp::AttrAsDouble(options, "affineOdy");
|
||||
baton->affineInterpolator = vips::VInterpolate::new_from_name(sharp::AttrAsStr(options, "affineInterpolator").data());
|
||||
baton->affineInterpolator = sharp::AttrAsStr(options, "affineInterpolator");
|
||||
baton->removeAlpha = sharp::AttrAsBool(options, "removeAlpha");
|
||||
baton->ensureAlpha = sharp::AttrAsDouble(options, "ensureAlpha");
|
||||
if (options.Has("boolean")) {
|
||||
|
@ -126,7 +126,7 @@ struct PipelineBaton {
|
||||
double affineIdy;
|
||||
double affineOdx;
|
||||
double affineOdy;
|
||||
vips::VInterpolate affineInterpolator;
|
||||
std::string affineInterpolator;
|
||||
int jpegQuality;
|
||||
bool jpegProgressive;
|
||||
std::string jpegChromaSubsampling;
|
||||
@ -268,7 +268,7 @@ struct PipelineBaton {
|
||||
affineIdy(0),
|
||||
affineOdx(0),
|
||||
affineOdy(0),
|
||||
affineInterpolator(vips::VInterpolate::new_from_name("bicubic")),
|
||||
affineInterpolator("bicubic"),
|
||||
jpegQuality(80),
|
||||
jpegProgressive(false),
|
||||
jpegChromaSubsampling("4:2:0"),
|
||||
|
Loading…
x
Reference in New Issue
Block a user