mirror of
https://github.com/esimov/caire.git
synced 2024-05-31 14:55:55 +08:00
fix: verify blur radius to not be less then 1
This commit is contained in:
parent
ed8994c22a
commit
1627bd9ab9
@ -69,6 +69,9 @@ func (c *Carver) StackBlur(img *image.NRGBA, radius uint32) *image.NRGBA {
|
|||||||
if int(radius) >= len(mulTable) {
|
if int(radius) >= len(mulTable) {
|
||||||
radius = uint32(len(mulTable) - 1)
|
radius = uint32(len(mulTable) - 1)
|
||||||
}
|
}
|
||||||
|
if radius < 1 {
|
||||||
|
radius = 1
|
||||||
|
}
|
||||||
|
|
||||||
div = radius + radius + 1
|
div = radius + radius + 1
|
||||||
widthMinus1 = width - 1
|
widthMinus1 = width - 1
|
||||||
|
Loading…
Reference in New Issue
Block a user