🤖 Merge PR #46149 [sharp] Allow boolean to be passed to blur by @jeremistadler

* Allow boolean to be passed to blur

https://github.com/lovell/sharp/blob/master/lib/operation.js#L163

* [sharp] Add blur boolean tests
This commit is contained in:
Jeremi Stadler 2020-07-22 00:07:11 +02:00 committed by GitHub
parent 470eb9348f
commit 7615d5e704
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 1 deletions

View File

@ -312,11 +312,12 @@ declare namespace sharp {
* Blur the image.
* When used without parameters, performs a fast, mild blur of the output image.
* When a sigma is provided, performs a slower, more accurate Gaussian blur.
* When a boolean sigma is provided, ether blur mild or disable blur
* @param sigma a value between 0.3 and 1000 representing the sigma of the Gaussian mask, where sigma = 1 + radius / 2.
* @throws {Error} Invalid parameters
* @returns A sharp instance that can be used to chain operations
*/
blur(sigma?: number): Sharp;
blur(sigma?: number | boolean): Sharp;
/**
* Merge alpha transparency channel, if any, with background.

View File

@ -48,6 +48,8 @@ sharp('input.jpg')
sharp('input.jpg')
.resize({width: 300})
.blur(false)
.blur(true)
.toFile('output.jpg');
sharp({