From 362487684c348a17a3cc2aecc79913205ddbb4cb Mon Sep 17 00:00:00 2001 From: Cristy Date: Sat, 25 Aug 2018 20:35:31 -0400 Subject: [PATCH] Support -crop 3:2+0+0 --- MagickCore/geometry.c | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) 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) { -- 2.40.0