From: Cristy <urban-warrior@imagemagick.org>
Date: Sun, 26 Aug 2018 00:35:31 +0000 (-0400)
Subject: Support -crop 3:2+0+0
X-Git-Tag: 7.0.8-11~26
X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=362487684c348a17a3cc2aecc79913205ddbb4cb;p=imagemagick

Support -crop 3:2+0+0
---

diff --git a/MagickCore/geometry.c b/MagickCore/geometry.c
index 1fd74b0af..0b7f00efc 100644
--- a/MagickCore/geometry.c
+++ b/MagickCore/geometry.c
@@ -229,7 +229,8 @@ MagickExport MagickStatusType GetGeometry(const char *geometry,ssize_t *x,
   if ((*p != '+') && (*p != '-'))
     {
       c=(int) ((unsigned char) *q);
-      if ((c == 215) || (*q == 'x') || (*q == 'X') || (*q == '\0'))
+      if ((c == 215) || (*q == 'x') || (*q == 'X') || (*q == ':') ||
+          (*q == '\0'))
         {
           /*
             Parse width.
@@ -249,7 +250,7 @@ MagickExport MagickStatusType GetGeometry(const char *geometry,ssize_t *x,
   if ((*p != '+') && (*p != '-'))
     {
       c=(int) ((unsigned char) *p);
-      if ((c == 215) || (*p == 'x') || (*p == 'X'))
+      if ((c == 215) || (*p == 'x') || (*p == 'X') || (*p == ':'))
         {
           p++;
           if ((*p != '+') && (*p != '-'))
@@ -1001,8 +1002,8 @@ MagickExport MagickStatusType ParseGeometry(const char *geometry,
   if (LocaleNCompare(p,"0x",2) == 0)
     (void) strtol(p,&q,10);
   c=(int) ((unsigned char) *q);
-  if ((c == 215) || (*q == 'x') || (*q == 'X') || (*q == ',') ||
-      (*q == '/') || (*q == ':') || (*q =='\0'))
+  if ((c == 215) || (*q == 'x') || (*q == 'X') || (*q == ':') ||
+      (*q == ',') || (*q == '/') || (*q =='\0'))
     {
       /*
         Parse rho.
@@ -1020,8 +1021,8 @@ MagickExport MagickStatusType ParseGeometry(const char *geometry,
     }
   q=p;
   c=(int) ((unsigned char) *p);
-  if ((c == 215) || (*p == 'x') || (*p == 'X') || (*p == ',') || (*p == '/') ||
-      (*p == ':'))
+  if ((c == 215) || (*p == 'x') || (*p == 'X') || (*p == ':') || (*p == ',') ||
+      (*p == '/'))
     {
       /*
         Parse sigma.
@@ -1030,8 +1031,8 @@ MagickExport MagickStatusType ParseGeometry(const char *geometry,
       while (isspace((int) ((unsigned char) *p)) != 0)
         p++;
       c=(int) ((unsigned char) *q);
-      if (((c != 215) && (*q != 'x') && (*q != 'X')) || ((*p != '+') &&
-          (*p != '-')))
+      if (((c != 215) && (*q != 'x') && (*q != 'X') && (*q != ':')) ||
+          ((*p != '+') && (*p != '-')))
         {
           q=p;
           value=StringToDouble(p,&p);
@@ -1336,7 +1337,6 @@ MagickExport MagickStatusType ParseGravityGeometry(const Image *image,
 %      the given geometry specification.
 %
 */
-
 MagickExport MagickStatusType ParseMetaGeometry(const char *geometry,ssize_t *x,
   ssize_t *y,size_t *width,size_t *height)
 {