diff --git a/MagickCore/colorspace.c b/MagickCore/colorspace.c
index 84e5cd6..f4aa655 100644
--- a/MagickCore/colorspace.c
+++ b/MagickCore/colorspace.c
@@ -619,8 +619,8 @@
gamma=DisplayGamma;
value=GetImageProperty(image,"gamma",exception);
if (value != (const char *) NULL)
- gamma=1.0/fabs(StringToDouble(value,(char **) NULL)) >=
- MagickEpsilon ? StringToDouble(value,(char **) NULL) : 1.0;
+ gamma=1.0/fabs(StringToDouble(value,(char **) NULL)) >= MagickEpsilon ?
+ StringToDouble(value,(char **) NULL) : 1.0;
film_gamma=FilmGamma;
value=GetImageProperty(image,"film-gamma",exception);
if (value != (const char *) NULL)
diff --git a/MagickCore/display.c b/MagickCore/display.c
index 408251c..c924544 100644
--- a/MagickCore/display.c
+++ b/MagickCore/display.c
@@ -3553,7 +3553,8 @@
if (*fuzz == '\0')
break;
(void) ConcatenateMagickString(fuzz,"%",MaxTextExtent);
- (*image)->fuzz=StringToDoubleInterval(fuzz,(double) QuantumRange+1.0);
+ (*image)->fuzz=StringToDoubleInterval(fuzz,(double) QuantumRange+
+ 1.0);
break;
}
case ColorEditUndoCommand:
@@ -8310,7 +8311,7 @@
*/
XSetCursorState(display,windows,MagickTrue);
XCheckRefreshWindows(display,windows);
- threshold=StringToDoubleInterval(factor,QuantumRange);
+ threshold=StringToDoubleInterval(factor,(double) QuantumRange+1.0);
(void) BilevelImage(*image,threshold,exception);
XSetCursorState(display,windows,MagickFalse);
if (windows->image.orphan != MagickFalse)
@@ -8512,7 +8513,7 @@
*/
XSetCursorState(display,windows,MagickTrue);
XCheckRefreshWindows(display,windows);
- threshold=StringToDoubleInterval(factor,QuantumRange);
+ threshold=StringToDoubleInterval(factor,(double) QuantumRange+1.0);
sepia_image=SepiaToneImage(*image,threshold,exception);
if (sepia_image != (Image *) NULL)
{
@@ -8547,7 +8548,7 @@
*/
XSetCursorState(display,windows,MagickTrue);
XCheckRefreshWindows(display,windows);
- threshold=StringToDoubleInterval(factor,QuantumRange);
+ threshold=StringToDoubleInterval(factor,(double) QuantumRange+1.0);
(void) SolarizeImage(*image,threshold,exception);
XSetCursorState(display,windows,MagickFalse);
if (windows->image.orphan != MagickFalse)
@@ -9874,7 +9875,8 @@
if (*fuzz == '\0')
break;
(void) ConcatenateMagickString(fuzz,"%",MaxTextExtent);
- (*image)->fuzz=StringToDoubleInterval(fuzz,(double) QuantumRange+1.0);
+ (*image)->fuzz=StringToDoubleInterval(fuzz,(double) QuantumRange+
+ 1.0);
break;
}
case MatteEditValueCommand:
diff --git a/MagickCore/draw.c b/MagickCore/draw.c
index 7ba5d51..9ad2421 100644
--- a/MagickCore/draw.c
+++ b/MagickCore/draw.c
@@ -2041,8 +2041,7 @@
if (LocaleCompare("font-size",keyword) == 0)
{
GetMagickToken(q,&q,token);
- graphic_context[n]->pointsize=StringToDouble(token,
- (char **) NULL);
+ graphic_context[n]->pointsize=StringToDouble(token,(char **) NULL);
break;
}
if (LocaleCompare("font-stretch",keyword) == 0)
@@ -2156,8 +2155,7 @@
if (LocaleCompare("kerning",keyword) == 0)
{
GetMagickToken(q,&q,token);
- graphic_context[n]->kerning=StringToDouble(token,
- (char **) NULL);
+ graphic_context[n]->kerning=StringToDouble(token,(char **) NULL);
break;
}
status=MagickFalse;
@@ -2359,13 +2357,13 @@
GetMagickToken(q,&q,token);
(void) CopyMagickString(name,token,MaxTextExtent);
GetMagickToken(q,&q,token);
- bounds.x=(ssize_t) ceil(StringToDouble(token,
- (char **) NULL)-0.5);
+ bounds.x=(ssize_t) ceil(StringToDouble(token,(char **) NULL)-
+ 0.5);
GetMagickToken(q,&q,token);
if (*token == ',')
GetMagickToken(q,&q,token);
- bounds.y=(ssize_t) ceil(StringToDouble(token,
- (char **) NULL)-0.5);
+ bounds.y=(ssize_t) ceil(StringToDouble(token,(char **) NULL)-
+ 0.5);
GetMagickToken(q,&q,token);
if (*token == ',')
GetMagickToken(q,&q,token);
@@ -2557,8 +2555,8 @@
GetMagickToken(q,&q,token);
if (*token == ',')
GetMagickToken(q,&q,token);
- graphic_context[n]->dash_pattern[j]=StringToDouble(
- token,(char **) NULL);
+ graphic_context[n]->dash_pattern[j]=StringToDouble(token,
+ (char **) NULL);
}
if ((x & 0x01) != 0)
for ( ; j < (2*x); j++)
@@ -2695,23 +2693,23 @@
if (LocaleCompare("viewbox",keyword) == 0)
{
GetMagickToken(q,&q,token);
- graphic_context[n]->viewbox.x=(ssize_t) ceil(StringToDouble(
- token,(char **) NULL)-0.5);
+ graphic_context[n]->viewbox.x=(ssize_t) ceil(StringToDouble(token,
+ (char **) NULL)-0.5);
GetMagickToken(q,&q,token);
if (*token == ',')
GetMagickToken(q,&q,token);
- graphic_context[n]->viewbox.y=(ssize_t) ceil(StringToDouble(
- token,(char **) NULL)-0.5);
+ graphic_context[n]->viewbox.y=(ssize_t) ceil(StringToDouble(token,
+ (char **) NULL)-0.5);
GetMagickToken(q,&q,token);
if (*token == ',')
GetMagickToken(q,&q,token);
- graphic_context[n]->viewbox.width=(size_t) floor(
- StringToDouble(token,(char **) NULL)+0.5);
+ graphic_context[n]->viewbox.width=(size_t) floor(StringToDouble(
+ token,(char **) NULL)+0.5);
GetMagickToken(q,&q,token);
if (*token == ',')
GetMagickToken(q,&q,token);
- graphic_context[n]->viewbox.height=(size_t) floor(
- StringToDouble(token,(char **) NULL)+0.5);
+ graphic_context[n]->viewbox.height=(size_t) floor(StringToDouble(
+ token,(char **) NULL)+0.5);
break;
}
status=MagickFalse;
@@ -4786,12 +4784,10 @@
draw_info->kerning=StringToDouble(option,(char **) NULL);
option=GetImageOption(image_info,"interline-spacing");
if (option != (const char *) NULL)
- draw_info->interline_spacing=StringToDouble(option,
- (char **) NULL);
+ draw_info->interline_spacing=StringToDouble(option,(char **) NULL);
option=GetImageOption(image_info,"interword-spacing");
if (option != (const char *) NULL)
- draw_info->interword_spacing=StringToDouble(option,
- (char **) NULL);
+ draw_info->interword_spacing=StringToDouble(option,(char **) NULL);
option=GetImageOption(image_info,"direction");
if (option != (const char *) NULL)
draw_info->direction=(DirectionType) ParseCommandOption(
diff --git a/MagickCore/enhance.c b/MagickCore/enhance.c
index 5514776..fe9ef9a 100644
--- a/MagickCore/enhance.c
+++ b/MagickCore/enhance.c
@@ -573,8 +573,7 @@
{
case 0:
{
- color_correction.red.slope=StringToDouble(token,
- (char **) NULL);
+ color_correction.red.slope=StringToDouble(token,(char **) NULL);
break;
}
case 1:
@@ -639,8 +638,7 @@
{
case 0:
{
- color_correction.red.power=StringToDouble(token,
- (char **) NULL);
+ color_correction.red.power=StringToDouble(token,(char **) NULL);
break;
}
case 1:
diff --git a/MagickCore/image.c b/MagickCore/image.c
index e6c3055..f7f9d1c 100644
--- a/MagickCore/image.c
+++ b/MagickCore/image.c
@@ -4130,7 +4130,7 @@
exception);
option=GetImageOption(image_info,"bias");
if (option != (const char *) NULL)
- image->bias=StringToDoubleInterval(option,QuantumRange);
+ image->bias=StringToDoubleInterval(option,(double) QuantumRange+1.0);
option=GetImageOption(image_info,"black-point-compensation");
if (option != (const char *) NULL)
image->black_point_compensation=(MagickBooleanType) ParseCommandOption(
diff --git a/MagickCore/morphology.c b/MagickCore/morphology.c
index 743ce70..462b1f3 100644
--- a/MagickCore/morphology.c
+++ b/MagickCore/morphology.c
@@ -331,7 +331,7 @@
kernel->values[i] = nan; /* do not include this value in kernel */
}
else {
- kernel->values[i] = StringToDouble(token,(char **) NULL);
+ kernel->values[i]=StringToDouble(token,(char **) NULL);
( kernel->values[i] < 0)
? ( kernel->negative_range += kernel->values[i] )
: ( kernel->positive_range += kernel->values[i] );
diff --git a/MagickCore/property.c b/MagickCore/property.c
index ce4a5f1..1944be2 100644
--- a/MagickCore/property.c
+++ b/MagickCore/property.c
@@ -3200,7 +3200,7 @@
}
if (LocaleCompare(property,"bias") == 0)
{
- image->bias=StringToDoubleInterval(value,QuantumRange);
+ image->bias=StringToDoubleInterval(value,(double) QuantumRange+1.0);
break;
}
status=AddValueToSplayTree((SplayTreeInfo *) image->properties,
diff --git a/MagickCore/resize.c b/MagickCore/resize.c
index f9c59be..485209d 100644
--- a/MagickCore/resize.c
+++ b/MagickCore/resize.c
@@ -973,8 +973,7 @@
}
artifact=GetImageArtifact(image,"filter:support");
if (artifact != (const char *) NULL)
- resize_filter->support=fabs(StringToDouble(artifact,
- (char **) NULL)); /* override support */
+ resize_filter->support=fabs(StringToDouble(artifact,(char **) NULL)); /* override support */
/*
Scale windowing function separately to the support 'clipping' window that
calling operator is planning to actually use (expert override).
@@ -982,8 +981,7 @@
resize_filter->window_support=resize_filter->support; /* default */
artifact=GetImageArtifact(image,"filter:win-support");
if (artifact != (const char *) NULL)
- resize_filter->window_support=fabs(StringToDouble(artifact,
- (char **) NULL));
+ resize_filter->window_support=fabs(StringToDouble(artifact,(char **) NULL));
/*
Adjust window function scaling to match windowing support for weighting
function. This avoids a division on every filter call.
diff --git a/MagickCore/resource.c b/MagickCore/resource.c
index b92e205..f095032 100644
--- a/MagickCore/resource.c
+++ b/MagickCore/resource.c
@@ -899,7 +899,7 @@
double
value;
- value=StringToDoubleInterval(string,interval);
+ value=SiPrefixToDoubleInterval(string,interval);
if (value >= (double) MagickULLConstant(~0))
return(MagickULLConstant(~0));
return((MagickSizeType) value);
diff --git a/MagickCore/static.c b/MagickCore/static.c
index b0f311d..9ef564c 100644
--- a/MagickCore/static.c
+++ b/MagickCore/static.c
@@ -247,9 +247,6 @@
(void) RegisterNULLImage();
(void) RegisterOTBImage();
(void) RegisterPALMImage();
-#if defined(MAGICKCORE_PANGO_DELEGATE)
- (void) RegisterPANGOImage();
-#endif
(void) RegisterPATTERNImage();
(void) RegisterPCDImage();
(void) RegisterPCLImage();
@@ -425,9 +422,6 @@
UnregisterNULLImage();
UnregisterOTBImage();
UnregisterPALMImage();
-#if defined(MAGICKCORE_PANGO_DELEGATE)
- UnregisterPANGOImage();
-#endif
UnregisterPATTERNImage();
UnregisterPCDImage();
UnregisterPCLImage();
diff --git a/MagickCore/static.h b/MagickCore/static.h
index 8888d02..fb412eb 100644
--- a/MagickCore/static.h
+++ b/MagickCore/static.h
@@ -107,7 +107,6 @@
RegisterPBMImage(void),
RegisterOTBImage(void),
RegisterPALMImage(void),
- RegisterPANGOImage(void),
RegisterPATTERNImage(void),
RegisterPCDImage(void),
RegisterPCDSImage(void),
@@ -262,7 +261,6 @@
UnregisterPBMImage(void),
UnregisterOTBImage(void),
UnregisterPALMImage(void),
- UnregisterPANGOImage(void),
UnregisterPATTERNImage(void),
UnregisterPCDImage(void),
UnregisterPCDSImage(void),
diff --git a/MagickCore/string-private.h b/MagickCore/string-private.h
index 8c99324..b8948c8 100644
--- a/MagickCore/string-private.h
+++ b/MagickCore/string-private.h
@@ -24,6 +24,21 @@
#include <MagickCore/locale_.h>
+static inline double SiPrefixToDoubleInterval(const char *string,
+ const double interval)
+{
+ char
+ *q;
+
+ double
+ value;
+
+ value=InterpretSiPrefixValue(string,&q);
+ if (*q == '%')
+ value*=interval/100.0;
+ return(value);
+}
+
static inline double StringToDouble(const char *restrict string,
char **restrict sentinal)
{
@@ -39,7 +54,7 @@
double
value;
- value=InterpretSiPrefixValue(string,&q);
+ value=InterpretLocaleValue(string,&q);
if (*q == '%')
value*=interval/100.0;
return(value);