From 64ad8f928c50680fcbd1aa3b433deae984348f89 Mon Sep 17 00:00:00 2001 From: cristy Date: Fri, 3 Aug 2012 00:58:24 +0000 Subject: [PATCH] --- MagickCore/geometry.c | 29 +++++++++++++++-------------- MagickWand/operation.c | 11 ++++------- 2 files changed, 19 insertions(+), 21 deletions(-) diff --git a/MagickCore/geometry.c b/MagickCore/geometry.c index 2484311d2..6d7fa0710 100644 --- a/MagickCore/geometry.c +++ b/MagickCore/geometry.c @@ -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,®ion_info->x,®ion_info->y, ®ion_info->width,®ion_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); } diff --git a/MagickWand/operation.c b/MagickWand/operation.c index aed3c0783..15eeff7d1 100644 --- a/MagickWand/operation.c +++ b/MagickWand/operation.c @@ -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; } -- 2.40.0