mirror of
https://github.com/lovell/sharp.git
synced 2025-07-09 10:30:15 +02:00
Blur and sharpen ops always convolve
Partial revert of 36ac882
This commit is contained in:
parent
36ac8828f2
commit
01435977de
@ -493,9 +493,10 @@ class PipelineWorker : public NanAsyncWorker {
|
|||||||
}
|
}
|
||||||
|
|
||||||
bool shouldAffineTransform = xresidual != 0.0 || yresidual != 0.0;
|
bool shouldAffineTransform = xresidual != 0.0 || yresidual != 0.0;
|
||||||
bool willConvolve = baton->blurSigma > 0.0 || baton->sharpenRadius > 0;
|
bool shouldBlur = baton->blurSigma != 0.0;
|
||||||
|
bool shouldSharpen = baton->sharpenRadius != 0;
|
||||||
bool hasOverlay = !baton->overlayPath.empty();
|
bool hasOverlay = !baton->overlayPath.empty();
|
||||||
bool shouldPremultiplyAlpha = HasAlpha(image) && (shouldAffineTransform || willConvolve || hasOverlay);
|
bool shouldPremultiplyAlpha = HasAlpha(image) && (shouldAffineTransform || shouldBlur || shouldSharpen || hasOverlay);
|
||||||
|
|
||||||
// Premultiply image alpha channel before all transformations to avoid
|
// Premultiply image alpha channel before all transformations to avoid
|
||||||
// dark fringing around bright pixels
|
// dark fringing around bright pixels
|
||||||
@ -679,7 +680,7 @@ class PipelineWorker : public NanAsyncWorker {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Blur
|
// Blur
|
||||||
if (baton->blurSigma != 0.0) {
|
if (shouldBlur) {
|
||||||
VipsImage *blurred;
|
VipsImage *blurred;
|
||||||
if (Blur(hook, image, &blurred, baton->blurSigma)) {
|
if (Blur(hook, image, &blurred, baton->blurSigma)) {
|
||||||
return Error();
|
return Error();
|
||||||
@ -688,7 +689,7 @@ class PipelineWorker : public NanAsyncWorker {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Sharpen
|
// Sharpen
|
||||||
if (baton->sharpenRadius != 0) {
|
if (shouldSharpen) {
|
||||||
VipsImage *sharpened;
|
VipsImage *sharpened;
|
||||||
if (Sharpen(hook, image, &sharpened, baton->sharpenRadius, baton->sharpenFlat, baton->sharpenJagged)) {
|
if (Sharpen(hook, image, &sharpened, baton->sharpenRadius, baton->sharpenFlat, baton->sharpenJagged)) {
|
||||||
return Error();
|
return Error();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user