From: anthony Date: Tue, 8 Jun 2010 13:46:27 +0000 (+0000) Subject: Sobel Kernel Rotation bugfix X-Git-Tag: 7.0.1-0~9246 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=3206678d008425bc56dd2dbad002f2bb26299dc2;p=imagemagick Sobel Kernel Rotation bugfix --- diff --git a/magick/morphology.c b/magick/morphology.c index 2304fd8af..ab66f3e99 100644 --- a/magick/morphology.c +++ b/magick/morphology.c @@ -1315,6 +1315,12 @@ MagickExport KernelInfo *AcquireKernelBuiltIn(const KernelInfoType type, ScaleKernelInfo(kernel, 0.25, NoValue); break; } + if ( fabs(args->sigma) > MagickEpsilon ) + /* Rotate by correctly supplied 'angle' */ + RotateKernelInfo(kernel, args->sigma); + else if ( args->rho > 30.0 || args->rho < -30.0 ) + /* Rotate by out of bounds 'type' */ + RotateKernelInfo(kernel, args->rho); break; } case RobertsKernel: @@ -3431,10 +3437,11 @@ MagickExport Image *MorphologyImageChannel(const Image *image, if ( artifact != (const char *) NULL) ShowKernelInfo(curr_kernel); - /* override the default handling of multi-kernel morphology results - * if 'Undefined' use the default method - * if 'None' (default for 'Convolve') re-iterate previous result - * otherwise merge resulting images using compose method given + /* Override the default handling of multi-kernel morphology results + * If 'Undefined' use the default method + * If 'None' (default for 'Convolve') re-iterate previous result + * Otherwise merge resulting images using compose method given. + * Default for 'HitAndMiss' is 'Lighten'. */ compose = UndefinedCompositeOp; /* use default for method */ artifact = GetImageArtifact(image,"morphology:compose");