]> granicus.if.org Git - imagemagick/commitdiff
(no commit message)
authorcristy <urban-warrior@git.imagemagick.org>
Fri, 31 Oct 2014 00:40:34 +0000 (00:40 +0000)
committercristy <urban-warrior@git.imagemagick.org>
Fri, 31 Oct 2014 00:40:34 +0000 (00:40 +0000)
Magick++/lib/Image.cpp
MagickCore/effect.c
MagickCore/feature.c
MagickCore/morphology.c
MagickCore/morphology.h
MagickWand/convert.c
MagickWand/mogrify.c
MagickWand/operation.c
PerlMagick/Magick.xs
PerlMagick/quantum/quantum.xs.in

index 915ad406d8d5c6bc19eff517a67c46c12748fbc7..0a10a094ef8d3fe1034a1af2740a84f1f056eb10 100644 (file)
@@ -2351,7 +2351,7 @@ void Magick::Image::colorMatrix(const size_t order_,
     *kernel_info;
 
   GetPPException;
-  kernel_info=AcquireKernelInfo((const char *) NULL);
+  kernel_info=AcquireKernelInfo((const char *) NULL,exceptionInfo);
   if (kernel_info != (KernelInfo *) NULL)
     {
       kernel_info->width=order_;
@@ -2534,7 +2534,7 @@ void Magick::Image::convolve(const size_t order_,const double *kernel_)
     *kernel_info;
 
   GetPPException;
-  kernel_info=AcquireKernelInfo((const char *) NULL);
+  kernel_info=AcquireKernelInfo((const char *) NULL,exceptionInfo);
   kernel_info->width=order_;
   kernel_info->height=order_;
   kernel_info->values=(MagickRealType *) AcquireAlignedMemory(order_,
@@ -3455,11 +3455,10 @@ void Magick::Image::morphology(const MorphologyMethod method_,
   MagickCore::Image
     *newImage;
 
-  kernel=AcquireKernelInfo(kernel_.c_str());
-  if (kernel == (KernelInfo *)NULL)
-    throwExceptionExplicit(OptionError,"Unable to parse kernel.");
-
   GetPPException;
+  kernel=AcquireKernelInfo(kernel_.c_str(),exceptionInfo);
+  if (kernel == (KernelInfo *) NULL)
+    throwExceptionExplicit(OptionError,"Unable to parse kernel.");
   newImage=MorphologyImage(constImage(),method_,iterations_,kernel,
     exceptionInfo);
   replaceImage(newImage);
@@ -3498,11 +3497,11 @@ void Magick::Image::morphologyChannel(const ChannelType channel_,
   MagickCore::Image
     *newImage;
 
-  kernel=AcquireKernelInfo(kernel_.c_str());
-  if (kernel == (KernelInfo *)NULL)
-    throwExceptionExplicit(OptionError,"Unable to parse kernel.");
 
   GetPPException;
+  kernel=AcquireKernelInfo(kernel_.c_str(),exceptionInfo);
+  if (kernel == (KernelInfo *)NULL)
+    throwExceptionExplicit(OptionError,"Unable to parse kernel.");
   SetPPChannelMask(channel_);
   newImage=MorphologyImage(constImage(),method_,iterations_,kernel,
     exceptionInfo);
index 7207caf889713fc1747f5c80ea5d5346a6c6d725..306132258a121dc3d9a95aaedde987ff8e7569dc 100644 (file)
@@ -791,7 +791,7 @@ MagickExport Image *BlurImage(const Image *image,const double radius,
   assert(exception->signature == MagickSignature);
   (void) FormatLocaleString(geometry,MaxTextExtent,
     "blur:%.20gx%.20g;blur:%.20gx%.20g+90",radius,sigma,radius,sigma);
-  kernel_info=AcquireKernelInfo(geometry);
+  kernel_info=AcquireKernelInfo(geometry,exception);
   if (kernel_info == (KernelInfo *) NULL)
     ThrowImageException(ResourceLimitError,"MemoryAllocationFailed");
   blur_image=MorphologyApply(image,ConvolveMorphology,1,kernel_info,
@@ -1192,7 +1192,7 @@ MagickExport Image *EdgeImage(const Image *image,const double radius,
   assert(exception != (ExceptionInfo *) NULL);
   assert(exception->signature == MagickSignature);
   width=GetOptimalKernelWidth1D(radius,0.5);
-  kernel_info=AcquireKernelInfo((const char *) NULL);
+  kernel_info=AcquireKernelInfo((const char *) NULL,exception);
   if (kernel_info == (KernelInfo *) NULL)
     ThrowImageException(ResourceLimitError,"MemoryAllocationFailed");
   (void) ResetMagickMemory(kernel_info,0,sizeof(*kernel_info));
@@ -1283,7 +1283,7 @@ MagickExport Image *EmbossImage(const Image *image,const double radius,
   assert(exception != (ExceptionInfo *) NULL);
   assert(exception->signature == MagickSignature);
   width=GetOptimalKernelWidth1D(radius,sigma);
-  kernel_info=AcquireKernelInfo((const char *) NULL);
+  kernel_info=AcquireKernelInfo((const char *) NULL,exception);
   if (kernel_info == (KernelInfo *) NULL)
     ThrowImageException(ResourceLimitError,"MemoryAllocationFailed");
   kernel_info->width=width;
@@ -1381,7 +1381,7 @@ MagickExport Image *GaussianBlurImage(const Image *image,const double radius,
   assert(exception->signature == MagickSignature);
   (void) FormatLocaleString(geometry,MaxTextExtent,"gaussian:%.20gx%.20g",
     radius,sigma);
-  kernel_info=AcquireKernelInfo(geometry);
+  kernel_info=AcquireKernelInfo(geometry,exception);
   if (kernel_info == (KernelInfo *) NULL)
     ThrowImageException(ResourceLimitError,"MemoryAllocationFailed");
   blur_image=MorphologyApply(image,ConvolveMorphology,1,kernel_info,
@@ -3346,7 +3346,7 @@ MagickExport Image *SharpenImage(const Image *image,const double radius,
   assert(exception != (ExceptionInfo *) NULL);
   assert(exception->signature == MagickSignature);
   width=GetOptimalKernelWidth2D(radius,sigma);
-  kernel_info=AcquireKernelInfo((const char *) NULL);
+  kernel_info=AcquireKernelInfo((const char *) NULL,exception);
   if (kernel_info == (KernelInfo *) NULL)
     ThrowImageException(ResourceLimitError,"MemoryAllocationFailed");
   (void) ResetMagickMemory(kernel_info,0,sizeof(*kernel_info));
index 4002a575774f580c2a1bbe46af32a211b72be91e..7dc3faa086f9c7fbd28ec78d7f47e68c7c80cfe9 100644 (file)
@@ -283,7 +283,7 @@ MagickExport Image *CannyEdgeImage(const Image *image,const double radius,
   */
   (void) FormatLocaleString(geometry,MaxTextExtent,
     "blur:%.20gx%.20g;blur:%.20gx%.20g+90",radius,sigma,radius,sigma);
-  kernel_info=AcquireKernelInfo(geometry);
+  kernel_info=AcquireKernelInfo(geometry,exception);
   if (kernel_info == (KernelInfo *) NULL)
     ThrowImageException(ResourceLimitError,"MemoryAllocationFailed");
   edge_image=MorphologyApply(image,ConvolveMorphology,1,kernel_info,
index 7fcf3e6daac59c91234b794083e1e03d4f58de98..5ca16823e01cdbd8d2ecb1c0d21dd8f462e9c8fa 100644 (file)
@@ -378,7 +378,8 @@ static KernelInfo *ParseKernelArray(const char *kernel_string)
   return(kernel);
 }
 
-static KernelInfo *ParseKernelName(const char *kernel_string)
+static KernelInfo *ParseKernelName(const char *kernel_string,
+  ExceptionInfo *exception)
 {
   char
     token[MaxTextExtent];
@@ -473,7 +474,7 @@ static KernelInfo *ParseKernelName(const char *kernel_string)
       break;
   }
 
-  kernel = AcquireKernelBuiltIn((KernelInfoType)type, &args);
+  kernel = AcquireKernelBuiltIn((KernelInfoType)type, &args, exception);
   if ( kernel == (KernelInfo *) NULL )
     return(kernel);
 
@@ -490,13 +491,15 @@ static KernelInfo *ParseKernelName(const char *kernel_string)
   return(kernel);
 }
 
-MagickExport KernelInfo *AcquireKernelInfo(const char *kernel_string)
+MagickExport KernelInfo *AcquireKernelInfo(const char *kernel_string,
+  ExceptionInfo *exception)
 {
   KernelInfo
     *kernel,
     *new_kernel;
 
   char
+    *kernel_cache,
     token[MaxTextExtent];
 
   const char
@@ -505,8 +508,15 @@ MagickExport KernelInfo *AcquireKernelInfo(const char *kernel_string)
   if (kernel_string == (const char *) NULL)
     return(ParseKernelArray(kernel_string));
   p=kernel_string;
+  kernel_cache=(char *) NULL;
+  if (*kernel_string == '@')
+    {
+      kernel_cache=FileToString(kernel_string+1,~0UL,exception);
+      if (kernel_cache == (char *) NULL)
+        return((KernelInfo *) NULL);
+      p=(const char *) kernel_cache;
+    }    
   kernel=NULL;
-
   while (GetMagickToken(p,NULL,token), *token != '\0')
   {
     /* ignore extra or multiple ';' kernel separators */
@@ -514,7 +524,7 @@ MagickExport KernelInfo *AcquireKernelInfo(const char *kernel_string)
       {
         /* tokens starting with alpha is a Named kernel */
         if (isalpha((int) ((unsigned char) *token)) != 0)
-          new_kernel=ParseKernelName(p);
+          new_kernel=ParseKernelName(p,exception);
         else /* otherwise a user defined kernel array */
           new_kernel=ParseKernelArray(p);
 
@@ -539,9 +549,10 @@ MagickExport KernelInfo *AcquireKernelInfo(const char *kernel_string)
       break;
     p++;
   }
+  if (kernel_cache != (char *) NULL)
+    kernel_cache=DestroyString(kernel_cache);
   return(kernel);
 }
-
 \f
 /*
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
@@ -946,7 +957,7 @@ MagickExport KernelInfo *AcquireKernelInfo(const char *kernel_string)
 */
 
 MagickExport KernelInfo *AcquireKernelBuiltIn(const KernelInfoType type,
-   const GeometryInfo *args)
+  const GeometryInfo *args,ExceptionInfo *exception)
 {
   KernelInfo
     *kernel;
@@ -1436,10 +1447,12 @@ MagickExport KernelInfo *AcquireKernelBuiltIn(const KernelInfoType type,
             ScaleKernelInfo(kernel, (double) (1.0/2.0*MagickSQ2), NoValue);
             break;
           case 10:
-            kernel=AcquireKernelInfo("FreiChen:11;FreiChen:12;FreiChen:13;FreiChen:14;FreiChen:15;FreiChen:16;FreiChen:17;FreiChen:18;FreiChen:19");
+          {
+            kernel=AcquireKernelInfo("FreiChen:11;FreiChen:12;FreiChen:13;FreiChen:14;FreiChen:15;FreiChen:16;FreiChen:17;FreiChen:18;FreiChen:19",exception);
             if (kernel == (KernelInfo *) NULL)
               return(kernel);
             break;
+          }
           case 1:
           case 11:
             kernel=ParseKernelArray("3: 1,0,-1  2,0,-2  1,0,-1");
@@ -1742,7 +1755,7 @@ MagickExport KernelInfo *AcquireKernelBuiltIn(const KernelInfoType type,
         }
       case EdgesKernel:
         {
-          kernel=AcquireKernelInfo("ThinSE:482");
+          kernel=AcquireKernelInfo("ThinSE:482",exception);
           if (kernel == (KernelInfo *) NULL)
             return(kernel);
           kernel->type = type;
@@ -1751,7 +1764,7 @@ MagickExport KernelInfo *AcquireKernelBuiltIn(const KernelInfoType type,
         }
       case CornersKernel:
         {
-          kernel=AcquireKernelInfo("ThinSE:87");
+          kernel=AcquireKernelInfo("ThinSE:87",exception);
           if (kernel == (KernelInfo *) NULL)
             return(kernel);
           kernel->type = type;
@@ -1796,7 +1809,7 @@ MagickExport KernelInfo *AcquireKernelBuiltIn(const KernelInfoType type,
             case 0:
             default:
               /* set of kernels to find all end of lines */
-              return(AcquireKernelInfo("LineEnds:1>;LineEnds:2>"));
+              return(AcquireKernelInfo("LineEnds:1>;LineEnds:2>",exception));
             case 1:
               /* kernel for 4-connected line ends - no rotation */
               kernel=ParseKernelArray("3: 0,0,-  0,1,1  0,0,-");
@@ -1826,7 +1839,7 @@ MagickExport KernelInfo *AcquireKernelBuiltIn(const KernelInfoType type,
             case 0:
             default:
               /* set of kernels to find all line junctions */
-              return(AcquireKernelInfo("LineJunctions:1@;LineJunctions:2>"));
+              return(AcquireKernelInfo("LineJunctions:1@;LineJunctions:2>",exception));
             case 1:
               /* Y Junction */
               kernel=ParseKernelArray("3: 1,-,1  -,1,-  -,1,-");
@@ -1948,7 +1961,7 @@ MagickExport KernelInfo *AcquireKernelBuiltIn(const KernelInfoType type,
               /* Traditional Skeleton...
               ** A cyclically rotated single kernel
               */
-              kernel=AcquireKernelInfo("ThinSE:482");
+              kernel=AcquireKernelInfo("ThinSE:482",exception);
               if (kernel == (KernelInfo *) NULL)
                 return(kernel);
               kernel->type = type;
@@ -1959,7 +1972,7 @@ MagickExport KernelInfo *AcquireKernelBuiltIn(const KernelInfoType type,
               ** Corners of the traditional method made more forgiving,
               ** but the retain the same cyclic order.
               */
-              kernel=AcquireKernelInfo("ThinSE:482; ThinSE:87x90;");
+              kernel=AcquireKernelInfo("ThinSE:482; ThinSE:87x90;",exception);
               if (kernel == (KernelInfo *) NULL)
                 return(kernel);
               if (kernel->next == (KernelInfo *) NULL)
@@ -1974,8 +1987,8 @@ MagickExport KernelInfo *AcquireKernelBuiltIn(const KernelInfoType type,
               ** by Dan S. Bloomberg, available on Leptonica, Selected Papers,
               **   http://www.leptonica.com/papers/conn.pdf
               */
-              kernel=AcquireKernelInfo(
-                            "ThinSE:41; ThinSE:42; ThinSE:43");
+              kernel=AcquireKernelInfo("ThinSE:41; ThinSE:42; ThinSE:43",
+                exception);
               if (kernel == (KernelInfo *) NULL)
                 return(kernel);
               kernel->type = type;
index 25e0f17bb408d0353b67b51cf93e82dc2fcc71ed..f972b9a3337007ee1ff47324b96070c508820a5d 100644 (file)
@@ -130,8 +130,9 @@ typedef struct _KernelInfo
 } KernelInfo;
 
 extern MagickExport KernelInfo
-  *AcquireKernelInfo(const char *),
-  *AcquireKernelBuiltIn(const KernelInfoType,const GeometryInfo *),
+  *AcquireKernelInfo(const char *,ExceptionInfo *),
+  *AcquireKernelBuiltIn(const KernelInfoType,const GeometryInfo *,
+    ExceptionInfo *),
   *CloneKernelInfo(const KernelInfo *),
   *DestroyKernelInfo(KernelInfo *);
 
index e2b116009fb4d6fef7faa99c300dae1df170c45f..4db2fbaf6fd67619674780b4b39ac8a60e32f04f 100644 (file)
@@ -1028,7 +1028,7 @@ WandExport MagickBooleanType ConvertImageCommand(ImageInfo *image_info,
             i++;
             if (i == (ssize_t) argc)
               ThrowConvertException(OptionError,"MissingArgument",option);
-            kernel_info=AcquireKernelInfo(argv[i]);
+            kernel_info=AcquireKernelInfo(argv[i],exception);
             if (kernel_info == (KernelInfo *) NULL)
               ThrowConvertInvalidArgumentException(option,argv[i]);
             kernel_info=DestroyKernelInfo(kernel_info);
@@ -1158,7 +1158,7 @@ WandExport MagickBooleanType ConvertImageCommand(ImageInfo *image_info,
             i++;
             if (i == (ssize_t) argc)
               ThrowConvertException(OptionError,"MissingArgument",option);
-            kernel_info=AcquireKernelInfo(argv[i]);
+            kernel_info=AcquireKernelInfo(argv[i],exception);
             if (kernel_info == (KernelInfo *) NULL)
               ThrowConvertInvalidArgumentException(option,argv[i]);
             kernel_info=DestroyKernelInfo(kernel_info);
@@ -2183,7 +2183,7 @@ WandExport MagickBooleanType ConvertImageCommand(ImageInfo *image_info,
             i++;
             if (i == (ssize_t) argc)
               ThrowConvertException(OptionError,"MissingArgument",option);
-            kernel_info=AcquireKernelInfo(argv[i]);
+            kernel_info=AcquireKernelInfo(argv[i],exception);
             if (kernel_info == (KernelInfo *) NULL)
               ThrowConvertInvalidArgumentException(option,argv[i]);
             kernel_info=DestroyKernelInfo(kernel_info);
index c104fd604d226b780f1486dd9416ab6cacc59ec2..2430f4ab16ecf7197c21d69e8aec8849622ecdc3 100644 (file)
@@ -1146,7 +1146,7 @@ WandExport MagickBooleanType MogrifyImage(ImageInfo *image_info,const int argc,
               *kernel;
 
             (void) SyncImageSettings(mogrify_info,*image,exception);
-            kernel=AcquireKernelInfo(argv[i+1]);
+            kernel=AcquireKernelInfo(argv[i+1],exception);
             if (kernel == (KernelInfo *) NULL)
               break;
             /* FUTURE: check on size of the matrix */
@@ -1242,7 +1242,7 @@ WandExport MagickBooleanType MogrifyImage(ImageInfo *image_info,const int argc,
               *kernel_info;
 
             (void) SyncImageSettings(mogrify_info,*image,exception);
-            kernel_info=AcquireKernelInfo(argv[i+1]);
+            kernel_info=AcquireKernelInfo(argv[i+1],exception);
             if (kernel_info == (KernelInfo *) NULL)
               break;
             /* kernel_info->bias=(*image)->bias; -- FUTURE: check this path! */
@@ -2225,7 +2225,7 @@ WandExport MagickBooleanType MogrifyImage(ImageInfo *image_info,const int argc,
               GetMagickToken(p,&p,token);
             if ((*p != '\0'))
               iterations=(ssize_t) StringToLong(p);
-            kernel=AcquireKernelInfo(argv[i+2]);
+            kernel=AcquireKernelInfo(argv[i+2],exception);
             if (kernel == (KernelInfo *) NULL)
               {
                 (void) ThrowMagickException(exception,GetMagickModule(),
@@ -4211,7 +4211,7 @@ WandExport MagickBooleanType MogrifyImageCommand(ImageInfo *image_info,
             i++;
             if (i == (ssize_t) argc)
               ThrowMogrifyException(OptionError,"MissingArgument",option);
-            kernel_info=AcquireKernelInfo(argv[i]);
+            kernel_info=AcquireKernelInfo(argv[i],exception);
             if (kernel_info == (KernelInfo *) NULL)
               ThrowMogrifyInvalidArgumentException(option,argv[i]);
             kernel_info=DestroyKernelInfo(kernel_info);
@@ -4324,7 +4324,7 @@ WandExport MagickBooleanType MogrifyImageCommand(ImageInfo *image_info,
             i++;
             if (i == (ssize_t) argc)
               ThrowMogrifyException(OptionError,"MissingArgument",option);
-            kernel_info=AcquireKernelInfo(argv[i]);
+            kernel_info=AcquireKernelInfo(argv[i],exception);
             if (kernel_info == (KernelInfo *) NULL)
               ThrowMogrifyInvalidArgumentException(option,argv[i]);
             kernel_info=DestroyKernelInfo(kernel_info);
@@ -5333,7 +5333,7 @@ WandExport MagickBooleanType MogrifyImageCommand(ImageInfo *image_info,
             i++;
             if (i == (ssize_t) argc)
               ThrowMogrifyException(OptionError,"MissingArgument",option);
-            kernel_info=AcquireKernelInfo(argv[i]);
+            kernel_info=AcquireKernelInfo(argv[i],exception);
             if (kernel_info == (KernelInfo *) NULL)
               ThrowMogrifyInvalidArgumentException(option,argv[i]);
             kernel_info=DestroyKernelInfo(kernel_info);
index e728a52bd2304ea9b6db8c5cae0dd7e5e5b7884d..b30baba022b57b6a1ab7dfb54a49bb684563c0ef 100644 (file)
@@ -1642,8 +1642,8 @@ WandPrivate void CLISettingOptionInfo(MagickCLI *cli_wand,
 %
 %  The format of the WandSimpleOperatorImages method is:
 %
-%    void CLISimpleOperatorImages(MagickCLI *cli_wand,
-%        const char *option, const char *arg1, const char *arg2)
+%    void CLISimpleOperatorImages(MagickCLI *cli_wand,const char *option,
+%      const char *arg1, const char *arg2,ExceptionInfo *exception)
 %
 %  A description of each parameter follows:
 %
@@ -1673,7 +1673,8 @@ WandPrivate void CLISettingOptionInfo(MagickCLI *cli_wand,
   return the Image pointer to the first image in list.
 */
 static MagickBooleanType CLISimpleOperatorImage(MagickCLI *cli_wand,
-  const char *option, const char *arg1n, const char *arg2n)
+  const char *option, const char *arg1n, const char *arg2n,
+  ExceptionInfo *exception)
 {
   Image *
     new_image;
@@ -2057,7 +2058,7 @@ static MagickBooleanType CLISimpleOperatorImage(MagickCLI *cli_wand,
           KernelInfo
             *kernel;
 
-          kernel=AcquireKernelInfo(arg1);
+          kernel=AcquireKernelInfo(arg1,exception);
           if (kernel == (KernelInfo *) NULL)
             CLIWandExceptArgBreak(OptionError,"InvalidArgument",option,arg1);
           new_image=ColorMatrixImage(_image,kernel,_exception);
@@ -2140,7 +2141,7 @@ static MagickBooleanType CLISimpleOperatorImage(MagickCLI *cli_wand,
           KernelInfo
             *kernel_info;
 
-          kernel_info=AcquireKernelInfo(arg1);
+          kernel_info=AcquireKernelInfo(arg1,exception);
           if (kernel_info == (KernelInfo *) NULL)
             CLIWandExceptArgBreak(OptionError,"InvalidArgument",option,arg1);
           new_image=MorphologyImage(_image,CorrelateMorphology,1,kernel_info,
@@ -2458,7 +2459,7 @@ static MagickBooleanType CLISimpleOperatorImage(MagickCLI *cli_wand,
       if (LocaleCompare("gaussian",option+1) == 0)
         {
           CLIWandWarnReplaced("-gaussian-blur");
-          CLISimpleOperatorImage(cli_wand,"-gaussian-blur",arg1,NULL);
+          CLISimpleOperatorImage(cli_wand,"-gaussian-blur",arg1,NULL,exception);
         }
       if (LocaleCompare("geometry",option+1) == 0)
         {
@@ -2717,7 +2718,7 @@ static MagickBooleanType CLISimpleOperatorImage(MagickCLI *cli_wand,
       if (LocaleCompare("map",option+1) == 0)
         {
           CLIWandWarnReplaced("-remap");
-          CLISimpleOperatorImage(cli_wand,"-remap",NULL,NULL);
+          CLISimpleOperatorImage(cli_wand,"-remap",NULL,NULL,exception);
           break;
         }
       if (LocaleCompare("mask",option+1) == 0)
@@ -2764,14 +2765,14 @@ static MagickBooleanType CLISimpleOperatorImage(MagickCLI *cli_wand,
       if (LocaleCompare("median",option+1) == 0)
         {
           CLIWandWarnReplaced("-statistic Median");
-          CLISimpleOperatorImage(cli_wand,"-statistic","Median",arg1);
+          CLISimpleOperatorImage(cli_wand,"-statistic","Median",arg1,exception);
           break;
         }
       if (LocaleCompare("mode",option+1) == 0)
         {
           /* FUTURE: note this is also a special "montage" option */
           CLIWandWarnReplaced("-statistic Mode");
-          CLISimpleOperatorImage(cli_wand,"-statistic","Mode",arg1);
+          CLISimpleOperatorImage(cli_wand,"-statistic","Mode",arg1,exception);
           break;
         }
       if (LocaleCompare("modulate",option+1) == 0)
@@ -2810,20 +2811,19 @@ static MagickBooleanType CLISimpleOperatorImage(MagickCLI *cli_wand,
           GetMagickToken(p,&p,token);
           parse=ParseCommandOption(MagickMorphologyOptions,MagickFalse,token);
           if ( parse < 0 )
-            CLIWandExceptArgBreak(OptionError,"UnrecognizedFunction",
-                 option,arg1);
+            CLIWandExceptArgBreak(OptionError,"UnrecognizedFunction",option,
+              arg1);
           iterations=1L;
           GetMagickToken(p,&p,token);
           if ((*p == ':') || (*p == ','))
             GetMagickToken(p,&p,token);
           if ((*p != '\0'))
             iterations=(ssize_t) StringToLong(p);
-          kernel=AcquireKernelInfo(arg2);
+          kernel=AcquireKernelInfo(arg2,exception);
           if (kernel == (KernelInfo *) NULL)
-            CLIWandExceptArgBreak(OptionError,"UnabletoParseKernel",
-                 option,arg2);
-          new_image=MorphologyImage(_image,(MorphologyMethod)parse,
-               iterations,kernel,_exception);
+            CLIWandExceptArgBreak(OptionError,"UnabletoParseKernel",option,arg2);
+          new_image=MorphologyImage(_image,(MorphologyMethod)parse,iterations,
+            kernel,_exception);
           kernel=DestroyKernelInfo(kernel);
           break;
         }
@@ -2834,8 +2834,8 @@ static MagickBooleanType CLISimpleOperatorImage(MagickCLI *cli_wand,
             CLIWandExceptArgBreak(OptionError,"InvalidArgument",option,arg1);
           if ((flags & SigmaValue) == 0)
             geometry_info.sigma=1.0;
-          new_image=MotionBlurImage(_image,geometry_info.rho,
-            geometry_info.sigma,geometry_info.xi,_exception);
+          new_image=MotionBlurImage(_image,geometry_info.rho,geometry_info.sigma,
+            geometry_info.xi,_exception);
           break;
         }
       CLIWandExceptionBreak(OptionError,"UnrecognizedOption",option);
@@ -2858,7 +2858,7 @@ static MagickBooleanType CLISimpleOperatorImage(MagickCLI *cli_wand,
           if (IfNormalOp)
             {
               CLIWandWarnReplaced("-statistic NonPeak");
-              CLISimpleOperatorImage(cli_wand,"-statistic","NonPeak",arg1);
+              CLISimpleOperatorImage(cli_wand,"-statistic","NonPeak",arg1,exception);
               break;
             }
           parse=ParseCommandOption(MagickNoiseOptions,MagickFalse,arg1);
@@ -2926,7 +2926,7 @@ static MagickBooleanType CLISimpleOperatorImage(MagickCLI *cli_wand,
 
           if (IfPlusOp) {
             RandomInfo
-            *random_info;
+              *random_info;
 
             random_info=AcquireRandomInfo();
             angle=22.5*(GetPseudoRandomValue(random_info)-0.5);
@@ -3055,7 +3055,7 @@ static MagickBooleanType CLISimpleOperatorImage(MagickCLI *cli_wand,
       if (LocaleCompare("recolor",option+1) == 0)
         {
           CLIWandWarnReplaced("-color-matrix");
-          CLISimpleOperatorImage(cli_wand,"-color-matrix",arg1,NULL);
+          CLISimpleOperatorImage(cli_wand,"-color-matrix",arg1,NULL,exception);
         }
       if (LocaleCompare("remap",option+1) == 0)
         {
@@ -3530,7 +3530,7 @@ static MagickBooleanType CLISimpleOperatorImage(MagickCLI *cli_wand,
 }
 
 WandPrivate MagickBooleanType CLISimpleOperatorImages(MagickCLI *cli_wand,
-  const char *option,const char *arg1,const char *arg2)
+  const char *option,const char *arg1,const char *arg2,ExceptionInfo *exception)
 {
 #if !USE_WAND_METHODS
   size_t
@@ -3554,7 +3554,7 @@ WandPrivate MagickBooleanType CLISimpleOperatorImages(MagickCLI *cli_wand,
   cli_wand->wand.images=GetFirstImageInList(cli_wand->wand.images);
   while (1) {
     i++;
-    CLISimpleOperatorImage(cli_wand, option, arg1, arg2);
+    CLISimpleOperatorImage(cli_wand, option, arg1, arg2,exception);
     if ( cli_wand->wand.images->next == (Image *) NULL )
       break;
     cli_wand->wand.images=cli_wand->wand.images->next;
@@ -3564,7 +3564,7 @@ WandPrivate MagickBooleanType CLISimpleOperatorImages(MagickCLI *cli_wand,
 #else
   MagickResetIterator(&cli_wand->wand);
   while ( IfMagickTrue(MagickNextImage(&cli_wand->wand)) )
-    CLISimpleOperatorImage(cli_wand, option, arg1, arg2);
+    CLISimpleOperatorImage(cli_wand, option, arg1, arg2,exception);
   MagickResetIterator(&cli_wand->wand);
 #endif
   return(MagickTrue);
@@ -5082,7 +5082,11 @@ WandExport void CLIOption(MagickCLI *cli_wand,const char *option,...)
     /* Operators which loop of individual images, simply */
     if ( (option_type & SimpleOperatorFlag) != 0 &&
          cli_wand->wand.images != (Image *)NULL) /* temp hack */
-      CLISimpleOperatorImages(cli_wand, option, arg1, arg2);
+      {
+        ExceptionInfo *exception=AcquireExceptionInfo();
+        CLISimpleOperatorImages(cli_wand, option, arg1, arg2,exception);
+        exception=DestroyExceptionInfo(exception);
+      }
 
     /* Operators that work on the image list as a whole */
     if ( (option_type & ListOperatorFlag) != 0 )
index 0af05e64e8665774570a0838e9bcb3895edf3436..4f83294798aa2606d40ad48691f21a3cc4851648 100644 (file)
@@ -9546,7 +9546,7 @@ Mogrify(ref,...)
               size_t
                 order;
 
-              kernel=AcquireKernelInfo((const char *) NULL);
+              kernel=AcquireKernelInfo((const char *) NULL,exception);
               if (kernel == (KernelInfo *) NULL)
                 break;
               av=(AV *) argument_list[0].array_reference;
@@ -9574,7 +9574,8 @@ Mogrify(ref,...)
               argument_list[2].string_reference);
           if (attribute_flag[3] != 0)
             {
-              kernel=AcquireKernelInfo(argument_list[3].string_reference);
+              kernel=AcquireKernelInfo(argument_list[3].string_reference,
+                exception);
               if (kernel == (KernelInfo *) NULL)
                 break;
             }
@@ -10473,7 +10474,7 @@ Mogrify(ref,...)
             color_matrix[j]=(double) SvNV(*(av_fetch(av,j,0)));
           for ( ; j < (ssize_t) (order*order); j++)
             color_matrix[j]=0.0;
-          kernel_info=AcquireKernelInfo((const char *) NULL);
+          kernel_info=AcquireKernelInfo((const char *) NULL,exception);
           if (kernel_info == (KernelInfo *) NULL)
             break;
           kernel_info->width=order;
@@ -10995,7 +10996,7 @@ Mogrify(ref,...)
 
           if (attribute_flag[0] == 0)
             break;
-          kernel=AcquireKernelInfo(argument_list[0].string_reference);
+          kernel=AcquireKernelInfo(argument_list[0].string_reference,exception);
           if (kernel == (KernelInfo *) NULL)
             break;
           if (attribute_flag[1] != 0)
index c5b6da670bdd0ac6fc1f68b2118008ef8cde9a8b..86858dee58317fe459382fd90eaa0e48d91dc184 100644 (file)
@@ -9546,7 +9546,7 @@ Mogrify(ref,...)
               size_t
                 order;
 
-              kernel=AcquireKernelInfo((const char *) NULL);
+              kernel=AcquireKernelInfo((const char *) NULL,exception);
               if (kernel == (KernelInfo *) NULL)
                 break;
               av=(AV *) argument_list[0].array_reference;
@@ -9574,7 +9574,8 @@ Mogrify(ref,...)
               argument_list[2].string_reference);
           if (attribute_flag[3] != 0)
             {
-              kernel=AcquireKernelInfo(argument_list[3].string_reference);
+              kernel=AcquireKernelInfo(argument_list[3].string_reference,
+                exception);
               if (kernel == (KernelInfo *) NULL)
                 break;
             }
@@ -10473,7 +10474,7 @@ Mogrify(ref,...)
             color_matrix[j]=(double) SvNV(*(av_fetch(av,j,0)));
           for ( ; j < (ssize_t) (order*order); j++)
             color_matrix[j]=0.0;
-          kernel_info=AcquireKernelInfo((const char *) NULL);
+          kernel_info=AcquireKernelInfo((const char *) NULL,exception);
           if (kernel_info == (KernelInfo *) NULL)
             break;
           kernel_info->width=order;
@@ -10995,7 +10996,7 @@ Mogrify(ref,...)
 
           if (attribute_flag[0] == 0)
             break;
-          kernel=AcquireKernelInfo(argument_list[0].string_reference);
+          kernel=AcquireKernelInfo(argument_list[0].string_reference,exception);
           if (kernel == (KernelInfo *) NULL)
             break;
           if (attribute_flag[1] != 0)