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