]> granicus.if.org Git - imagemagick/blobdiff - MagickCore/geometry.c
(no commit message)
[imagemagick] / MagickCore / geometry.c
index 6d7fa071022a9e8fde36dff9113218413480a850..dccce5cccfc79c152ec610e4c4b60ed08e652913 100644 (file)
@@ -1072,10 +1072,7 @@ MagickExport MagickStatusType ParseGeometry(const char *geometry,
   if ((flags & PercentValue) != 0)
     {
       if (((flags & SeparatorValue) == 0) && ((flags & SigmaValue) == 0))
-        {
-          geometry_info->sigma=geometry_info->rho;
-          flags|=SigmaValue;
-        }
+        geometry_info->sigma=geometry_info->rho;
       if (((flags & SeparatorValue) != 0) && ((flags & RhoValue) == 0))
         geometry_info->rho=geometry_info->sigma;
     }
@@ -1294,11 +1291,7 @@ MagickExport MagickStatusType ParseMetaGeometry(const char *geometry,ssize_t *x,
       if ((flags & SigmaValue) == 0)
         scale.y=scale.x;
       *width=(size_t) floor(scale.x*former_width/100.0+0.5);
-      if (*width == 0)
-        *width=1;
       *height=(size_t) floor(scale.y*former_height/100.0+0.5);
-      if (*height == 0)
-        *height=1;
       former_width=(*width);
       former_height=(*height);
     }
@@ -1451,7 +1444,8 @@ 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) || ((flags & HeightValue) != 0)) &&
+      (((flags & PercentValue) != 0) || ((flags & SeparatorValue) == 0)))
     {
       if ((flags & WidthValue) == 0)
         region_info->width=region_info->height;