From: Cristy Date: Sat, 2 Jun 2018 12:09:01 +0000 (-0400) Subject: https://www.imagemagick.org/discourse-server/viewtopic.php?f=3&t=34065 X-Git-Tag: 7.0.7-38~1 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=01e395a735b1d07f6e1163b7d8c910ee79b01e54;p=imagemagick https://www.imagemagick.org/discourse-server/viewtopic.php?f=3&t=34065 --- diff --git a/MagickCore/draw.c b/MagickCore/draw.c index 80c1b0521..ee74688ab 100644 --- a/MagickCore/draw.c +++ b/MagickCore/draw.c @@ -2054,7 +2054,7 @@ MagickExport MagickBooleanType DrawGradientImage(Image *image, { j=i; i--; - alpha=100.0*(offset-gradient->stops[i].offset)/ + alpha=(offset-gradient->stops[i].offset)/ (gradient->stops[j].offset-gradient->stops[i].offset); CompositePixelInfoBlend(&gradient->stops[i].color,1.0-alpha, &gradient->stops[j].color,alpha,&composite); @@ -3436,7 +3436,9 @@ MagickExport MagickBooleanType DrawImage(Image *image,const DrawInfo *draw_info, exception); stops[number_stops-1].color=stop_color; GetNextToken(q,&q,extent,token); - stops[number_stops-1].offset=StringToDouble(token,&next_token); + factor=strchr(token,'%') != (char *) NULL ? 0.01 : 1.0; + stops[number_stops-1].offset=factor*StringToDouble(token, + &next_token); if (token == next_token) ThrowPointExpectedException(token,exception); break;