]> granicus.if.org Git - imagemagick/commitdiff
(no commit message)
authorcristy <urban-warrior@git.imagemagick.org>
Fri, 3 Aug 2012 00:58:24 +0000 (00:58 +0000)
committercristy <urban-warrior@git.imagemagick.org>
Fri, 3 Aug 2012 00:58:24 +0000 (00:58 +0000)
MagickCore/geometry.c
MagickWand/operation.c

index 2484311d2b57d36a5984f5c63e12ac62dce0dd2a..6d7fa071022a9e8fde36dff9113218413480a850 100644 (file)
@@ -286,18 +286,15 @@ MagickExport MagickStatusType GetGeometry(const char *geometry,ssize_t *x,
             *y=(-*y);
         }
     }
-  if ((flags & SeparatorValue) == 0)
+  if ((flags & PercentValue) != 0)
     {
-      if (((flags & PercentValue) != 0) && ((flags & WidthValue) == 0))
-        {
-          *width=(*height);
-          flags|=WidthValue;
-        }
-      if (((flags & PercentValue) != 0) && ((flags & HeightValue) == 0))
+      if (((flags & SeparatorValue) == 0) && ((flags & HeightValue) == 0))
         {
           *height=(*width);
           flags|=HeightValue;
         }
+      if (((flags & SeparatorValue) != 0) && ((flags & WidthValue) == 0))
+        *width=(*height);
     }
 #if 0
   /* Debugging Geometry */
@@ -1072,18 +1069,15 @@ MagickExport MagickStatusType ParseGeometry(const char *geometry,
       flags|=SigmaValue;
       flags&=(~XiValue);
     }
-  if ((flags & SeparatorValue) == 0)
+  if ((flags & PercentValue) != 0)
     {
-      if (((flags & PercentValue) != 0) && ((flags & RhoValue) == 0))
-        {
-          geometry_info->rho=geometry_info->sigma;
-          flags|=RhoValue;
-        }
-      if (((flags & PercentValue) != 0) && ((flags & SigmaValue) == 0))
+      if (((flags & SeparatorValue) == 0) && ((flags & SigmaValue) == 0))
         {
           geometry_info->sigma=geometry_info->rho;
           flags|=SigmaValue;
         }
+      if (((flags & SeparatorValue) != 0) && ((flags & RhoValue) == 0))
+        geometry_info->rho=geometry_info->sigma;
     }
 #if 0
   /* Debugging Geometry */
@@ -1457,6 +1451,13 @@ MagickExport MagickStatusType ParsePageGeometry(const Image *image,
     }
   flags=ParseMetaGeometry(geometry,&region_info->x,&region_info->y,
     &region_info->width,&region_info->height);
+  if ((flags & PercentValue) != 0)
+    {
+      if ((flags & WidthValue) == 0)
+        region_info->width=region_info->height;
+      if ((flags & HeightValue) == 0)
+        region_info->height=region_info->width;
+    }
   return(flags);
 }
 \f
index aed3c0783e28cd451386fb79395307f6e7c08876..15eeff7d1544dd7fe53c0af0b06a9a8298482b1f 100644 (file)
@@ -1888,18 +1888,15 @@ static void CLISimpleOperatorImage(MagickCLI *cli_wand,
             value;
 
           flags=ParsePageGeometry(_image,arg1,&geometry,_exception);
-          if ((flags & WidthValue) == 0)
+          if ((flags & (WidthValue | HeightValue)) == 0)
             CLIWandExceptArgBreak(OptionError,"InvalidArgument",option,arg1);
           if ((flags & HeightValue) == 0)
             geometry.height=geometry.width;
-
+          compose=OverCompositeOp;
           value=GetImageOption(_image_info,"compose");
           if (value != (const char *) NULL)
-            compose=(CompositeOperator) ParseCommandOption(
-                 MagickComposeOptions,MagickFalse,value);
-          else
-            compose=OverCompositeOp;  /* use Over not _image->compose */
-
+            compose=(CompositeOperator) ParseCommandOption(MagickComposeOptions,
+              MagickFalse,value);
           new_image=BorderImage(_image,&geometry,compose,_exception);
           break;
         }