Browse Source

positive sigma check fix

disintegration 11 years ago
parent
commit
8609b6721a
2 changed files with 4 additions and 4 deletions
  1. 2 2
      blur.go
  2. 2 2
      sharpen.go

+ 2 - 2
blur.go

@@ -1,7 +1,6 @@
 package imaging
 
 import (
-	"errors"
 	"image"
 	"math"
 )
@@ -26,7 +25,8 @@ func absint(i int) int {
 //
 func Blur(img image.Image, sigma float64) *image.NRGBA {
 	if sigma <= 0 {
-		errors.New("sigma parameter must be positive")
+		// sigma parameter must be positive!
+		return Clone(img)
 	}
 
 	src := toNRGBA(img)

+ 2 - 2
sharpen.go

@@ -1,7 +1,6 @@
 package imaging
 
 import (
-	"errors"
 	"image"
 )
 
@@ -14,7 +13,8 @@ import (
 //
 func Sharpen(img image.Image, sigma float64) *image.NRGBA {
 	if sigma <= 0 {
-		errors.New("sigma parameter must be positive")
+		// sigma parameter must be positive!
+		return Clone(img)
 	}
 
 	src := toNRGBA(img)