From: cristy Date: Sat, 15 Oct 2011 15:32:24 +0000 (+0000) Subject: (no commit message) X-Git-Tag: 7.0.1-0~6805 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=be469dc73427901eb3d989dc71a8e126047d4b51;p=imagemagick --- diff --git a/MagickCore/display.c b/MagickCore/display.c index cca29f2a9..59906bf68 100644 --- a/MagickCore/display.c +++ b/MagickCore/display.c @@ -3541,7 +3541,7 @@ static MagickBooleanType XColorEditImage(Display *display, break; if (entry != 5) { - (*image)->fuzz=SiPrefixToDouble(FuzzMenu[entry],1.0* + (*image)->fuzz=SiPrefixToDouble(FuzzMenu[entry],(double) QuantumRange+1.0); break; } @@ -3551,7 +3551,7 @@ static MagickBooleanType XColorEditImage(Display *display, if (*fuzz == '\0') break; (void) ConcatenateMagickString(fuzz,"%",MaxTextExtent); - (*image)->fuzz=SiPrefixToDouble(fuzz,1.0*QuantumRange+1.0); + (*image)->fuzz=SiPrefixToDouble(fuzz,(double) QuantumRange+1.0); break; } case ColorEditUndoCommand: @@ -9854,7 +9854,7 @@ static MagickBooleanType XMatteEditImage(Display *display, break; if (entry != 5) { - (*image)->fuzz=SiPrefixToDouble(FuzzMenu[entry],1.0* + (*image)->fuzz=SiPrefixToDouble(FuzzMenu[entry],(double) QuantumRange+1.0); break; } @@ -9864,7 +9864,7 @@ static MagickBooleanType XMatteEditImage(Display *display, if (*fuzz == '\0') break; (void) ConcatenateMagickString(fuzz,"%",MaxTextExtent); - (*image)->fuzz=SiPrefixToDouble(fuzz,1.0*QuantumRange+1.0); + (*image)->fuzz=SiPrefixToDouble(fuzz,(double) QuantumRange+1.0); break; } case MatteEditValueCommand: diff --git a/MagickCore/image.c b/MagickCore/image.c index bf79a4787..36333666a 100644 --- a/MagickCore/image.c +++ b/MagickCore/image.c @@ -4248,7 +4248,7 @@ MagickExport MagickBooleanType SyncImageSettings(const ImageInfo *image_info, MagickFalse,option); option=GetImageOption(image_info,"fuzz"); if (option != (const char *) NULL) - image->fuzz=SiPrefixToDouble(option,QuantumRange); + image->fuzz=SiPrefixToDouble(option,(double) QuantumRange+1.0); option=GetImageOption(image_info,"gravity"); if (option != (const char *) NULL) image->gravity=(GravityType) ParseCommandOption(MagickGravityOptions, diff --git a/MagickCore/string-private.h b/MagickCore/string-private.h index b3dd2e16d..6e4308c9b 100644 --- a/MagickCore/string-private.h +++ b/MagickCore/string-private.h @@ -31,6 +31,9 @@ static inline double SiPrefixToDouble(const char *string,const double interval) scale, value; + /* + Interpret string with International System of Units (SI) unit prefix. + */ value=InterpretLocaleValue(string,&q); scale=1000.0; if ((*q != '\0') && (tolower((int) ((unsigned char) *(q+1))) == 'i'))