diff --git a/Makefile.in b/Makefile.in
index 3fbafc7..f14180f 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -1365,9 +1365,9 @@
magick/splay-tree.h magick/static.c magick/static.h \
magick/statistic.c magick/statistic.h magick/stream.c \
magick/stream.h magick/stream-private.h magick/string.c \
- magick/string_.h magick/studio.h magick/thread.c \
- magick/thread_.h magick/thread-private.h magick/timer.c \
- magick/timer.h magick/token.c magick/token.h \
+ magick/string_.h magick/string-private.h magick/studio.h \
+ magick/thread.c magick/thread_.h magick/thread-private.h \
+ magick/timer.c magick/timer.h magick/token.c magick/token.h \
magick/token-private.h magick/transform.c magick/transform.h \
magick/threshold.c magick/threshold.h magick/type.c \
magick/type.h magick/utility.c magick/utility.h \
@@ -3859,6 +3859,7 @@
magick/stream-private.h \
magick/string.c \
magick/string_.h \
+ magick/string-private.h \
magick/studio.h \
magick/thread.c \
magick/thread_.h \
@@ -4013,6 +4014,7 @@
magick/signature-private.h \
magick/static.h \
magick/stream-private.h \
+ magick/string-private.h \
magick/studio.h \
magick/thread_.h \
magick/thread-private.h \
diff --git a/coders/cin.c b/coders/cin.c
index db65623..5594393 100644
--- a/coders/cin.c
+++ b/coders/cin.c
@@ -67,6 +67,7 @@
#include "magick/quantum-private.h"
#include "magick/static.h"
#include "magick/string_.h"
+#include "magick/string-private.h"
#include "magick/module.h"
/*
@@ -1023,12 +1024,12 @@
cin.origination.x_offset=0UL;
value=GetCINProperty(image_info,image,"cin:origination.x_offset");
if (value != (const char *) NULL)
- cin.origination.x_offset=atol(value);
+ cin.origination.x_offset=StringToLong(value);
offset+=WriteBlobLong(image,(unsigned long) cin.origination.x_offset);
cin.origination.y_offset=0UL;
value=GetCINProperty(image_info,image,"cin:origination.y_offset");
if (value != (const char *) NULL)
- cin.origination.y_offset=atol(value);
+ cin.origination.y_offset=StringToLong(value);
offset+=WriteBlobLong(image,(unsigned long) cin.origination.y_offset);
value=GetCINProperty(image_info,image,"cin:origination.filename");
if (value != (const char *) NULL)
@@ -1069,12 +1070,12 @@
cin.origination.x_pitch=0.0f;
value=GetCINProperty(image_info,image,"cin:origination.x_pitch");
if (value != (const char *) NULL)
- cin.origination.x_pitch=atof(value);
+ cin.origination.x_pitch=StringToDouble(value);
offset+=WriteBlobFloat(image,cin.origination.x_pitch);
cin.origination.y_pitch=0.0f;
value=GetCINProperty(image_info,image,"cin:origination.y_pitch");
if (value != (const char *) NULL)
- cin.origination.y_pitch=atof(value);
+ cin.origination.y_pitch=StringToDouble(value);
offset+=WriteBlobFloat(image,cin.origination.y_pitch);
cin.origination.gamma=image->gamma;
offset+=WriteBlobFloat(image,cin.origination.gamma);
@@ -1086,28 +1087,28 @@
cin.film.id=0;
value=GetCINProperty(image_info,image,"cin:film.id");
if (value != (const char *) NULL)
- cin.film.id=(char) atoi(value);
+ cin.film.id=(char) StringToLong(value);
offset+=WriteBlobByte(image,(unsigned char) cin.film.id);
cin.film.type=0;
value=GetCINProperty(image_info,image,"cin:film.type");
if (value != (const char *) NULL)
- cin.film.type=(char) atoi(value);
+ cin.film.type=(char) StringToLong(value);
offset+=WriteBlobByte(image,(unsigned char) cin.film.type);
cin.film.offset=0;
value=GetCINProperty(image_info,image,"cin:film.offset");
if (value != (const char *) NULL)
- cin.film.offset=(char) atoi(value);
+ cin.film.offset=(char) StringToLong(value);
offset+=WriteBlobByte(image,(unsigned char) cin.film.offset);
offset+=WriteBlobByte(image,(unsigned char) cin.film.reserve1);
cin.film.prefix=0UL;
value=GetCINProperty(image_info,image,"cin:film.prefix");
if (value != (const char *) NULL)
- cin.film.prefix=(unsigned long) atol(value);
+ cin.film.prefix=(unsigned long) StringToLong(value);
offset+=WriteBlobLong(image,cin.film.prefix);
cin.film.count=0UL;
value=GetCINProperty(image_info,image,"cin:film.count");
if (value != (const char *) NULL)
- cin.film.count=(unsigned long) atol(value);
+ cin.film.count=(unsigned long) StringToLong(value);
offset+=WriteBlobLong(image,cin.film.count);
value=GetCINProperty(image_info,image,"cin:film.format");
if (value != (const char *) NULL)
@@ -1117,12 +1118,12 @@
cin.film.frame_position=0UL;
value=GetCINProperty(image_info,image,"cin:film.frame_position");
if (value != (const char *) NULL)
- cin.film.frame_position=(unsigned long) atol(value);
+ cin.film.frame_position=(unsigned long) StringToLong(value);
offset+=WriteBlobLong(image,cin.film.frame_position);
cin.film.frame_rate=0.0f;
value=GetCINProperty(image_info,image,"cin:film.frame_rate");
if (value != (const char *) NULL)
- cin.film.frame_rate=atof(value);
+ cin.film.frame_rate=StringToDouble(value);
offset+=WriteBlobFloat(image,cin.film.frame_rate);
value=GetCINProperty(image_info,image,"cin:film.frame_id");
if (value != (const char *) NULL)
diff --git a/coders/dcm.c b/coders/dcm.c
index 9d96d97..392666c 100644
--- a/coders/dcm.c
+++ b/coders/dcm.c
@@ -63,6 +63,7 @@
#include "magick/quantum-private.h"
#include "magick/static.h"
#include "magick/string_.h"
+#include "magick/string-private.h"
#include "magick/module.h"
/*
@@ -3173,7 +3174,7 @@
/*
Number of frames.
*/
- number_scenes=(unsigned long) atol((char *) data);
+ number_scenes=(unsigned long) StringToLong((char *) data);
break;
}
case 0x0010:
@@ -3243,7 +3244,7 @@
/*
Visible pixel range: center.
*/
- window_center=atol((char *) data);
+ window_center=StringToLong((char *) data);
break;
}
case 0x1051:
@@ -3251,7 +3252,7 @@
/*
Visible pixel range: width.
*/
- window_width=(unsigned long) atol((char *) data);
+ window_width=(unsigned long) StringToLong((char *) data);
break;
}
case 0x1200:
diff --git a/coders/dpx.c b/coders/dpx.c
index bf88332..43b283a 100644
--- a/coders/dpx.c
+++ b/coders/dpx.c
@@ -52,6 +52,7 @@
#include "magick/list.h"
#include "magick/magick.h"
#include "magick/memory_.h"
+#include "magick/module.h"
#include "magick/monitor.h"
#include "magick/monitor-private.h"
#include "magick/option.h"
@@ -60,8 +61,7 @@
#include "magick/quantum-private.h"
#include "magick/static.h"
#include "magick/string_.h"
-#include "magick/module.h"
-#include "magick/module.h"
+#include "magick/string-private.h"
/*
Typedef declaration.
@@ -1612,32 +1612,32 @@
dpx.orientation.x_offset=0U;
value=GetDPXProperty(image_info,image,"dpx:orientation.x_offset");
if (value != (const char *) NULL)
- dpx.orientation.x_offset=(unsigned int) atoi(value);
+ dpx.orientation.x_offset=(unsigned int) StringToLong(value);
offset+=WriteBlobLong(image,dpx.orientation.x_offset);
dpx.orientation.y_offset=0U;
value=GetDPXProperty(image_info,image,"dpx:orientation.y_offset");
if (value != (const char *) NULL)
- dpx.orientation.y_offset=(unsigned int) atoi(value);
+ dpx.orientation.y_offset=(unsigned int) StringToLong(value);
offset+=WriteBlobLong(image,dpx.orientation.y_offset);
dpx.orientation.x_center=0.0f;
value=GetDPXProperty(image_info,image,"dpx:orientation.x_center");
if (value != (const char *) NULL)
- dpx.orientation.x_center=atof(value);
+ dpx.orientation.x_center=StringToDouble(value);
offset+=WriteBlobFloat(image,dpx.orientation.x_center);
dpx.orientation.y_center=0.0f;
value=GetDPXProperty(image_info,image,"dpx:orientation.y_center");
if (value != (const char *) NULL)
- dpx.orientation.y_center=atof(value);
+ dpx.orientation.y_center=StringToDouble(value);
offset+=WriteBlobFloat(image,dpx.orientation.y_center);
dpx.orientation.x_size=0U;
value=GetDPXProperty(image_info,image,"dpx:orientation.x_size");
if (value != (const char *) NULL)
- dpx.orientation.x_size=(unsigned int) atoi(value);
+ dpx.orientation.x_size=(unsigned int) StringToLong(value);
offset+=WriteBlobLong(image,dpx.orientation.x_size);
dpx.orientation.y_size=0U;
value=GetDPXProperty(image_info,image,"dpx:orientation.y_size");
if (value != (const char *) NULL)
- dpx.orientation.y_size=(unsigned int) atoi(value);
+ dpx.orientation.y_size=(unsigned int) StringToLong(value);
offset+=WriteBlobLong(image,dpx.orientation.y_size);
value=GetDPXProperty(image_info,image,"dpx:orientation.filename");
if (value != (const char *) NULL)
@@ -1726,27 +1726,27 @@
dpx.film.frame_position=0U;
value=GetDPXProperty(image_info,image,"dpx:film.frame_position");
if (value != (const char *) NULL)
- dpx.film.frame_position=(unsigned int) atoi(value);
+ dpx.film.frame_position=(unsigned int) StringToLong(value);
offset+=WriteBlobLong(image,dpx.film.frame_position);
dpx.film.sequence_extent=0U;
value=GetDPXProperty(image_info,image,"dpx:film.sequence_extent");
if (value != (const char *) NULL)
- dpx.film.sequence_extent=(unsigned int) atoi(value);
+ dpx.film.sequence_extent=(unsigned int) StringToLong(value);
offset+=WriteBlobLong(image,dpx.film.sequence_extent);
dpx.film.held_count=0U;
value=GetDPXProperty(image_info,image,"dpx:film.held_count");
if (value != (const char *) NULL)
- dpx.film.held_count=(unsigned int) atoi(value);
+ dpx.film.held_count=(unsigned int) StringToLong(value);
offset+=WriteBlobLong(image,dpx.film.held_count);
dpx.film.frame_rate=0.0f;
value=GetDPXProperty(image_info,image,"dpx:film.frame_rate");
if (value != (const char *) NULL)
- dpx.film.frame_rate=atof(value);
+ dpx.film.frame_rate=StringToDouble(value);
offset+=WriteBlobFloat(image,dpx.film.frame_rate);
dpx.film.shutter_angle=0.0f;
value=GetDPXProperty(image_info,image,"dpx:film.shutter_angle");
if (value != (const char *) NULL)
- dpx.film.shutter_angle=atof(value);
+ dpx.film.shutter_angle=StringToDouble(value);
offset+=WriteBlobFloat(image,dpx.film.shutter_angle);
*dpx.film.frame_id='\0';
value=GetDPXProperty(image_info,image,"dpx:film.frame_id");
@@ -1774,72 +1774,72 @@
offset+=WriteBlobLong(image,dpx.television.user_bits);
value=GetDPXProperty(image_info,image,"dpx:television.interlace");
if (value != (const char *) NULL)
- dpx.television.interlace=(unsigned char) atoi(value);
+ dpx.television.interlace=(unsigned char) StringToLong(value);
offset+=WriteBlobByte(image,dpx.television.interlace);
value=GetDPXProperty(image_info,image,"dpx:television.field_number");
if (value != (const char *) NULL)
- dpx.television.field_number=(unsigned char) atoi(value);
+ dpx.television.field_number=(unsigned char) StringToLong(value);
offset+=WriteBlobByte(image,dpx.television.field_number);
dpx.television.video_signal=0;
value=GetDPXProperty(image_info,image,"dpx:television.video_signal");
if (value != (const char *) NULL)
- dpx.television.video_signal=(unsigned char) atoi(value);
+ dpx.television.video_signal=(unsigned char) StringToLong(value);
offset+=WriteBlobByte(image,dpx.television.video_signal);
dpx.television.padding=0;
value=GetDPXProperty(image_info,image,"dpx:television.padding");
if (value != (const char *) NULL)
- dpx.television.padding=(unsigned char) atoi(value);
+ dpx.television.padding=(unsigned char) StringToLong(value);
offset+=WriteBlobByte(image,dpx.television.padding);
dpx.television.horizontal_sample_rate=0.0f;
value=GetDPXProperty(image_info,image,
"dpx:television.horizontal_sample_rate");
if (value != (const char *) NULL)
- dpx.television.horizontal_sample_rate=atof(value);
+ dpx.television.horizontal_sample_rate=StringToDouble(value);
offset+=WriteBlobFloat(image,dpx.television.horizontal_sample_rate);
dpx.television.vertical_sample_rate=0.0f;
value=GetDPXProperty(image_info,image,"dpx:television.vertical_sample_rate");
if (value != (const char *) NULL)
- dpx.television.vertical_sample_rate=atof(value);
+ dpx.television.vertical_sample_rate=StringToDouble(value);
offset+=WriteBlobFloat(image,dpx.television.vertical_sample_rate);
dpx.television.frame_rate=0.0f;
value=GetDPXProperty(image_info,image,"dpx:television.frame_rate");
if (value != (const char *) NULL)
- dpx.television.frame_rate=atof(value);
+ dpx.television.frame_rate=StringToDouble(value);
offset+=WriteBlobFloat(image,dpx.television.frame_rate);
dpx.television.time_offset=0.0f;
value=GetDPXProperty(image_info,image,"dpx:television.time_offset");
if (value != (const char *) NULL)
- dpx.television.time_offset=atof(value);
+ dpx.television.time_offset=StringToDouble(value);
offset+=WriteBlobFloat(image,dpx.television.time_offset);
dpx.television.gamma=0.0f;
value=GetDPXProperty(image_info,image,"dpx:television.gamma");
if (value != (const char *) NULL)
- dpx.television.gamma=atof(value);
+ dpx.television.gamma=StringToDouble(value);
offset+=WriteBlobFloat(image,dpx.television.gamma);
dpx.television.black_level=0.0f;
value=GetDPXProperty(image_info,image,"dpx:television.black_level");
if (value != (const char *) NULL)
- dpx.television.black_level=atof(value);
+ dpx.television.black_level=StringToDouble(value);
offset+=WriteBlobFloat(image,dpx.television.black_level);
dpx.television.black_gain=0.0f;
value=GetDPXProperty(image_info,image,"dpx:television.black_gain");
if (value != (const char *) NULL)
- dpx.television.black_gain=atof(value);
+ dpx.television.black_gain=StringToDouble(value);
offset+=WriteBlobFloat(image,dpx.television.black_gain);
dpx.television.break_point=0.0f;
value=GetDPXProperty(image_info,image,"dpx:television.break_point");
if (value != (const char *) NULL)
- dpx.television.break_point=atof(value);
+ dpx.television.break_point=StringToDouble(value);
offset+=WriteBlobFloat(image,dpx.television.break_point);
dpx.television.white_level=0.0f;
value=GetDPXProperty(image_info,image,"dpx:television.white_level");
if (value != (const char *) NULL)
- dpx.television.white_level=atof(value);
+ dpx.television.white_level=StringToDouble(value);
offset+=WriteBlobFloat(image,dpx.television.white_level);
dpx.television.integration_times=0.0f;
value=GetDPXProperty(image_info,image,"dpx:television.integration_times");
if (value != (const char *) NULL)
- dpx.television.integration_times=atof(value);
+ dpx.television.integration_times=StringToDouble(value);
offset+=WriteBlobFloat(image,dpx.television.integration_times);
offset+=WriteBlob(image,sizeof(dpx.television.reserve),(unsigned char *)
dpx.television.reserve);
diff --git a/coders/fits.c b/coders/fits.c
index f0fcd7c..6f32bfa 100644
--- a/coders/fits.c
+++ b/coders/fits.c
@@ -54,6 +54,7 @@
#include "magick/list.h"
#include "magick/magick.h"
#include "magick/memory_.h"
+#include "magick/module.h"
#include "magick/monitor.h"
#include "magick/monitor-private.h"
#include "magick/pixel-private.h"
@@ -62,7 +63,7 @@
#include "magick/static.h"
#include "magick/statistic.h"
#include "magick/string_.h"
-#include "magick/module.h"
+#include "magick/string-private.h"
#include "magick/module.h"
/*
@@ -349,23 +350,23 @@
if (LocaleCompare(keyword,"simple") == 0)
fits_info.simple=(*p == 'T') || (*p == 't') ? MagickTrue : MagickFalse;
if (LocaleCompare(keyword,"bitpix") == 0)
- fits_info.bits_per_pixel=atoi(p);
+ fits_info.bits_per_pixel=StringToLong(p);
if (LocaleCompare(keyword,"naxis") == 0)
- fits_info.number_axes=atoi(p);
+ fits_info.number_axes=StringToLong(p);
if (LocaleCompare(keyword,"naxis1") == 0)
- fits_info.columns=atoi(p);
+ fits_info.columns=StringToLong(p);
if (LocaleCompare(keyword,"naxis2") == 0)
- fits_info.rows=atoi(p);
+ fits_info.rows=StringToLong(p);
if (LocaleCompare(keyword,"naxis3") == 0)
- fits_info.number_planes=atoi(p);
+ fits_info.number_planes=StringToLong(p);
if (LocaleCompare(keyword,"datamax") == 0)
- fits_info.max_data=atof(p);
+ fits_info.max_data=StringToDouble(p);
if (LocaleCompare(keyword,"datamin") == 0)
- fits_info.min_data=atof(p);
+ fits_info.min_data=StringToDouble(p);
if (LocaleCompare(keyword,"bzero") == 0)
- fits_info.zero=atof(p);
+ fits_info.zero=StringToDouble(p);
if (LocaleCompare(keyword,"bscale") == 0)
- fits_info.scale=atof(p);
+ fits_info.scale=StringToDouble(p);
if (LocaleCompare(keyword,"comment") == 0)
{
if (comment == (char *) NULL)
diff --git a/coders/hald.c b/coders/hald.c
index d61c06a..921f48f 100644
--- a/coders/hald.c
+++ b/coders/hald.c
@@ -51,12 +51,13 @@
#include "magick/list.h"
#include "magick/magick.h"
#include "magick/memory_.h"
+#include "magick/module.h"
#include "magick/monitor.h"
#include "magick/monitor-private.h"
#include "magick/quantum-private.h"
#include "magick/static.h"
#include "magick/string_.h"
-#include "magick/module.h"
+#include "magick/string-private.h"
/*
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
@@ -117,7 +118,7 @@
image=AcquireImage(image_info);
level=0;
if (*image_info->filename != '\0')
- level=(unsigned long) atol(image_info->filename);
+ level=(unsigned long) StringToLong(image_info->filename);
if (level < 2)
level=8;
status=MagickTrue;
diff --git a/coders/jpeg.c b/coders/jpeg.c
index 1104253..54be7c5 100644
--- a/coders/jpeg.c
+++ b/coders/jpeg.c
@@ -61,6 +61,7 @@
#include "magick/log.h"
#include "magick/magick.h"
#include "magick/memory_.h"
+#include "magick/module.h"
#include "magick/monitor.h"
#include "magick/monitor-private.h"
#include "magick/option.h"
@@ -71,7 +72,7 @@
#include "magick/splay-tree.h"
#include "magick/static.h"
#include "magick/string_.h"
-#include "magick/module.h"
+#include "magick/string-private.h"
#include "magick/utility.h"
#include <setjmp.h>
#if defined(MAGICKCORE_JPEG_DELEGATE)
@@ -1864,7 +1865,7 @@
Search for compression quality that does not exceed image extent.
*/
jpeg_info->quality=0;
- extent=(MagickSizeType) StringToDouble(option,100.0);
+ extent=(MagickSizeType) SiPrefixToDouble(option,100.0);
(void) DeleteImageOption(jpeg_info,"jpeg:extent");
(void) AcquireUniqueFilename(jpeg_image->filename);
min=0;
diff --git a/coders/meta.c b/coders/meta.c
index f876742..5837442 100644
--- a/coders/meta.c
+++ b/coders/meta.c
@@ -49,12 +49,13 @@
#include "magick/list.h"
#include "magick/magick.h"
#include "magick/memory_.h"
+#include "magick/module.h"
#include "magick/profile.h"
#include "magick/splay-tree.h"
#include "magick/quantum-private.h"
#include "magick/static.h"
#include "magick/string_.h"
-#include "magick/module.h"
+#include "magick/string-private.h"
#include "magick/token.h"
#include "magick/utility.h"
@@ -358,10 +359,10 @@
if (strcmp(newstr,"8BIM")==0)
dataset = 255;
else
- dataset = (unsigned char) atoi(newstr);
+ dataset = (unsigned char) StringToLong(newstr);
break;
case 1:
- recnum = (unsigned int) atoi(newstr);
+ recnum = (unsigned int) StringToLong(newstr);
break;
case 2:
name=(char *) AcquireQuantumMemory(strlen(newstr)+MaxTextExtent,
@@ -634,10 +635,10 @@
if (strcmp(newstr,"8BIM")==0)
dataset = 255;
else
- dataset = (unsigned char) atoi(newstr);
+ dataset = (unsigned char) StringToLong(newstr);
break;
case 1:
- recnum=(unsigned int) atoi(newstr);
+ recnum=(unsigned int) StringToLong(newstr);
break;
case 2:
name=(char *) AcquireQuantumMemory(strlen(newstr)+MaxTextExtent,
diff --git a/coders/miff.c b/coders/miff.c
index 523433e..c6ac0c9 100644
--- a/coders/miff.c
+++ b/coders/miff.c
@@ -58,6 +58,7 @@
#include "magick/list.h"
#include "magick/magick.h"
#include "magick/memory_.h"
+#include "magick/module.h"
#include "magick/monitor.h"
#include "magick/monitor-private.h"
#include "magick/option.h"
@@ -68,7 +69,7 @@
#include "magick/static.h"
#include "magick/statistic.h"
#include "magick/string_.h"
-#include "magick/module.h"
+#include "magick/string-private.h"
#if defined(MAGICKCORE_ZLIB_DELEGATE)
#include "zlib.h"
#endif
@@ -623,7 +624,7 @@
}
if (LocaleCompare(keyword,"colors") == 0)
{
- colors=(unsigned long) atol(options);
+ colors=(unsigned long) StringToLong(options);
break;
}
if (LocaleCompare(keyword,"colorspace") == 0)
@@ -652,7 +653,7 @@
}
if (LocaleCompare(keyword,"columns") == 0)
{
- image->columns=(unsigned long) atol(options);
+ image->columns=(unsigned long) StringToLong(options);
break;
}
(void) SetImageProperty(image,keyword,options);
@@ -663,12 +664,12 @@
{
if (LocaleCompare(keyword,"delay") == 0)
{
- image->delay=(unsigned long) atol(options);
+ image->delay=(unsigned long) StringToLong(options);
break;
}
if (LocaleCompare(keyword,"depth") == 0)
{
- image->depth=(unsigned long) atol(options);
+ image->depth=(unsigned long) StringToLong(options);
break;
}
if (LocaleCompare(keyword,"dispose") == 0)
@@ -709,7 +710,7 @@
{
if (LocaleCompare(keyword,"gamma") == 0)
{
- image->gamma=atof(options);
+ image->gamma=StringToDouble(options);
break;
}
if (LocaleCompare(keyword,"gravity") == 0)
@@ -747,7 +748,7 @@
}
if (LocaleCompare(keyword,"iterations") == 0)
{
- image->iterations=(unsigned long) atol(options);
+ image->iterations=(unsigned long) StringToLong(options);
break;
}
(void) SetImageProperty(image,keyword,options);
@@ -835,7 +836,7 @@
profiles=NewLinkedList(0);
(void) AppendValueToLinkedList(profiles,
AcquireString(keyword+8));
- profile=AcquireStringInfo((size_t) atol(options));
+ profile=AcquireStringInfo((size_t) StringToLong(options));
(void) SetImageProfile(image,keyword+8,profile);
profile=DestroyStringInfo(profile);
break;
@@ -848,7 +849,7 @@
{
if (LocaleCompare(keyword,"quality") == 0)
{
- image->quality=(unsigned long) atol(options);
+ image->quality=(unsigned long) StringToLong(options);
break;
}
if ((LocaleCompare(keyword,"quantum-format") == 0) ||
@@ -903,7 +904,7 @@
}
if (LocaleCompare(keyword,"rows") == 0)
{
- image->rows=(unsigned long) atol(options);
+ image->rows=(unsigned long) StringToLong(options);
break;
}
(void) SetImageProperty(image,keyword,options);
@@ -914,7 +915,7 @@
{
if (LocaleCompare(keyword,"scene") == 0)
{
- image->scene=(unsigned long) atol(options);
+ image->scene=(unsigned long) StringToLong(options);
break;
}
(void) SetImageProperty(image,keyword,options);
@@ -925,7 +926,7 @@
{
if (LocaleCompare(keyword,"ticks-per-second") == 0)
{
- image->ticks_per_second=atol(options);
+ image->ticks_per_second=StringToLong(options);
break;
}
if (LocaleCompare(keyword,"tile-offset") == 0)
@@ -976,7 +977,7 @@
{
if (LocaleCompare(keyword,"version") == 0)
{
- version=atof(options);
+ version=StringToDouble(options);
break;
}
(void) SetImageProperty(image,keyword,options);
diff --git a/coders/mpc.c b/coders/mpc.c
index a6766b2..ece2d72 100644
--- a/coders/mpc.c
+++ b/coders/mpc.c
@@ -58,6 +58,7 @@
#include "magick/list.h"
#include "magick/magick.h"
#include "magick/memory_.h"
+#include "magick/module.h"
#include "magick/monitor.h"
#include "magick/monitor-private.h"
#include "magick/option.h"
@@ -67,7 +68,7 @@
#include "magick/static.h"
#include "magick/statistic.h"
#include "magick/string_.h"
-#include "magick/module.h"
+#include "magick/string-private.h"
#include "magick/utility.h"
/*
@@ -366,7 +367,7 @@
}
if (LocaleCompare(keyword,"colors") == 0)
{
- image->colors=(unsigned long) atol(options);
+ image->colors=(unsigned long) StringToLong(options);
break;
}
if (LocaleCompare(keyword,"colorspace") == 0)
@@ -395,7 +396,7 @@
}
if (LocaleCompare(keyword,"columns") == 0)
{
- image->columns=(unsigned long) atol(options);
+ image->columns=(unsigned long) StringToLong(options);
break;
}
(void) SetImageProperty(image,keyword,options);
@@ -406,12 +407,12 @@
{
if (LocaleCompare(keyword,"delay") == 0)
{
- image->delay=(unsigned long) atol(options);
+ image->delay=(unsigned long) StringToLong(options);
break;
}
if (LocaleCompare(keyword,"depth") == 0)
{
- image->depth=(unsigned long) atol(options);
+ image->depth=(unsigned long) StringToLong(options);
break;
}
if (LocaleCompare(keyword,"dispose") == 0)
@@ -446,7 +447,7 @@
}
if (LocaleCompare(keyword,"error") == 0)
{
- image->error.mean_error_per_pixel=atof(options);
+ image->error.mean_error_per_pixel=StringToDouble(options);
break;
}
(void) SetImageProperty(image,keyword,options);
@@ -457,7 +458,7 @@
{
if (LocaleCompare(keyword,"gamma") == 0)
{
- image->gamma=atof(options);
+ image->gamma=StringToDouble(options);
break;
}
if (LocaleCompare(keyword,"green-primary") == 0)
@@ -483,7 +484,7 @@
}
if (LocaleCompare(keyword,"iterations") == 0)
{
- image->iterations=(unsigned long) atol(options);
+ image->iterations=(unsigned long) StringToLong(options);
break;
}
(void) SetImageProperty(image,keyword,options);
@@ -512,12 +513,12 @@
}
if (LocaleCompare(keyword,"maximum-error") == 0)
{
- image->error.normalized_maximum_error=atof(options);
+ image->error.normalized_maximum_error=StringToDouble(options);
break;
}
if (LocaleCompare(keyword,"mean-error") == 0)
{
- image->error.normalized_mean_error=atof(options);
+ image->error.normalized_mean_error=StringToDouble(options);
break;
}
if (LocaleCompare(keyword,"montage") == 0)
@@ -578,7 +579,7 @@
profiles=NewLinkedList(0);
(void) AppendValueToLinkedList(profiles,
AcquireString(keyword+8));
- profile=AcquireStringInfo((size_t) atol(options));
+ profile=AcquireStringInfo((size_t) StringToLong(options));
(void) SetImageProfile(image,keyword+8,profile);
profile=DestroyStringInfo(profile);
break;
@@ -591,12 +592,12 @@
{
if (LocaleCompare(keyword,"quality") == 0)
{
- image->quality=(unsigned long) atol(options);
+ image->quality=(unsigned long) StringToLong(options);
break;
}
if (LocaleCompare(keyword,"quantum-depth") == 0)
{
- quantum_depth=(unsigned long) atol(options);
+ quantum_depth=(unsigned long) StringToLong(options);
break;
}
(void) SetImageProperty(image,keyword,options);
@@ -636,7 +637,7 @@
}
if (LocaleCompare(keyword,"rows") == 0)
{
- image->rows=(unsigned long) atol(options);
+ image->rows=(unsigned long) StringToLong(options);
break;
}
(void) SetImageProperty(image,keyword,options);
@@ -647,7 +648,7 @@
{
if (LocaleCompare(keyword,"scene") == 0)
{
- image->scene=(unsigned long) atol(options);
+ image->scene=(unsigned long) StringToLong(options);
break;
}
(void) SetImageProperty(image,keyword,options);
@@ -658,7 +659,7 @@
{
if (LocaleCompare(keyword,"ticks-per-second") == 0)
{
- image->ticks_per_second=(long) atol(options);
+ image->ticks_per_second=(long) StringToLong(options);
break;
}
if (LocaleCompare(keyword,"tile-offset") == 0)
diff --git a/coders/msl.c b/coders/msl.c
index d2346db..038867e 100644
--- a/coders/msl.c
+++ b/coders/msl.c
@@ -68,6 +68,7 @@
#include "magick/log.h"
#include "magick/magick.h"
#include "magick/memory_.h"
+#include "magick/module.h"
#include "magick/option.h"
#include "magick/paint.h"
#include "magick/profile.h"
@@ -82,7 +83,7 @@
#include "magick/signature.h"
#include "magick/static.h"
#include "magick/string_.h"
-#include "magick/module.h"
+#include "magick/string-private.h"
#include "magick/transform.h"
#include "magick/threshold.h"
#include "magick/utility.h"
@@ -898,7 +899,7 @@
{
if (LocaleCompare(keyword,"pointsize") == 0)
{
- draw_info->pointsize=atof(value);
+ draw_info->pointsize=StringToDouble(value);
break;
}
ThrowMSLException(OptionError,"UnrecognizedAttribute",
@@ -910,7 +911,7 @@
{
if (LocaleCompare(keyword,"rotate") == 0)
{
- angle=atof(value);
+ angle=StringToDouble(value);
affine.sx=cos(DegreesToRadians(fmod(angle,360.0)));
affine.rx=sin(DegreesToRadians(fmod(angle,360.0)));
affine.ry=(-sin(DegreesToRadians(fmod(angle,360.0))));
@@ -935,14 +936,14 @@
}
if (LocaleCompare(keyword,"skewX") == 0)
{
- angle=atof(value);
+ angle=StringToDouble(value);
affine.ry=tan(DegreesToRadians(fmod((double) angle,
360.0)));
break;
}
if (LocaleCompare(keyword,"skewY") == 0)
{
- angle=atof(value);
+ angle=StringToDouble(value);
affine.rx=tan(DegreesToRadians(fmod((double) angle,
360.0)));
break;
@@ -965,7 +966,7 @@
}
if (LocaleCompare(keyword,"strokewidth") == 0)
{
- draw_info->stroke_width=atol(value);
+ draw_info->stroke_width=StringToLong(value);
break;
}
if (LocaleCompare(keyword,"style") == 0)
@@ -1021,7 +1022,7 @@
{
if (LocaleCompare(keyword,"weight") == 0)
{
- draw_info->weight=atol(value);
+ draw_info->weight=StringToLong(value);
break;
}
ThrowMSLException(OptionError,"UnrecognizedAttribute",
@@ -1033,7 +1034,7 @@
{
if (LocaleCompare(keyword,"x") == 0)
{
- geometry.x=atol(value);
+ geometry.x=StringToLong(value);
break;
}
ThrowMSLException(OptionError,"UnrecognizedAttribute",
@@ -1045,7 +1046,7 @@
{
if (LocaleCompare(keyword,"y") == 0)
{
- geometry.y=atol(value);
+ geometry.y=StringToLong(value);
break;
}
ThrowMSLException(OptionError,"UnrecognizedAttribute",
@@ -1196,7 +1197,7 @@
{
if (LocaleCompare(keyword,"radius") == 0)
{
- geometry_info.rho=atof(value);
+ geometry_info.rho=StringToDouble(value);
break;
}
ThrowMSLException(OptionError,"UnrecognizedAttribute",
@@ -1208,7 +1209,7 @@
{
if (LocaleCompare(keyword,"sigma") == 0)
{
- geometry_info.sigma=atol(value);
+ geometry_info.sigma=StringToLong(value);
break;
}
ThrowMSLException(OptionError,"UnrecognizedAttribute",
@@ -1306,7 +1307,7 @@
{
if (LocaleCompare(keyword,"height") == 0)
{
- geometry.height=atol(value);
+ geometry.height=StringToLong(value);
break;
}
ThrowMSLException(OptionError,"UnrecognizedAttribute",
@@ -1318,7 +1319,7 @@
{
if (LocaleCompare(keyword,"width") == 0)
{
- geometry.width=atol(value);
+ geometry.width=StringToLong(value);
break;
}
ThrowMSLException(OptionError,"UnrecognizedAttribute",
@@ -1446,7 +1447,7 @@
{
if (LocaleCompare(keyword, "radius") == 0)
{
- radius = atof( value );
+ radius = StringToDouble( value );
break;
}
ThrowMSLException(OptionError,"UnrecognizedAttribute",keyword);
@@ -1457,7 +1458,7 @@
{
if (LocaleCompare(keyword,"sigma") == 0)
{
- sigma = atol( value );
+ sigma = StringToLong( value );
break;
}
ThrowMSLException(OptionError,"UnrecognizedAttribute",keyword);
@@ -1532,7 +1533,7 @@
{
if (LocaleCompare(keyword,"height") == 0)
{
- geometry.height=atol(value);
+ geometry.height=StringToLong(value);
break;
}
ThrowMSLException(OptionError,"UnrecognizedAttribute",
@@ -1544,7 +1545,7 @@
{
if (LocaleCompare(keyword,"width") == 0)
{
- geometry.width=atol(value);
+ geometry.width=StringToLong(value);
break;
}
ThrowMSLException(OptionError,"UnrecognizedAttribute",
@@ -1556,7 +1557,7 @@
{
if (LocaleCompare(keyword,"x") == 0)
{
- geometry.x=atol(value);
+ geometry.x=StringToLong(value);
break;
}
ThrowMSLException(OptionError,"UnrecognizedAttribute",
@@ -1568,7 +1569,7 @@
{
if (LocaleCompare(keyword,"y") == 0)
{
- geometry.y=atol(value);
+ geometry.y=StringToLong(value);
break;
}
ThrowMSLException(OptionError,"UnrecognizedAttribute",
@@ -1645,7 +1646,7 @@
}
if (LocaleCompare(keyword,"fuzz") == 0)
{
- msl_info->image[n]->fuzz=atof(value);
+ msl_info->image[n]->fuzz=StringToDouble(value);
break;
}
ThrowMSLException(OptionError,"UnrecognizedAttribute",
@@ -1674,7 +1675,7 @@
{
if (LocaleCompare(keyword,"x") == 0)
{
- geometry.x=atol(value);
+ geometry.x=StringToLong(value);
(void) GetOneVirtualMagickPixel(msl_info->image[n],
geometry.x,geometry.y,&target,&exception);
break;
@@ -1688,7 +1689,7 @@
{
if (LocaleCompare(keyword,"y") == 0)
{
- geometry.y=atol(value);
+ geometry.y=StringToLong(value);
(void) GetOneVirtualMagickPixel(msl_info->image[n],
geometry.x,geometry.y,&target,&exception);
break;
@@ -1914,7 +1915,7 @@
CacheView
*composite_view;
- opacity=QuantumRange-atol(value);
+ opacity=QuantumRange-StringToLong(value);
if (compose != DissolveCompositeOp)
{
(void) SetImageOpacity(composite_image,(Quantum)
@@ -1951,7 +1952,7 @@
{
if (LocaleCompare(keyword,"rotate") == 0)
{
- rotate_image=RotateImage(composite_image,atof(value),
+ rotate_image=RotateImage(composite_image,StringToDouble(value),
&exception);
break;
}
@@ -2005,7 +2006,7 @@
{
if (LocaleCompare(keyword,"x") == 0)
{
- geometry.x=atol(value);
+ geometry.x=StringToLong(value);
(void) GetOneVirtualPixel(msl_info->image[n],geometry.x,
geometry.y,&target,&exception);
break;
@@ -2019,7 +2020,7 @@
{
if (LocaleCompare(keyword,"y") == 0)
{
- geometry.y=atol(value);
+ geometry.y=StringToLong(value);
(void) GetOneVirtualPixel(msl_info->image[n],geometry.x,
geometry.y,&target,&exception);
break;
@@ -2156,7 +2157,7 @@
{
if (LocaleCompare(keyword,"height") == 0)
{
- geometry.height=atol(value);
+ geometry.height=StringToLong(value);
break;
}
ThrowMSLException(OptionError,"UnrecognizedAttribute",
@@ -2168,7 +2169,7 @@
{
if (LocaleCompare(keyword,"width") == 0)
{
- geometry.width=atol(value);
+ geometry.width=StringToLong(value);
break;
}
ThrowMSLException(OptionError,"UnrecognizedAttribute",
@@ -2180,7 +2181,7 @@
{
if (LocaleCompare(keyword,"x") == 0)
{
- geometry.x=atol(value);
+ geometry.x=StringToLong(value);
break;
}
ThrowMSLException(OptionError,"UnrecognizedAttribute",
@@ -2192,7 +2193,7 @@
{
if (LocaleCompare(keyword,"y") == 0)
{
- geometry.y=atol(value);
+ geometry.y=StringToLong(value);
break;
}
ThrowMSLException(OptionError,"UnrecognizedAttribute",
@@ -2244,7 +2245,7 @@
{
if (LocaleCompare(keyword,"display") == 0)
{
- display=atol(value);
+ display=StringToLong(value);
break;
}
ThrowMSLException(OptionError,"UnrecognizedAttribute",
@@ -2488,7 +2489,7 @@
}
if (LocaleCompare(keyword,"pointsize") == 0)
{
- draw_info->pointsize=atof(value);
+ draw_info->pointsize=StringToDouble(value);
break;
}
ThrowMSLException(OptionError,"UnrecognizedAttribute",
@@ -2500,7 +2501,7 @@
{
if (LocaleCompare(keyword,"rotate") == 0)
{
- angle=atof(value);
+ angle=StringToDouble(value);
affine.sx=cos(DegreesToRadians(fmod(angle,360.0)));
affine.rx=sin(DegreesToRadians(fmod(angle,360.0)));
affine.ry=(-sin(DegreesToRadians(fmod(angle,360.0))));
@@ -2525,13 +2526,13 @@
}
if (LocaleCompare(keyword,"skewX") == 0)
{
- angle=atof(value);
+ angle=StringToDouble(value);
affine.ry=cos(DegreesToRadians(fmod(angle,360.0)));
break;
}
if (LocaleCompare(keyword,"skewY") == 0)
{
- angle=atof(value);
+ angle=StringToDouble(value);
affine.rx=cos(DegreesToRadians(fmod(angle,360.0)));
break;
}
@@ -2553,7 +2554,7 @@
}
if (LocaleCompare(keyword,"strokewidth") == 0)
{
- draw_info->stroke_width=atol(value);
+ draw_info->stroke_width=StringToLong(value);
break;
}
if (LocaleCompare(keyword,"style") == 0)
@@ -2609,7 +2610,7 @@
{
if (LocaleCompare(keyword,"weight") == 0)
{
- draw_info->weight=atol(value);
+ draw_info->weight=StringToLong(value);
break;
}
ThrowMSLException(OptionError,"UnrecognizedAttribute",
@@ -2621,7 +2622,7 @@
{
if (LocaleCompare(keyword,"x") == 0)
{
- geometry.x=atol(value);
+ geometry.x=StringToLong(value);
break;
}
ThrowMSLException(OptionError,"UnrecognizedAttribute",
@@ -2633,7 +2634,7 @@
{
if (LocaleCompare(keyword,"y") == 0)
{
- geometry.y=atol(value);
+ geometry.y=StringToLong(value);
break;
}
ThrowMSLException(OptionError,"UnrecognizedAttribute",
@@ -2710,7 +2711,7 @@
{
if (LocaleCompare(keyword,"radius") == 0)
{
- geometry_info.rho=atof(value);
+ geometry_info.rho=StringToDouble(value);
break;
}
ThrowMSLException(OptionError,"UnrecognizedAttribute",
@@ -2775,7 +2776,7 @@
{
if (LocaleCompare(keyword,"radius") == 0)
{
- geometry_info.rho=atof(value);
+ geometry_info.rho=StringToDouble(value);
break;
}
ThrowMSLException(OptionError,"UnrecognizedAttribute",
@@ -2787,7 +2788,7 @@
{
if (LocaleCompare(keyword,"sigma") == 0)
{
- geometry_info.sigma=atol(value);
+ geometry_info.sigma=StringToLong(value);
break;
}
ThrowMSLException(OptionError,"UnrecognizedAttribute",
@@ -3045,7 +3046,7 @@
{
if (LocaleCompare(keyword,"height") == 0)
{
- frame_info.height=atol(value);
+ frame_info.height=StringToLong(value);
break;
}
ThrowMSLException(OptionError,"UnrecognizedAttribute",
@@ -3057,7 +3058,7 @@
{
if (LocaleCompare(keyword,"inner") == 0)
{
- frame_info.inner_bevel=atol(value);
+ frame_info.inner_bevel=StringToLong(value);
break;
}
ThrowMSLException(OptionError,"UnrecognizedAttribute",
@@ -3069,7 +3070,7 @@
{
if (LocaleCompare(keyword,"outer") == 0)
{
- frame_info.outer_bevel=atol(value);
+ frame_info.outer_bevel=StringToLong(value);
break;
}
ThrowMSLException(OptionError,"UnrecognizedAttribute",
@@ -3081,7 +3082,7 @@
{
if (LocaleCompare(keyword,"width") == 0)
{
- frame_info.width=atol(value);
+ frame_info.width=StringToLong(value);
break;
}
ThrowMSLException(OptionError,"UnrecognizedAttribute",
@@ -3149,7 +3150,7 @@
{
if (LocaleCompare(keyword,"blue") == 0)
{
- pixel.blue=atof(value);
+ pixel.blue=StringToDouble(value);
break;
}
ThrowMSLException(OptionError,"UnrecognizedAttribute",
@@ -3182,7 +3183,7 @@
}
if (LocaleCompare(keyword,"green") == 0)
{
- pixel.green=atof(value);
+ pixel.green=StringToDouble(value);
break;
}
ThrowMSLException(OptionError,"UnrecognizedAttribute",
@@ -3194,7 +3195,7 @@
{
if (LocaleCompare(keyword,"red") == 0)
{
- pixel.red=atof(value);
+ pixel.red=StringToDouble(value);
break;
}
ThrowMSLException(OptionError,"UnrecognizedAttribute",
@@ -3388,7 +3389,7 @@
{
if (LocaleCompare(keyword,"amount") == 0)
{
- geometry_info.rho=atof(value);
+ geometry_info.rho=StringToDouble(value);
break;
}
ThrowMSLException(OptionError,"UnrecognizedAttribute",
@@ -3457,7 +3458,7 @@
{
if (LocaleCompare(keyword,"black") == 0)
{
- levelBlack = atof( value );
+ levelBlack = StringToDouble( value );
break;
}
ThrowMSLException(OptionError,"UnrecognizedAttribute",keyword);
@@ -3468,7 +3469,7 @@
{
if (LocaleCompare(keyword,"gamma") == 0)
{
- levelGamma = atof( value );
+ levelGamma = StringToDouble( value );
break;
}
ThrowMSLException(OptionError,"UnrecognizedAttribute",keyword);
@@ -3479,7 +3480,7 @@
{
if (LocaleCompare(keyword,"white") == 0)
{
- levelWhite = atof( value );
+ levelWhite = StringToDouble( value );
break;
}
ThrowMSLException(OptionError,"UnrecognizedAttribute",keyword);
@@ -3671,7 +3672,7 @@
{
if (LocaleCompare(keyword,"fuzz") == 0)
{
- msl_info->image[n]->fuzz=atof(value);
+ msl_info->image[n]->fuzz=StringToDouble(value);
break;
}
ThrowMSLException(OptionError,"UnrecognizedAttribute",
@@ -3700,7 +3701,7 @@
{
if (LocaleCompare(keyword,"opacity") == 0)
{
- opacity=atof(value);
+ opacity=StringToDouble(value);
break;
}
ThrowMSLException(OptionError,"UnrecognizedAttribute",
@@ -3712,7 +3713,7 @@
{
if (LocaleCompare(keyword,"x") == 0)
{
- geometry.x=atol(value);
+ geometry.x=StringToLong(value);
(void) GetOneVirtualMagickPixel(msl_info->image[n],
geometry.x,geometry.y,&target,&exception);
break;
@@ -3726,7 +3727,7 @@
{
if (LocaleCompare(keyword,"y") == 0)
{
- geometry.y=atol(value);
+ geometry.y=StringToLong(value);
(void) GetOneVirtualMagickPixel(msl_info->image[n],
geometry.x,geometry.y,&target,&exception);
break;
@@ -3794,7 +3795,7 @@
{
if (LocaleCompare(keyword,"radius") == 0)
{
- geometry_info.rho=atof(value);
+ geometry_info.rho=StringToDouble(value);
break;
}
ThrowMSLException(OptionError,"UnrecognizedAttribute",
@@ -3881,12 +3882,12 @@
{
if (LocaleCompare(keyword,"blackness") == 0)
{
- geometry_info.rho=atof(value);
+ geometry_info.rho=StringToDouble(value);
break;
}
if (LocaleCompare(keyword,"brightness") == 0)
{
- geometry_info.rho=atof(value);
+ geometry_info.rho=StringToDouble(value);
break;
}
ThrowMSLException(OptionError,"UnrecognizedAttribute",
@@ -3910,7 +3911,7 @@
{
if (LocaleCompare(keyword,"hue") == 0)
{
- geometry_info.xi=atof(value);
+ geometry_info.xi=StringToDouble(value);
break;
}
ThrowMSLException(OptionError,"UnrecognizedAttribute",
@@ -3922,7 +3923,7 @@
{
if (LocaleCompare(keyword,"lightness") == 0)
{
- geometry_info.rho=atof(value);
+ geometry_info.rho=StringToDouble(value);
break;
}
ThrowMSLException(OptionError,"UnrecognizedAttribute",
@@ -3934,7 +3935,7 @@
{
if (LocaleCompare(keyword,"saturation") == 0)
{
- geometry_info.sigma=atof(value);
+ geometry_info.sigma=StringToDouble(value);
break;
}
ThrowMSLException(OptionError,"UnrecognizedAttribute",
@@ -3946,7 +3947,7 @@
{
if (LocaleCompare(keyword,"whiteness") == 0)
{
- geometry_info.sigma=atof(value);
+ geometry_info.sigma=StringToDouble(value);
break;
}
ThrowMSLException(OptionError,"UnrecognizedAttribute",
@@ -4133,7 +4134,7 @@
{
if (LocaleCompare(keyword,"radius") == 0)
{
- geometry_info.rho=atof(value);
+ geometry_info.rho=StringToDouble(value);
break;
}
ThrowMSLException(OptionError,"UnrecognizedAttribute",
@@ -4208,7 +4209,7 @@
}
if (LocaleCompare(keyword,"fuzz") == 0)
{
- msl_info->image[n]->fuzz=atof(value);
+ msl_info->image[n]->fuzz=StringToDouble(value);
break;
}
ThrowMSLException(OptionError,"UnrecognizedAttribute",
@@ -4399,7 +4400,7 @@
{
if (LocaleCompare(keyword,"colors") == 0)
{
- quantize_info.number_colors=atol(value);
+ quantize_info.number_colors=StringToLong(value);
break;
}
if (LocaleCompare(keyword,"colorspace") == 0)
@@ -4455,7 +4456,7 @@
{
if (LocaleCompare(keyword,"treedepth") == 0)
{
- quantize_info.tree_depth=atol(value);
+ quantize_info.tree_depth=StringToLong(value);
break;
}
ThrowMSLException(OptionError,"UnrecognizedAttribute",
@@ -4630,7 +4631,7 @@
{
if (LocaleCompare(keyword,"pointsize") == 0)
{
- draw_info->pointsize=atof(value);
+ draw_info->pointsize=StringToDouble(value);
break;
}
ThrowMSLException(OptionError,"UnrecognizedAttribute",
@@ -4642,7 +4643,7 @@
{
if (LocaleCompare(keyword,"rotate") == 0)
{
- angle=atof(value);
+ angle=StringToDouble(value);
affine.sx=cos(DegreesToRadians(fmod(angle,360.0)));
affine.rx=sin(DegreesToRadians(fmod(angle,360.0)));
affine.ry=(-sin(DegreesToRadians(fmod(angle,360.0))));
@@ -4667,13 +4668,13 @@
}
if (LocaleCompare(keyword,"skewX") == 0)
{
- angle=atof(value);
+ angle=StringToDouble(value);
affine.ry=cos(DegreesToRadians(fmod(angle,360.0)));
break;
}
if (LocaleCompare(keyword,"skewY") == 0)
{
- angle=atof(value);
+ angle=StringToDouble(value);
affine.rx=cos(DegreesToRadians(fmod(angle,360.0)));
break;
}
@@ -4695,7 +4696,7 @@
}
if (LocaleCompare(keyword,"strokewidth") == 0)
{
- draw_info->stroke_width=atol(value);
+ draw_info->stroke_width=StringToLong(value);
break;
}
if (LocaleCompare(keyword,"style") == 0)
@@ -4751,7 +4752,7 @@
{
if (LocaleCompare(keyword,"weight") == 0)
{
- draw_info->weight=atol(value);
+ draw_info->weight=StringToLong(value);
break;
}
ThrowMSLException(OptionError,"UnrecognizedAttribute",
@@ -4763,7 +4764,7 @@
{
if (LocaleCompare(keyword,"x") == 0)
{
- geometry.x=atol(value);
+ geometry.x=StringToLong(value);
break;
}
ThrowMSLException(OptionError,"UnrecognizedAttribute",
@@ -4775,7 +4776,7 @@
{
if (LocaleCompare(keyword,"y") == 0)
{
- geometry.y=atol(value);
+ geometry.y=StringToLong(value);
break;
}
ThrowMSLException(OptionError,"UnrecognizedAttribute",
@@ -4888,7 +4889,7 @@
{
if (LocaleCompare(keyword,"height") == 0)
{
- geometry.height=atol(value);
+ geometry.height=StringToLong(value);
break;
}
ThrowMSLException(OptionError,"UnrecognizedAttribute",
@@ -4917,7 +4918,7 @@
{
if (LocaleCompare(keyword,"width") == 0)
{
- geometry.width=atol(value);
+ geometry.width=StringToLong(value);
break;
}
ThrowMSLException(OptionError,"UnrecognizedAttribute",
@@ -5017,7 +5018,7 @@
{
if (LocaleCompare(keyword,"radius") == 0)
{
- geometry_info.rho=atof(value);
+ geometry_info.rho=StringToDouble(value);
break;
}
ThrowMSLException(OptionError,"UnrecognizedAttribute",
@@ -5114,7 +5115,7 @@
{
if (LocaleCompare(keyword,"height") == 0)
{
- height = atol( value );
+ height = StringToLong( value );
break;
}
ThrowMSLException(OptionError,"UnrecognizedAttribute",keyword);
@@ -5125,7 +5126,7 @@
{
if (LocaleCompare(keyword,"width") == 0)
{
- width = atol( value );
+ width = StringToLong( value );
break;
}
ThrowMSLException(OptionError,"UnrecognizedAttribute",keyword);
@@ -5136,7 +5137,7 @@
{
if (LocaleCompare(keyword,"x") == 0)
{
- x = atol( value );
+ x = StringToLong( value );
break;
}
ThrowMSLException(OptionError,"UnrecognizedAttribute",keyword);
@@ -5147,7 +5148,7 @@
{
if (LocaleCompare(keyword,"y") == 0)
{
- y = atol( value );
+ y = StringToLong( value );
break;
}
ThrowMSLException(OptionError,"UnrecognizedAttribute",keyword);
@@ -5194,7 +5195,7 @@
{
if (LocaleCompare(keyword,"blur") == 0)
{
- msl_info->image[n]->blur=atof(value);
+ msl_info->image[n]->blur=StringToDouble(value);
break;
}
ThrowMSLException(OptionError,"UnrecognizedAttribute",keyword);
@@ -5223,7 +5224,7 @@
{
if (LocaleCompare(keyword,"x-resolution") == 0)
{
- x_resolution=atof(value);
+ x_resolution=StringToDouble(value);
break;
}
ThrowMSLException(OptionError,"UnrecognizedAttribute",keyword);
@@ -5234,7 +5235,7 @@
{
if (LocaleCompare(keyword,"y-resolution") == 0)
{
- y_resolution=atof(value);
+ y_resolution=StringToDouble(value);
break;
}
ThrowMSLException(OptionError,"UnrecognizedAttribute",keyword);
@@ -5342,7 +5343,7 @@
{
if (LocaleCompare(keyword,"height") == 0)
{
- geometry.height=(unsigned long) atol(value);
+ geometry.height=(unsigned long) StringToLong(value);
break;
}
ThrowMSLException(OptionError,"UnrecognizedAttribute",
@@ -5354,7 +5355,7 @@
{
if (LocaleCompare(keyword,"support") == 0)
{
- blur=atof(value);
+ blur=StringToDouble(value);
break;
}
ThrowMSLException(OptionError,"UnrecognizedAttribute",
@@ -5366,7 +5367,7 @@
{
if (LocaleCompare(keyword,"width") == 0)
{
- geometry.width=atol(value);
+ geometry.width=StringToLong(value);
break;
}
ThrowMSLException(OptionError,"UnrecognizedAttribute",
@@ -5433,7 +5434,7 @@
{
if (LocaleCompare(keyword,"x") == 0)
{
- geometry.x=atol(value);
+ geometry.x=StringToLong(value);
break;
}
ThrowMSLException(OptionError,"UnrecognizedAttribute",
@@ -5445,7 +5446,7 @@
{
if (LocaleCompare(keyword,"y") == 0)
{
- geometry.y=atol(value);
+ geometry.y=StringToLong(value);
break;
}
ThrowMSLException(OptionError,"UnrecognizedAttribute",
@@ -5506,7 +5507,7 @@
{
if (LocaleCompare(keyword,"x") == 0)
{
- x = atol( value );
+ x = StringToLong( value );
break;
}
ThrowMSLException(OptionError,"UnrecognizedAttribute",keyword);
@@ -5517,7 +5518,7 @@
{
if (LocaleCompare(keyword,"y") == 0)
{
- y = atol( value );
+ y = StringToLong( value );
break;
}
ThrowMSLException(OptionError,"UnrecognizedAttribute",keyword);
@@ -5575,7 +5576,7 @@
{
if (LocaleCompare(keyword,"degrees") == 0)
{
- geometry_info.rho=atof(value);
+ geometry_info.rho=StringToDouble(value);
break;
}
ThrowMSLException(OptionError,"UnrecognizedAttribute",
@@ -5637,7 +5638,7 @@
{
if (LocaleCompare(keyword,"degrees") == 0)
{
- degrees = atof( value );
+ degrees = StringToDouble( value );
break;
}
ThrowMSLException(OptionError,"UnrecognizedAttribute",keyword);
@@ -5713,7 +5714,7 @@
{
if (LocaleCompare(keyword,"height") == 0)
{
- geometry.height=(unsigned long) atol(value);
+ geometry.height=(unsigned long) StringToLong(value);
break;
}
ThrowMSLException(OptionError,"UnrecognizedAttribute",
@@ -5725,7 +5726,7 @@
{
if (LocaleCompare(keyword,"width") == 0)
{
- geometry.width=atol(value);
+ geometry.width=StringToLong(value);
break;
}
ThrowMSLException(OptionError,"UnrecognizedAttribute",
@@ -5789,7 +5790,7 @@
{
if (LocaleCompare(keyword,"height") == 0)
{
- geometry.height=(unsigned long) atol(value);
+ geometry.height=(unsigned long) StringToLong(value);
break;
}
ThrowMSLException(OptionError,"UnrecognizedAttribute",
@@ -5801,7 +5802,7 @@
{
if (LocaleCompare(keyword,"width") == 0)
{
- geometry.width=atol(value);
+ geometry.width=StringToLong(value);
break;
}
ThrowMSLException(OptionError,"UnrecognizedAttribute",
@@ -5859,7 +5860,7 @@
{
if (LocaleCompare(keyword,"cluster-threshold") == 0)
{
- geometry_info.rho=atof(value);
+ geometry_info.rho=StringToDouble(value);
break;
}
if (LocaleCompare(keyword,"colorspace") == 0)
@@ -5895,7 +5896,7 @@
{
if (LocaleCompare(keyword,"smoothing-threshold") == 0)
{
- geometry_info.sigma=atof(value);
+ geometry_info.sigma=StringToDouble(value);
break;
}
ThrowMSLException(OptionError,"UnrecognizedAttribute",
@@ -6011,10 +6012,10 @@
if (value[len-1] == '%') {
char tmp[100];
(void) CopyMagickString(tmp,value,len);
- opac = atol( tmp );
+ opac = StringToLong( tmp );
opac = (int)(QuantumRange * ((float)opac/100));
} else
- opac = atol( value );
+ opac = StringToLong( value );
(void) SetImageOpacity( msl_info->image[n], (Quantum) opac );
break;
}
@@ -6096,7 +6097,7 @@
{
if (LocaleCompare(keyword,"azimuth") == 0)
{
- geometry_info.rho=atof(value);
+ geometry_info.rho=StringToDouble(value);
break;
}
ThrowMSLException(OptionError,"UnrecognizedAttribute",
@@ -6108,7 +6109,7 @@
{
if (LocaleCompare(keyword,"elevation") == 0)
{
- geometry_info.sigma=atof(value);
+ geometry_info.sigma=StringToDouble(value);
break;
}
ThrowMSLException(OptionError,"UnrecognizedAttribute",
@@ -6197,7 +6198,7 @@
{
if (LocaleCompare(keyword,"opacity") == 0)
{
- geometry_info.rho=atol(value);
+ geometry_info.rho=StringToLong(value);
break;
}
ThrowMSLException(OptionError,"UnrecognizedAttribute",
@@ -6209,7 +6210,7 @@
{
if (LocaleCompare(keyword,"sigma") == 0)
{
- geometry_info.sigma=atol(value);
+ geometry_info.sigma=StringToLong(value);
break;
}
break;
@@ -6219,7 +6220,7 @@
{
if (LocaleCompare(keyword,"x") == 0)
{
- geometry_info.xi=atof(value);
+ geometry_info.xi=StringToDouble(value);
break;
}
ThrowMSLException(OptionError,"UnrecognizedAttribute",
@@ -6231,7 +6232,7 @@
{
if (LocaleCompare(keyword,"y") == 0)
{
- geometry_info.psi=atol(value);
+ geometry_info.psi=StringToLong(value);
break;
}
ThrowMSLException(OptionError,"UnrecognizedAttribute",
@@ -6283,7 +6284,7 @@
{
if (LocaleCompare(keyword, "radius") == 0)
{
- radius = atof( value );
+ radius = StringToDouble( value );
break;
}
ThrowMSLException(OptionError,"UnrecognizedAttribute",keyword);
@@ -6294,7 +6295,7 @@
{
if (LocaleCompare(keyword,"sigma") == 0)
{
- sigma = atol( value );
+ sigma = StringToLong( value );
break;
}
ThrowMSLException(OptionError,"UnrecognizedAttribute",keyword);
@@ -6361,7 +6362,7 @@
{
if (LocaleCompare(keyword,"height") == 0)
{
- height = atol( value );
+ height = StringToLong( value );
break;
}
ThrowMSLException(OptionError,"UnrecognizedAttribute",keyword);
@@ -6372,7 +6373,7 @@
{
if (LocaleCompare(keyword,"width") == 0)
{
- width = atol( value );
+ width = StringToLong( value );
break;
}
ThrowMSLException(OptionError,"UnrecognizedAttribute",keyword);
@@ -6466,7 +6467,7 @@
{
if (LocaleCompare(keyword,"x") == 0)
{
- geometry_info.rho=atof(value);
+ geometry_info.rho=StringToDouble(value);
break;
}
ThrowMSLException(OptionError,"UnrecognizedAttribute",
@@ -6478,7 +6479,7 @@
{
if (LocaleCompare(keyword,"y") == 0)
{
- geometry_info.sigma=atol(value);
+ geometry_info.sigma=StringToLong(value);
break;
}
ThrowMSLException(OptionError,"UnrecognizedAttribute",
@@ -6570,7 +6571,7 @@
{
if (LocaleCompare(keyword,"threshold") == 0)
{
- geometry_info.rho=atof(value);
+ geometry_info.rho=StringToDouble(value);
break;
}
ThrowMSLException(OptionError,"UnrecognizedAttribute",
@@ -6630,7 +6631,7 @@
{
if (LocaleCompare(keyword,"radius") == 0)
{
- geometry_info.rho=atof(value);
+ geometry_info.rho=StringToDouble(value);
break;
}
ThrowMSLException(OptionError,"UnrecognizedAttribute",
@@ -6877,7 +6878,7 @@
{
if (LocaleCompare(keyword,"degrees") == 0)
{
- geometry_info.rho=atof(value);
+ geometry_info.rho=StringToDouble(value);
break;
}
ThrowMSLException(OptionError,"UnrecognizedAttribute",
@@ -7030,7 +7031,7 @@
{
if (LocaleCompare(keyword,"threshold") == 0)
{
- threshold = atof( value );
+ threshold = StringToDouble( value );
break;
}
ThrowMSLException(OptionError,"UnrecognizedAttribute",keyword);
@@ -7838,7 +7839,7 @@
limit=MagickResourceInfinity;
if (LocaleCompare(value,"unlimited") != 0)
- limit=(MagickSizeType) StringToDouble(value,100.0);
+ limit=(MagickSizeType) SiPrefixToDouble(value,100.0);
(void) SetMagickResourceLimit(AreaResource,limit);
break;
}
@@ -7868,7 +7869,7 @@
{
if (image == (Image *) NULL)
break;
- image->bias=StringToDouble(value,QuantumRange);
+ image->bias=SiPrefixToDouble(value,QuantumRange);
break;
}
if (LocaleCompare(keyword,"blue-primary") == 0)
@@ -7971,8 +7972,8 @@
{
if (LocaleCompare(keyword,"pointsize") == 0)
{
- image_info->pointsize=atof(value);
- draw_info->pointsize=atof(value);
+ image_info->pointsize=StringToDouble(value);
+ draw_info->pointsize=StringToDouble(value);
break;
}
ThrowMSLException(OptionError,"UnrecognizedAttribute",keyword);
@@ -7983,10 +7984,10 @@
{
if (LocaleCompare(keyword,"quality") == 0)
{
- image_info->quality=atol(value);
+ image_info->quality=StringToLong(value);
if (image == (Image *) NULL)
break;
- image->quality=atol(value);
+ image->quality=StringToLong(value);
break;
}
break;
diff --git a/coders/png.c b/coders/png.c
index 69ed1d9..f537b3c 100644
--- a/coders/png.c
+++ b/coders/png.c
@@ -76,6 +76,7 @@
#include "magick/static.h"
#include "magick/statistic.h"
#include "magick/string_.h"
+#include "magick/string-private.h"
#include "magick/transform.h"
#include "magick/utility.h"
#if defined(MAGICKCORE_PNG_DELEGATE)
@@ -1540,7 +1541,7 @@
/* look for length */
while (*sp == '\0' || *sp == ' ' || *sp == '\n')
sp++;
- length=(png_uint_32) atol(sp);
+ length=(png_uint_32) StringToLong(sp);
while (*sp != ' ' && *sp != '\n')
sp++;
/* allocate space */
diff --git a/coders/pnm.c b/coders/pnm.c
index 0181a6d..ca4dd42 100644
--- a/coders/pnm.c
+++ b/coders/pnm.c
@@ -53,6 +53,7 @@
#include "magick/list.h"
#include "magick/magick.h"
#include "magick/memory_.h"
+#include "magick/module.h"
#include "magick/monitor.h"
#include "magick/monitor-private.h"
#include "magick/pixel-private.h"
@@ -61,7 +62,7 @@
#include "magick/static.h"
#include "magick/statistic.h"
#include "magick/string_.h"
-#include "magick/module.h"
+#include "magick/string-private.h"
/*
Forward declarations.
@@ -312,7 +313,7 @@
scale[MaxTextExtent];
(void) ReadBlobString(image,scale);
- quantum_scale=atof(scale);
+ quantum_scale=StringToDouble(scale);
}
else
{
@@ -365,11 +366,11 @@
Assign a value to the specified keyword.
*/
if (LocaleCompare(keyword,"depth") == 0)
- packet_size=(unsigned long) atol(value);
+ packet_size=(unsigned long) StringToLong(value);
if (LocaleCompare(keyword,"height") == 0)
- image->rows=(unsigned long) atol(value);
+ image->rows=(unsigned long) StringToLong(value);
if (LocaleCompare(keyword,"maxval") == 0)
- max_value=(unsigned long) atol(value);
+ max_value=(unsigned long) StringToLong(value);
if (LocaleCompare(keyword,"TUPLTYPE") == 0)
{
if (LocaleCompare(value,"BLACKANDWHITE") == 0)
@@ -404,7 +405,7 @@
}
}
if (LocaleCompare(keyword,"width") == 0)
- image->columns=(unsigned long) atol(value);
+ image->columns=(unsigned long) StringToLong(value);
}
}
if ((image->columns == 0) || (image->rows == 0))
diff --git a/coders/sct.c b/coders/sct.c
index 46ed061..2e615cf 100644
--- a/coders/sct.c
+++ b/coders/sct.c
@@ -50,12 +50,13 @@
#include "magick/list.h"
#include "magick/magick.h"
#include "magick/memory_.h"
+#include "magick/module.h"
#include "magick/monitor.h"
#include "magick/monitor-private.h"
#include "magick/quantum-private.h"
#include "magick/static.h"
#include "magick/string_.h"
-#include "magick/module.h"
+#include "magick/string-private.h"
/*
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
@@ -204,14 +205,14 @@
separations_mask=ReadBlobMSBShort(image);
count=ReadBlob(image,14,buffer);
buffer[14]='\0';
- height=atof((char *) buffer);
+ height=StringToDouble((char *) buffer);
count=ReadBlob(image,14,buffer);
- width=atof((char *) buffer);
+ width=StringToDouble((char *) buffer);
count=ReadBlob(image,12,buffer);
buffer[12]='\0';
- image->rows=1UL*atol((char *) buffer);
+ image->rows=1UL*StringToLong((char *) buffer);
count=ReadBlob(image,12,buffer);
- image->columns=1UL*atol((char *) buffer);
+ image->columns=1UL*StringToLong((char *) buffer);
count=ReadBlob(image,200,buffer);
count=ReadBlob(image,768,buffer);
if (separations_mask == 0x0f)
diff --git a/coders/svg.c b/coders/svg.c
index eb9224f..686669d 100644
--- a/coders/svg.c
+++ b/coders/svg.c
@@ -59,6 +59,7 @@
#include "magick/log.h"
#include "magick/magick.h"
#include "magick/memory_.h"
+#include "magick/module.h"
#include "magick/monitor.h"
#include "magick/monitor-private.h"
#include "magick/quantum-private.h"
@@ -67,7 +68,7 @@
#include "magick/resource_.h"
#include "magick/static.h"
#include "magick/string_.h"
-#include "magick/module.h"
+#include "magick/string-private.h"
#include "magick/token.h"
#include "magick/utility.h"
#if defined(MAGICKCORE_XML_DELEGATE)
@@ -301,7 +302,7 @@
assert(string != (const char *) NULL);
p=(const char *) string;
GetMagickToken(p,&p,token);
- value=atof(token);
+ value=StringToDouble(token);
if (strchr(token,'%') != (char *) NULL)
{
double
@@ -1286,27 +1287,27 @@
{
p=(const char *) value;
GetMagickToken(p,&p,token);
- affine.sx=atof(value);
+ affine.sx=StringToDouble(value);
GetMagickToken(p,&p,token);
if (*token == ',')
GetMagickToken(p,&p,token);
- affine.rx=atof(token);
+ affine.rx=StringToDouble(token);
GetMagickToken(p,&p,token);
if (*token == ',')
GetMagickToken(p,&p,token);
- affine.ry=atof(token);
+ affine.ry=StringToDouble(token);
GetMagickToken(p,&p,token);
if (*token == ',')
GetMagickToken(p,&p,token);
- affine.sy=atof(token);
+ affine.sy=StringToDouble(token);
GetMagickToken(p,&p,token);
if (*token == ',')
GetMagickToken(p,&p,token);
- affine.tx=atof(token);
+ affine.tx=StringToDouble(token);
GetMagickToken(p,&p,token);
if (*token == ',')
GetMagickToken(p,&p,token);
- affine.ty=atof(token);
+ affine.ty=StringToDouble(token);
break;
}
break;
@@ -1861,27 +1862,27 @@
{
p=(const char *) value;
GetMagickToken(p,&p,token);
- affine.sx=atof(value);
+ affine.sx=StringToDouble(value);
GetMagickToken(p,&p,token);
if (*token == ',')
GetMagickToken(p,&p,token);
- affine.rx=atof(token);
+ affine.rx=StringToDouble(token);
GetMagickToken(p,&p,token);
if (*token == ',')
GetMagickToken(p,&p,token);
- affine.ry=atof(token);
+ affine.ry=StringToDouble(token);
GetMagickToken(p,&p,token);
if (*token == ',')
GetMagickToken(p,&p,token);
- affine.sy=atof(token);
+ affine.sy=StringToDouble(token);
GetMagickToken(p,&p,token);
if (*token == ',')
GetMagickToken(p,&p,token);
- affine.tx=atof(token);
+ affine.tx=StringToDouble(token);
GetMagickToken(p,&p,token);
if (*token == ',')
GetMagickToken(p,&p,token);
- affine.ty=atof(token);
+ affine.ty=StringToDouble(token);
break;
}
break;
@@ -1898,15 +1899,15 @@
p=(const char *) value;
GetMagickToken(p,&p,token);
- angle=atof(value);
+ angle=StringToDouble(value);
GetMagickToken(p,&p,token);
if (*token == ',')
GetMagickToken(p,&p,token);
- x=atof(token);
+ x=StringToDouble(token);
GetMagickToken(p,&p,token);
if (*token == ',')
GetMagickToken(p,&p,token);
- y=atof(token);
+ y=StringToDouble(token);
affine.sx=cos(DegreesToRadians(fmod(angle,360.0)));
affine.rx=sin(DegreesToRadians(fmod(angle,360.0)));
affine.ry=(-sin(DegreesToRadians(fmod(angle,360.0))));
@@ -2008,21 +2009,21 @@
{
p=(const char *) value;
GetMagickToken(p,&p,token);
- svg_info->view_box.x=atof(token);
+ svg_info->view_box.x=StringToDouble(token);
GetMagickToken(p,&p,token);
if (*token == ',')
GetMagickToken(p,&p,token);
- svg_info->view_box.y=atof(token);
+ svg_info->view_box.y=StringToDouble(token);
GetMagickToken(p,&p,token);
if (*token == ',')
GetMagickToken(p,&p,token);
- svg_info->view_box.width=atof(token);
+ svg_info->view_box.width=StringToDouble(token);
if (svg_info->bounds.width == 0)
svg_info->bounds.width=svg_info->view_box.width;
GetMagickToken(p,&p,token);
if (*token == ',')
GetMagickToken(p,&p,token);
- svg_info->view_box.height=atof(token);
+ svg_info->view_box.height=StringToDouble(token);
if (svg_info->bounds.height == 0)
svg_info->bounds.height=svg_info->view_box.height;
break;
@@ -3480,34 +3481,34 @@
if (LocaleCompare("affine",keyword) == 0)
{
GetMagickToken(q,&q,token);
- affine.sx=atof(token);
+ affine.sx=StringToDouble(token);
GetMagickToken(q,&q,token);
if (*token == ',')
GetMagickToken(q,&q,token);
- affine.rx=atof(token);
+ affine.rx=StringToDouble(token);
GetMagickToken(q,&q,token);
if (*token == ',')
GetMagickToken(q,&q,token);
- affine.ry=atof(token);
+ affine.ry=StringToDouble(token);
GetMagickToken(q,&q,token);
if (*token == ',')
GetMagickToken(q,&q,token);
- affine.sy=atof(token);
+ affine.sy=StringToDouble(token);
GetMagickToken(q,&q,token);
if (*token == ',')
GetMagickToken(q,&q,token);
- affine.tx=atof(token);
+ affine.tx=StringToDouble(token);
GetMagickToken(q,&q,token);
if (*token == ',')
GetMagickToken(q,&q,token);
- affine.ty=atof(token);
+ affine.ty=StringToDouble(token);
break;
}
if (LocaleCompare("angle",keyword) == 0)
{
GetMagickToken(q,&q,token);
- affine.rx=atof(token);
- affine.ry=atof(token);
+ affine.rx=StringToDouble(token);
+ affine.ry=StringToDouble(token);
break;
}
if (LocaleCompare("arc",keyword) == 0)
@@ -3822,23 +3823,23 @@
GetMagickToken(q,&q,token);
(void) CopyMagickString(type,token,MaxTextExtent);
GetMagickToken(q,&q,token);
- svg_info.segment.x1=atof(token);
- svg_info.element.cx=atof(token);
+ svg_info.segment.x1=StringToDouble(token);
+ svg_info.element.cx=StringToDouble(token);
GetMagickToken(q,&q,token);
if (*token == ',')
GetMagickToken(q,&q,token);
- svg_info.segment.y1=atof(token);
- svg_info.element.cy=atof(token);
+ svg_info.segment.y1=StringToDouble(token);
+ svg_info.element.cy=StringToDouble(token);
GetMagickToken(q,&q,token);
if (*token == ',')
GetMagickToken(q,&q,token);
- svg_info.segment.x2=atof(token);
- svg_info.element.major=atof(token);
+ svg_info.segment.x2=StringToDouble(token);
+ svg_info.element.major=StringToDouble(token);
GetMagickToken(q,&q,token);
if (*token == ',')
GetMagickToken(q,&q,token);
- svg_info.segment.y2=atof(token);
- svg_info.element.minor=atof(token);
+ svg_info.segment.y2=StringToDouble(token);
+ svg_info.element.minor=StringToDouble(token);
(void) FormatMagickString(message,MaxTextExtent,
"<%sGradient id=\"%s\" x1=\"%g\" y1=\"%g\" x2=\"%g\" "
"y2=\"%g\">\n",type,name,svg_info.segment.x1,
@@ -3848,7 +3849,7 @@
GetMagickToken(q,&q,token);
if (*token == ',')
GetMagickToken(q,&q,token);
- svg_info.element.angle=atof(token);
+ svg_info.element.angle=StringToDouble(token);
(void) FormatMagickString(message,MaxTextExtent,
"<%sGradient id=\"%s\" cx=\"%g\" cy=\"%g\" r=\"%g\" "
"fx=\"%g\" fy=\"%g\">\n",type,name,svg_info.element.cx,
@@ -3874,19 +3875,19 @@
GetMagickToken(q,&q,token);
(void) CopyMagickString(name,token,MaxTextExtent);
GetMagickToken(q,&q,token);
- svg_info.bounds.x=atof(token);
+ svg_info.bounds.x=StringToDouble(token);
GetMagickToken(q,&q,token);
if (*token == ',')
GetMagickToken(q,&q,token);
- svg_info.bounds.y=atof(token);
+ svg_info.bounds.y=StringToDouble(token);
GetMagickToken(q,&q,token);
if (*token == ',')
GetMagickToken(q,&q,token);
- svg_info.bounds.width=atof(token);
+ svg_info.bounds.width=StringToDouble(token);
GetMagickToken(q,&q,token);
if (*token == ',')
GetMagickToken(q,&q,token);
- svg_info.bounds.height=atof(token);
+ svg_info.bounds.height=StringToDouble(token);
(void) FormatMagickString(message,MaxTextExtent,
"<pattern id=\"%s\" x=\"%g\" y=\"%g\" width=\"%g\" "
"height=\"%g\">\n",name,svg_info.bounds.x,svg_info.bounds.y,
@@ -3929,11 +3930,11 @@
if (LocaleCompare("scale",keyword) == 0)
{
GetMagickToken(q,&q,token);
- affine.sx=atof(token);
+ affine.sx=StringToDouble(token);
GetMagickToken(q,&q,token);
if (*token == ',')
GetMagickToken(q,&q,token);
- affine.sy=atof(token);
+ affine.sy=StringToDouble(token);
break;
}
if (LocaleCompare("skewX",keyword) == 0)
@@ -4084,11 +4085,11 @@
if (LocaleCompare("translate",keyword) == 0)
{
GetMagickToken(q,&q,token);
- affine.tx=atof(token);
+ affine.tx=StringToDouble(token);
GetMagickToken(q,&q,token);
if (*token == ',')
GetMagickToken(q,&q,token);
- affine.ty=atof(token);
+ affine.ty=StringToDouble(token);
break;
}
status=MagickFalse;
@@ -4137,11 +4138,11 @@
if (IsPoint(q) == MagickFalse)
break;
GetMagickToken(q,&q,token);
- point.x=atof(token);
+ point.x=StringToDouble(token);
GetMagickToken(q,&q,token);
if (*token == ',')
GetMagickToken(q,&q,token);
- point.y=atof(token);
+ point.y=StringToDouble(token);
GetMagickToken(q,(const char **) NULL,token);
if (*token == ',')
GetMagickToken(q,&q,token);
diff --git a/coders/thumbnail.c b/coders/thumbnail.c
index 7f42a7f..e19a026 100644
--- a/coders/thumbnail.c
+++ b/coders/thumbnail.c
@@ -47,6 +47,7 @@
#include "magick/exception-private.h"
#include "magick/magick.h"
#include "magick/memory_.h"
+#include "magick/module.h"
#include "magick/monitor.h"
#include "magick/monitor-private.h"
#include "magick/profile.h"
@@ -54,7 +55,7 @@
#include "magick/quantum-private.h"
#include "magick/static.h"
#include "magick/string_.h"
-#include "magick/module.h"
+#include "magick/string-private.h"
/*
Forward declarations.
@@ -183,11 +184,11 @@
property=GetImageProperty(image,"exif:JPEGInterchangeFormat");
if (property == (const char *) NULL)
ThrowWriterException(CoderError,"ImageDoesNotHaveAThumbnail");
- offset=(ssize_t) atoi(property);
+ offset=(ssize_t) StringToLong(property);
property=GetImageProperty(image,"exif:JPEGInterchangeFormatLength");
if (property == (const char *) NULL)
ThrowWriterException(CoderError,"ImageDoesNotHaveAThumbnail");
- length=(size_t) atoi(property);
+ length=(size_t) StringToLong(property);
(void) ResetMagickMemory(magick,0,sizeof(magick));
for (i=0; i < (long) length; i++)
{
diff --git a/coders/tiff.c b/coders/tiff.c
index cab09db..783db7d 100644
--- a/coders/tiff.c
+++ b/coders/tiff.c
@@ -73,9 +73,9 @@
#include "magick/static.h"
#include "magick/statistic.h"
#include "magick/string_.h"
+#include "magick/string-private.h"
#include "magick/thread_.h"
#include "magick/utility.h"
-#include "magick/module.h"
#if defined(MAGICKCORE_TIFF_DELEGATE)
# if defined(MAGICKCORE_HAVE_TIFFCONF_H)
# include "tiffconf.h"
@@ -2323,7 +2323,7 @@
uint16
shorty;
- shorty=(uint16) atoi(value);
+ shorty=(uint16) StringToLong(value);
(void) TIFFSetField(tiff,exif_info[i].tag,shorty);
break;
}
@@ -2332,7 +2332,7 @@
uint16
longy;
- longy=(uint16) atol(value);
+ longy=(uint16) StringToLong(value);
(void) TIFFSetField(tiff,exif_info[i].tag,longy);
break;
}
@@ -2342,7 +2342,7 @@
float
rational;
- rational=atof(value);
+ rational=StringToDouble(value);
(void) TIFFSetField(tiff,exif_info[i].tag,rational);
break;
}
diff --git a/coders/vicar.c b/coders/vicar.c
index 30e17d7..60db5f1 100644
--- a/coders/vicar.c
+++ b/coders/vicar.c
@@ -52,13 +52,14 @@
#include "magick/list.h"
#include "magick/magick.h"
#include "magick/memory_.h"
+#include "magick/module.h"
#include "magick/monitor.h"
#include "magick/monitor-private.h"
#include "magick/quantum-private.h"
#include "magick/quantum-private.h"
#include "magick/static.h"
#include "magick/string_.h"
-#include "magick/module.h"
+#include "magick/string-private.h"
/*
Forward declarations.
@@ -253,17 +254,17 @@
Assign a value to the specified keyword.
*/
if (LocaleCompare(keyword,"Label_RECORDS") == 0)
- length=(ssize_t) atol(value);
+ length=(ssize_t) StringToLong(value);
if (LocaleCompare(keyword,"LBLSIZE") == 0)
- length=(ssize_t) atol(value);
+ length=(ssize_t) StringToLong(value);
if (LocaleCompare(keyword,"RECORD_BYTES") == 0)
- image->columns=1UL*atol(value);
+ image->columns=1UL*StringToLong(value);
if (LocaleCompare(keyword,"NS") == 0)
- image->columns=1UL*atol(value);
+ image->columns=1UL*StringToLong(value);
if (LocaleCompare(keyword,"LINES") == 0)
- image->rows=1UL*atol(value);
+ image->rows=1UL*StringToLong(value);
if (LocaleCompare(keyword,"NL") == 0)
- image->rows=1UL*atol(value);
+ image->rows=1UL*StringToLong(value);
}
while (isspace((int) ((unsigned char) c)) != 0)
{
diff --git a/config/configure.xml b/config/configure.xml
index 8138267..7744ee9 100644
--- a/config/configure.xml
+++ b/config/configure.xml
@@ -9,7 +9,7 @@
<configure name="NAME" value="ImageMagick"/>
<configure name="LIB_VERSION" value="0x658"/>
<configure name="LIB_VERSION_NUMBER" value="6,5,8,7"/>
- <configure name="RELEASE_DATE" value="2009-12-15"/>
+ <configure name="RELEASE_DATE" value="2009-12-17"/>
<configure name="CONFIGURE" value="./configure "/>
<configure name="PREFIX" value="/usr/local"/>
<configure name="EXEC-PREFIX" value="/usr/local"/>
diff --git a/magick/Makefile.am b/magick/Makefile.am
index a6e369d..3fe934a 100644
--- a/magick/Makefile.am
+++ b/magick/Makefile.am
@@ -228,6 +228,7 @@
magick/stream-private.h \
magick/string.c \
magick/string_.h \
+ magick/string-private.h \
magick/studio.h \
magick/thread.c \
magick/thread_.h \
@@ -387,6 +388,7 @@
magick/signature-private.h \
magick/static.h \
magick/stream-private.h \
+ magick/string-private.h \
magick/studio.h \
magick/thread_.h \
magick/thread-private.h \
diff --git a/magick/animate.c b/magick/animate.c
index 031d7ea..1b12255 100644
--- a/magick/animate.c
+++ b/magick/animate.c
@@ -63,6 +63,7 @@
#include "magick/property.h"
#include "magick/resource_.h"
#include "magick/string_.h"
+#include "magick/string-private.h"
#include "magick/transform.h"
#include "magick/utility.h"
#include "magick/version.h"
@@ -2949,7 +2950,7 @@
quality);
if (*quality == '\0')
return(MagickTrue);
- image->quality=(unsigned long) atol(quality);
+ image->quality=(unsigned long) StringToLong(quality);
image_info->interlace=status != MagickFalse ? NoInterlace :
PlaneInterlace;
}
diff --git a/magick/blob.c b/magick/blob.c
index 3d60657..7f9e36f 100644
--- a/magick/blob.c
+++ b/magick/blob.c
@@ -58,6 +58,7 @@
#include "magick/resource_.h"
#include "magick/semaphore.h"
#include "magick/string_.h"
+#include "magick/string-private.h"
#include "magick/utility.h"
#if defined(MAGICKCORE_HAVE_MMAP_FILEIO) && !defined(__WINDOWS__)
# include <sys/mman.h>
@@ -2269,7 +2270,7 @@
*mode=(*type);
mode[1]='\0';
- image->blob->file=fdopen(atoi(filename+3),mode);
+ image->blob->file=fdopen(StringToLong(filename+3),mode);
#if defined(__WINDOWS__) || defined(__OS2__)
if (strchr(type,'b') != (char *) NULL)
setmode(_fileno(image->blob->file),_O_BINARY);
diff --git a/magick/colorspace.c b/magick/colorspace.c
index 667b9d8..71925a7 100644
--- a/magick/colorspace.c
+++ b/magick/colorspace.c
@@ -60,6 +60,7 @@
#include "magick/quantize.h"
#include "magick/quantum.h"
#include "magick/string_.h"
+#include "magick/string-private.h"
#include "magick/utility.h"
/*
@@ -577,15 +578,15 @@
gamma=DisplayGamma;
value=GetImageProperty(image,"gamma");
if (value != (const char *) NULL)
- gamma=1.0/atof(value) != 0.0 ? atof(value) : 1.0;
+ gamma=1.0/StringToDouble(value) != 0.0 ? StringToDouble(value) : 1.0;
reference_black=ReferenceBlack;
value=GetImageProperty(image,"reference-black");
if (value != (const char *) NULL)
- reference_black=atof(value);
+ reference_black=StringToDouble(value);
reference_white=ReferenceWhite;
value=GetImageProperty(image,"reference-white");
if (value != (const char *) NULL)
- reference_white=atof(value);
+ reference_white=StringToDouble(value);
logmap=(Quantum *) AcquireQuantumMemory((size_t) MaxMap+1UL,
sizeof(*logmap));
if (logmap == (Quantum *) NULL)
@@ -1783,15 +1784,15 @@
gamma=DisplayGamma;
value=GetImageProperty(image,"gamma");
if (value != (const char *) NULL)
- gamma=1.0/atof(value) != 0.0 ? atof(value) : 1.0;
+ gamma=1.0/StringToDouble(value) != 0.0 ? StringToDouble(value) : 1.0;
reference_black=ReferenceBlack;
value=GetImageProperty(image,"reference-black");
if (value != (const char *) NULL)
- reference_black=atof(value);
+ reference_black=StringToDouble(value);
reference_white=ReferenceWhite;
value=GetImageProperty(image,"reference-white");
if (value != (const char *) NULL)
- reference_white=atof(value);
+ reference_white=StringToDouble(value);
logmap=(Quantum *) AcquireQuantumMemory((size_t) MaxMap+1UL,
sizeof(*logmap));
if (logmap == (Quantum *) NULL)
diff --git a/magick/constitute.c b/magick/constitute.c
index ed8b3fa..3abe5c4 100644
--- a/magick/constitute.c
+++ b/magick/constitute.c
@@ -67,6 +67,7 @@
#include "magick/statistic.h"
#include "magick/stream.h"
#include "magick/string_.h"
+#include "magick/string-private.h"
#include "magick/timer.h"
#include "magick/transform.h"
#include "magick/utility.h"
@@ -644,7 +645,7 @@
value=GetImageProperty(next,"exif:Orientation");
if (value != (char *) NULL)
{
- next->orientation=(OrientationType) atol(value);
+ next->orientation=(OrientationType) StringToLong(value);
(void) DeleteImageProperty(next,"tiff:Orientation");
(void) DeleteImageProperty(next,"exif:Orientation");
}
@@ -679,7 +680,7 @@
value=GetImageProperty(next,"exif:ResolutionUnit");
if (value != (char *) NULL)
{
- next->units=(ResolutionType) (atoi(value)-1);
+ next->units=(ResolutionType) (StringToLong(value)-1);
(void) DeleteImageProperty(next,"exif:ResolutionUnit");
(void) DeleteImageProperty(next,"tiff:ResolutionUnit");
}
diff --git a/magick/display.c b/magick/display.c
index 7bb0463..5e1239e 100644
--- a/magick/display.c
+++ b/magick/display.c
@@ -80,6 +80,7 @@
#include "magick/shear.h"
#include "magick/segment.h"
#include "magick/string_.h"
+#include "magick/string-private.h"
#include "magick/transform.h"
#include "magick/threshold.h"
#include "magick/utility.h"
@@ -2098,14 +2099,14 @@
break;
if (entry != 8)
{
- degrees=atof(RotateMenu[entry]);
+ degrees=StringToDouble(RotateMenu[entry]);
break;
}
(void) XDialogWidget(display,windows,"OK","Enter rotation angle:",
angle);
if (*angle == '\0')
break;
- degrees=atof(angle);
+ degrees=StringToDouble(angle);
break;
}
case AnnotateHelpCommand:
@@ -3503,7 +3504,7 @@
break;
if (entry != 5)
{
- (*image)->fuzz=StringToDouble(FuzzMenu[entry],1.0*QuantumRange+
+ (*image)->fuzz=SiPrefixToDouble(FuzzMenu[entry],1.0*QuantumRange+
1.0);
break;
}
@@ -3513,7 +3514,7 @@
if (*fuzz == '\0')
break;
(void) ConcatenateMagickString(fuzz,"%",MaxTextExtent);
- (*image)->fuzz=StringToDouble(fuzz,1.0*QuantumRange+1.0);
+ (*image)->fuzz=SiPrefixToDouble(fuzz,1.0*QuantumRange+1.0);
break;
}
case ColorEditUndoCommand:
@@ -4026,7 +4027,7 @@
GXinvert);
if (*factor == '\0')
break;
- blend=atof(factor);
+ blend=StringToDouble(factor);
compose=DissolveCompositeOp;
break;
}
@@ -5711,14 +5712,14 @@
break;
if (entry != 5)
{
- line_width=(unsigned int) atoi(WidthsMenu[entry]);
+ line_width=(unsigned int) StringToLong(WidthsMenu[entry]);
break;
}
(void) XDialogWidget(display,windows,"Ok","Enter line width:",
width);
if (*width == '\0')
break;
- line_width=(unsigned int) atoi(width);
+ line_width=(unsigned int) StringToLong(width);
break;
}
case DrawUndoCommand:
@@ -6641,7 +6642,7 @@
last_symbol=key_symbol;
delta[strlen(delta)+1]='\0';
delta[strlen(delta)]=Digits[key_symbol-XK_0];
- resource_info->quantum=atoi(delta);
+ resource_info->quantum=StringToLong(delta);
return(NullCommand);
}
last_symbol=key_symbol;
@@ -7604,7 +7605,7 @@
(void) XDialogWidget(display,windows,"Trim","Enter fuzz factor:",fuzz);
if (*fuzz == '\0')
break;
- (*image)->fuzz=StringToDouble(fuzz,(double) QuantumRange+1.0);
+ (*image)->fuzz=SiPrefixToDouble(fuzz,(double) QuantumRange+1.0);
/*
Trim image.
*/
@@ -7934,7 +7935,7 @@
*/
XSetCursorState(display,windows,MagickTrue);
XCheckRefreshWindows(display,windows);
- quantize_info.number_colors=(unsigned long) atol(colors);
+ quantize_info.number_colors=(unsigned long) StringToLong(colors);
quantize_info.dither=status != 0 ? MagickTrue : MagickFalse;
(void) QuantizeImage(&quantize_info,*image);
XSetCursorState(display,windows,MagickFalse);
@@ -8174,7 +8175,7 @@
*/
XSetCursorState(display,windows,MagickTrue);
XCheckRefreshWindows(display,windows);
- threshold=StringToDouble(factor,QuantumRange);
+ threshold=SiPrefixToDouble(factor,QuantumRange);
(void) BilevelImage(*image,threshold);
XSetCursorState(display,windows,MagickFalse);
if (windows->image.orphan != MagickFalse)
@@ -8373,7 +8374,7 @@
*/
XSetCursorState(display,windows,MagickTrue);
XCheckRefreshWindows(display,windows);
- threshold=StringToDouble(factor,QuantumRange);
+ threshold=SiPrefixToDouble(factor,QuantumRange);
sepia_image=SepiaToneImage(*image,threshold,&(*image)->exception);
if (sepia_image != (Image *) NULL)
{
@@ -8408,7 +8409,7 @@
*/
XSetCursorState(display,windows,MagickTrue);
XCheckRefreshWindows(display,windows);
- threshold=StringToDouble(factor,QuantumRange);
+ threshold=SiPrefixToDouble(factor,QuantumRange);
(void) SolarizeImage(*image,threshold);
XSetCursorState(display,windows,MagickFalse);
if (windows->image.orphan != MagickFalse)
@@ -9076,7 +9077,7 @@
"Pause how many 1/100ths of a second between images:",delay);
if (*delay == '\0')
break;
- resource_info->delay=(unsigned long) atol(delay);
+ resource_info->delay=(unsigned long) StringToLong(delay);
XClientMessage(display,windows->image.id,windows->im_protocols,
windows->im_next_image,CurrentTime);
break;
@@ -9704,7 +9705,7 @@
break;
if (entry != 5)
{
- (*image)->fuzz=StringToDouble(FuzzMenu[entry],1.0*QuantumRange+
+ (*image)->fuzz=SiPrefixToDouble(FuzzMenu[entry],1.0*QuantumRange+
1.0);
break;
}
@@ -9714,7 +9715,7 @@
if (*fuzz == '\0')
break;
(void) ConcatenateMagickString(fuzz,"%",MaxTextExtent);
- (*image)->fuzz=StringToDouble(fuzz,1.0*QuantumRange+1.0);
+ (*image)->fuzz=SiPrefixToDouble(fuzz,1.0*QuantumRange+1.0);
break;
}
case MatteEditValueCommand:
@@ -9948,7 +9949,7 @@
q=GetAuthenticPixels(*image,x_offset,y_offset,1,1,exception);
if (q == (PixelPacket *) NULL)
break;
- q->opacity=(Quantum) atol(matte);
+ q->opacity=(Quantum) StringToLong(matte);
(void) SyncAuthenticPixels(*image,exception);
break;
}
@@ -9971,7 +9972,7 @@
for (x=0; x < (int) (*image)->columns; x++)
{
if (IsColorSimilar(*image,q,&target))
- q->opacity=(Quantum) atol(matte);
+ q->opacity=(Quantum) StringToLong(matte);
q++;
}
if (SyncAuthenticPixels(*image,exception) == MagickFalse)
@@ -10004,7 +10005,7 @@
}
draw_info=CloneDrawInfo(resource_info->image_info,
(DrawInfo *) NULL);
- draw_info->fill.opacity=RoundToQuantum(atof(matte));
+ draw_info->fill.opacity=RoundToQuantum(StringToDouble(matte));
(void) FloodfillPaintImage(*image,OpacityChannel,draw_info,&target,
x_offset,y_offset,method == FloodfillMethod ? MagickFalse :
MagickTrue);
@@ -10025,13 +10026,13 @@
break;
for (x=0; x < (int) (*image)->columns; x++)
{
- q->opacity=(Quantum) atol(matte);
+ q->opacity=(Quantum) StringToLong(matte);
q++;
}
if (SyncAuthenticPixels(*image,exception) == MagickFalse)
break;
}
- if (atol(matte) == OpaqueOpacity)
+ if (StringToLong(matte) == OpaqueOpacity)
(*image)->matte=MagickFalse;
break;
}
@@ -10162,7 +10163,7 @@
seconds);
if (*seconds == '\0')
return((Image *) NULL);
- XDelay(display,(unsigned long) (1000*atol(seconds)));
+ XDelay(display,(unsigned long) (1000*StringToLong(seconds)));
}
magick_info=GetMagickInfo(image_info->magick,exception);
if ((magick_info != (const MagickInfo *) NULL) &&
@@ -12396,7 +12397,7 @@
quality);
if (*quality == '\0')
return(MagickTrue);
- image->quality=(unsigned long) atol(quality);
+ image->quality=(unsigned long) StringToLong(quality);
image_info->interlace=status != 0 ? NoInterlace : PlaneInterlace;
}
if ((LocaleCompare(image_info->magick,"EPS") == 0) ||
diff --git a/magick/distort.c b/magick/distort.c
index 39c7e61..fe32840 100644
--- a/magick/distort.c
+++ b/magick/distort.c
@@ -63,6 +63,7 @@
#include "magick/registry.h"
#include "magick/semaphore.h"
#include "magick/string_.h"
+#include "magick/string-private.h"
#include "magick/thread-private.h"
#include "magick/token.h"
@@ -1883,7 +1884,7 @@
artifact=GetImageArtifact(image,"distort:scale");
output_scaling = 1.0;
if (artifact != (const char *) NULL) {
- output_scaling = fabs(atof(artifact));
+ output_scaling = fabs(StringToDouble(artifact));
geometry.width *= output_scaling;
geometry.height *= output_scaling;
geometry.x *= output_scaling;
diff --git a/magick/draw.c b/magick/draw.c
index 9458ea4..fb92e97 100644
--- a/magick/draw.c
+++ b/magick/draw.c
@@ -74,6 +74,7 @@
#include "magick/resample.h"
#include "magick/resample-private.h"
#include "magick/string_.h"
+#include "magick/string-private.h"
#include "magick/thread-private.h"
#include "magick/token.h"
#include "magick/transform.h"
@@ -1826,27 +1827,27 @@
if (LocaleCompare("affine",keyword) == 0)
{
GetMagickToken(q,&q,token);
- affine.sx=atof(token);
+ affine.sx=StringToDouble(token);
GetMagickToken(q,&q,token);
if (*token == ',')
GetMagickToken(q,&q,token);
- affine.rx=atof(token);
+ affine.rx=StringToDouble(token);
GetMagickToken(q,&q,token);
if (*token == ',')
GetMagickToken(q,&q,token);
- affine.ry=atof(token);
+ affine.ry=StringToDouble(token);
GetMagickToken(q,&q,token);
if (*token == ',')
GetMagickToken(q,&q,token);
- affine.sy=atof(token);
+ affine.sy=StringToDouble(token);
GetMagickToken(q,&q,token);
if (*token == ',')
GetMagickToken(q,&q,token);
- affine.tx=atof(token);
+ affine.tx=StringToDouble(token);
GetMagickToken(q,&q,token);
if (*token == ',')
GetMagickToken(q,&q,token);
- affine.ty=atof(token);
+ affine.ty=StringToDouble(token);
break;
}
if (LocaleCompare("arc",keyword) == 0)
@@ -2017,7 +2018,7 @@
GetMagickToken(q,&q,token);
factor=strchr(token,'%') != (char *) NULL ? 0.01 : 1.0;
graphic_context[n]->fill.opacity=RoundToQuantum((MagickRealType)
- QuantumRange*(1.0-factor*atof(token)));
+ QuantumRange*(1.0-factor*StringToDouble(token)));
break;
}
if (LocaleCompare("fill-rule",keyword) == 0)
@@ -2054,7 +2055,7 @@
if (LocaleCompare("font-size",keyword) == 0)
{
GetMagickToken(q,&q,token);
- graphic_context[n]->pointsize=atof(token);
+ graphic_context[n]->pointsize=StringToDouble(token);
break;
}
if (LocaleCompare("font-stretch",keyword) == 0)
@@ -2090,7 +2091,7 @@
if (LocaleCompare("font-weight",keyword) == 0)
{
GetMagickToken(q,&q,token);
- graphic_context[n]->weight=(unsigned long) atol(token);
+ graphic_context[n]->weight=(unsigned long) StringToLong(token);
if (LocaleCompare(token,"all") == 0)
graphic_context[n]->weight=0;
if (LocaleCompare(token,"bold") == 0)
@@ -2156,13 +2157,13 @@
if (LocaleCompare("interline-spacing",keyword) == 0)
{
GetMagickToken(q,&q,token);
- graphic_context[n]->interline_spacing=atof(token);
+ graphic_context[n]->interline_spacing=StringToDouble(token);
break;
}
if (LocaleCompare("interword-spacing",keyword) == 0)
{
GetMagickToken(q,&q,token);
- graphic_context[n]->interword_spacing=atof(token);
+ graphic_context[n]->interword_spacing=StringToDouble(token);
break;
}
status=MagickFalse;
@@ -2174,7 +2175,7 @@
if (LocaleCompare("kerning",keyword) == 0)
{
GetMagickToken(q,&q,token);
- graphic_context[n]->kerning=atof(token);
+ graphic_context[n]->kerning=StringToDouble(token);
break;
}
status=MagickFalse;
@@ -2216,7 +2217,7 @@
factor=strchr(token,'%') != (char *) NULL ? 0.01 : 1.0;
graphic_context[n]->opacity=RoundToQuantum((MagickRealType)
QuantumRange*(1.0-((1.0-QuantumScale*graphic_context[n]->opacity)*
- factor*atof(token))));
+ factor*StringToDouble(token))));
graphic_context[n]->fill.opacity=graphic_context[n]->opacity;
graphic_context[n]->stroke.opacity=graphic_context[n]->opacity;
break;
@@ -2322,29 +2323,29 @@
GetMagickToken(q,&q,token);
(void) CopyMagickString(type,token,MaxTextExtent);
GetMagickToken(q,&q,token);
- segment.x1=atof(token);
- element.cx=atof(token);
+ segment.x1=StringToDouble(token);
+ element.cx=StringToDouble(token);
GetMagickToken(q,&q,token);
if (*token == ',')
GetMagickToken(q,&q,token);
- segment.y1=atof(token);
- element.cy=atof(token);
+ segment.y1=StringToDouble(token);
+ element.cy=StringToDouble(token);
GetMagickToken(q,&q,token);
if (*token == ',')
GetMagickToken(q,&q,token);
- segment.x2=atof(token);
- element.major=atof(token);
+ segment.x2=StringToDouble(token);
+ element.major=StringToDouble(token);
GetMagickToken(q,&q,token);
if (*token == ',')
GetMagickToken(q,&q,token);
- segment.y2=atof(token);
- element.minor=atof(token);
+ segment.y2=StringToDouble(token);
+ element.minor=StringToDouble(token);
if (LocaleCompare(type,"radial") == 0)
{
GetMagickToken(q,&q,token);
if (*token == ',')
GetMagickToken(q,&q,token);
- element.angle=atof(token);
+ element.angle=StringToDouble(token);
}
for (p=q; *q != '\0'; )
{
@@ -2388,19 +2389,19 @@
GetMagickToken(q,&q,token);
(void) CopyMagickString(name,token,MaxTextExtent);
GetMagickToken(q,&q,token);
- bounds.x=(long) (atof(token)+0.5);
+ bounds.x=(long) (StringToDouble(token)+0.5);
GetMagickToken(q,&q,token);
if (*token == ',')
GetMagickToken(q,&q,token);
- bounds.y=(long) (atof(token)+0.5);
+ bounds.y=(long) (StringToDouble(token)+0.5);
GetMagickToken(q,&q,token);
if (*token == ',')
GetMagickToken(q,&q,token);
- bounds.width=(unsigned long) (atof(token)+0.5);
+ bounds.width=(unsigned long) (StringToDouble(token)+0.5);
GetMagickToken(q,&q,token);
if (*token == ',')
GetMagickToken(q,&q,token);
- bounds.height=(unsigned long) (atof(token)+0.5);
+ bounds.height=(unsigned long) (StringToDouble(token)+0.5);
for (p=q; *q != '\0'; )
{
GetMagickToken(q,&q,token);
@@ -2457,7 +2458,7 @@
if (LocaleCompare("rotate",keyword) == 0)
{
GetMagickToken(q,&q,token);
- angle=atof(token);
+ angle=StringToDouble(token);
affine.sx=cos(DegreesToRadians(fmod((double) angle,360.0)));
affine.rx=sin(DegreesToRadians(fmod((double) angle,360.0)));
affine.ry=(-sin(DegreesToRadians(fmod((double) angle,360.0))));
@@ -2478,24 +2479,24 @@
if (LocaleCompare("scale",keyword) == 0)
{
GetMagickToken(q,&q,token);
- affine.sx=atof(token);
+ affine.sx=StringToDouble(token);
GetMagickToken(q,&q,token);
if (*token == ',')
GetMagickToken(q,&q,token);
- affine.sy=atof(token);
+ affine.sy=StringToDouble(token);
break;
}
if (LocaleCompare("skewX",keyword) == 0)
{
GetMagickToken(q,&q,token);
- angle=atof(token);
+ angle=StringToDouble(token);
affine.ry=sin(DegreesToRadians(angle));
break;
}
if (LocaleCompare("skewY",keyword) == 0)
{
GetMagickToken(q,&q,token);
- angle=atof(token);
+ angle=StringToDouble(token);
affine.rx=(-tan(DegreesToRadians(angle)/2.0));
break;
}
@@ -2543,7 +2544,7 @@
{
GetMagickToken(q,&q,token);
graphic_context[n]->stroke_antialias=
- atoi(token) != 0 ? MagickTrue : MagickFalse;
+ StringToLong(token) != 0 ? MagickTrue : MagickFalse;
break;
}
if (LocaleCompare("stroke-dasharray",keyword) == 0)
@@ -2581,7 +2582,7 @@
GetMagickToken(q,&q,token);
if (*token == ',')
GetMagickToken(q,&q,token);
- graphic_context[n]->dash_pattern[j]=atof(token);
+ graphic_context[n]->dash_pattern[j]=StringToDouble(token);
}
if ((x & 0x01) != 0)
for ( ; j < (2*x); j++)
@@ -2596,7 +2597,7 @@
if (LocaleCompare("stroke-dashoffset",keyword) == 0)
{
GetMagickToken(q,&q,token);
- graphic_context[n]->dash_offset=atof(token);
+ graphic_context[n]->dash_offset=StringToDouble(token);
break;
}
if (LocaleCompare("stroke-linecap",keyword) == 0)
@@ -2632,7 +2633,7 @@
if (LocaleCompare("stroke-miterlimit",keyword) == 0)
{
GetMagickToken(q,&q,token);
- graphic_context[n]->miterlimit=(unsigned long) atol(token);
+ graphic_context[n]->miterlimit=(unsigned long) StringToLong(token);
break;
}
if (LocaleCompare("stroke-opacity",keyword) == 0)
@@ -2640,13 +2641,13 @@
GetMagickToken(q,&q,token);
factor=strchr(token,'%') != (char *) NULL ? 0.01 : 1.0;
graphic_context[n]->stroke.opacity=RoundToQuantum((MagickRealType)
- QuantumRange*(1.0-factor*atof(token)));
+ QuantumRange*(1.0-factor*StringToDouble(token)));
break;
}
if (LocaleCompare("stroke-width",keyword) == 0)
{
GetMagickToken(q,&q,token);
- graphic_context[n]->stroke_width=atof(token);
+ graphic_context[n]->stroke_width=StringToDouble(token);
break;
}
status=MagickFalse;
@@ -2694,7 +2695,7 @@
{
GetMagickToken(q,&q,token);
graphic_context[n]->text_antialias=
- atoi(token) != 0 ? MagickTrue : MagickFalse;
+ StringToLong(token) != 0 ? MagickTrue : MagickFalse;
break;
}
if (LocaleCompare("text-undercolor",keyword) == 0)
@@ -2707,11 +2708,11 @@
if (LocaleCompare("translate",keyword) == 0)
{
GetMagickToken(q,&q,token);
- affine.tx=atof(token);
+ affine.tx=StringToDouble(token);
GetMagickToken(q,&q,token);
if (*token == ',')
GetMagickToken(q,&q,token);
- affine.ty=atof(token);
+ affine.ty=StringToDouble(token);
break;
}
status=MagickFalse;
@@ -2723,19 +2724,19 @@
if (LocaleCompare("viewbox",keyword) == 0)
{
GetMagickToken(q,&q,token);
- graphic_context[n]->viewbox.x=(long) (atof(token)+0.5);
+ graphic_context[n]->viewbox.x=(long) (StringToDouble(token)+0.5);
GetMagickToken(q,&q,token);
if (*token == ',')
GetMagickToken(q,&q,token);
- graphic_context[n]->viewbox.y=(long) (atof(token)+0.5);
+ graphic_context[n]->viewbox.y=(long) (StringToDouble(token)+0.5);
GetMagickToken(q,&q,token);
if (*token == ',')
GetMagickToken(q,&q,token);
- graphic_context[n]->viewbox.width=(unsigned long) (atof(token)+0.5);
+ graphic_context[n]->viewbox.width=(unsigned long) (StringToDouble(token)+0.5);
GetMagickToken(q,&q,token);
if (*token == ',')
GetMagickToken(q,&q,token);
- graphic_context[n]->viewbox.height=(unsigned long) (atof(token)+
+ graphic_context[n]->viewbox.height=(unsigned long) (StringToDouble(token)+
0.5);
break;
}
@@ -2784,11 +2785,11 @@
if (IsPoint(q) == MagickFalse)
break;
GetMagickToken(q,&q,token);
- point.x=atof(token);
+ point.x=StringToDouble(token);
GetMagickToken(q,&q,token);
if (*token == ',')
GetMagickToken(q,&q,token);
- point.y=atof(token);
+ point.y=StringToDouble(token);
GetMagickToken(q,(const char **) NULL,token);
if (*token == ',')
GetMagickToken(q,&q,token);
@@ -4763,13 +4764,13 @@
(void) CloneString(&draw_info->encoding,option);
option=GetImageOption(clone_info,"kerning");
if (option != (const char *) NULL)
- draw_info->kerning=atof(option);
+ draw_info->kerning=StringToDouble(option);
option=GetImageOption(clone_info,"interline-spacing");
if (option != (const char *) NULL)
- draw_info->interline_spacing=atof(option);
+ draw_info->interline_spacing=StringToDouble(option);
option=GetImageOption(clone_info,"interword-spacing");
if (option != (const char *) NULL)
- draw_info->interword_spacing=atof(option);
+ draw_info->interword_spacing=StringToDouble(option);
option=GetImageOption(clone_info,"fill");
if (option != (const char *) NULL)
(void) QueryColorDatabase(option,&draw_info->fill,exception);
@@ -4778,7 +4779,7 @@
(void) QueryColorDatabase(option,&draw_info->stroke,exception);
option=GetImageOption(clone_info,"strokewidth");
if (option != (const char *) NULL)
- draw_info->stroke_width=atof(option);
+ draw_info->stroke_width=StringToDouble(option);
option=GetImageOption(clone_info,"undercolor");
if (option != (const char *) NULL)
(void) QueryColorDatabase(option,&draw_info->undercolor,exception);
@@ -5255,31 +5256,31 @@
GetMagickToken(p,&p,token);
if (*token == ',')
GetMagickToken(p,&p,token);
- arc.x=atof(token);
+ arc.x=StringToDouble(token);
GetMagickToken(p,&p,token);
if (*token == ',')
GetMagickToken(p,&p,token);
- arc.y=atof(token);
+ arc.y=StringToDouble(token);
GetMagickToken(p,&p,token);
if (*token == ',')
GetMagickToken(p,&p,token);
- angle=atof(token);
+ angle=StringToDouble(token);
GetMagickToken(p,&p,token);
if (*token == ',')
GetMagickToken(p,&p,token);
- large_arc=atoi(token) != 0 ? MagickTrue : MagickFalse;
+ large_arc=StringToLong(token) != 0 ? MagickTrue : MagickFalse;
GetMagickToken(p,&p,token);
if (*token == ',')
GetMagickToken(p,&p,token);
- sweep=atoi(token) != 0 ? MagickTrue : MagickFalse;
+ sweep=StringToLong(token) != 0 ? MagickTrue : MagickFalse;
GetMagickToken(p,&p,token);
if (*token == ',')
GetMagickToken(p,&p,token);
- x=atof(token);
+ x=StringToDouble(token);
GetMagickToken(p,&p,token);
if (*token == ',')
GetMagickToken(p,&p,token);
- y=atof(token);
+ y=StringToDouble(token);
end.x=(double) (attribute == (int) 'A' ? x : point.x+x);
end.y=(double) (attribute == (int) 'A' ? y : point.y+y);
TraceArcPath(q,point,end,arc,angle,large_arc,sweep);
@@ -5302,11 +5303,11 @@
GetMagickToken(p,&p,token);
if (*token == ',')
GetMagickToken(p,&p,token);
- x=atof(token);
+ x=StringToDouble(token);
GetMagickToken(p,&p,token);
if (*token == ',')
GetMagickToken(p,&p,token);
- y=atof(token);
+ y=StringToDouble(token);
end.x=(double) (attribute == (int) 'C' ? x : point.x+x);
end.y=(double) (attribute == (int) 'C' ? y : point.y+y);
points[i]=end;
@@ -5327,7 +5328,7 @@
GetMagickToken(p,&p,token);
if (*token == ',')
GetMagickToken(p,&p,token);
- x=atof(token);
+ x=StringToDouble(token);
point.x=(double) (attribute == (int) 'H' ? x: point.x+x);
TracePoint(q,point);
q+=q->coordinates;
@@ -5342,11 +5343,11 @@
GetMagickToken(p,&p,token);
if (*token == ',')
GetMagickToken(p,&p,token);
- x=atof(token);
+ x=StringToDouble(token);
GetMagickToken(p,&p,token);
if (*token == ',')
GetMagickToken(p,&p,token);
- y=atof(token);
+ y=StringToDouble(token);
point.x=(double) (attribute == (int) 'L' ? x : point.x+x);
point.y=(double) (attribute == (int) 'L' ? y : point.y+y);
TracePoint(q,point);
@@ -5369,11 +5370,11 @@
GetMagickToken(p,&p,token);
if (*token == ',')
GetMagickToken(p,&p,token);
- x=atof(token);
+ x=StringToDouble(token);
GetMagickToken(p,&p,token);
if (*token == ',')
GetMagickToken(p,&p,token);
- y=atof(token);
+ y=StringToDouble(token);
point.x=(double) (attribute == (int) 'M' ? x : point.x+x);
point.y=(double) (attribute == (int) 'M' ? y : point.y+y);
if (i == 0)
@@ -5403,11 +5404,11 @@
GetMagickToken(p,&p,token);
if (*token == ',')
GetMagickToken(p,&p,token);
- x=atof(token);
+ x=StringToDouble(token);
GetMagickToken(p,&p,token);
if (*token == ',')
GetMagickToken(p,&p,token);
- y=atof(token);
+ y=StringToDouble(token);
if (*p == ',')
p++;
end.x=(double) (attribute == (int) 'Q' ? x : point.x+x);
@@ -5438,11 +5439,11 @@
GetMagickToken(p,&p,token);
if (*token == ',')
GetMagickToken(p,&p,token);
- x=atof(token);
+ x=StringToDouble(token);
GetMagickToken(p,&p,token);
if (*token == ',')
GetMagickToken(p,&p,token);
- y=atof(token);
+ y=StringToDouble(token);
if (*p == ',')
p++;
end.x=(double) (attribute == (int) 'S' ? x : point.x+x);
@@ -5478,11 +5479,11 @@
GetMagickToken(p,&p,token);
if (*token == ',')
GetMagickToken(p,&p,token);
- x=atof(token);
+ x=StringToDouble(token);
GetMagickToken(p,&p,token);
if (*token == ',')
GetMagickToken(p,&p,token);
- y=atof(token);
+ y=StringToDouble(token);
end.x=(double) (attribute == (int) 'T' ? x : point.x+x);
end.y=(double) (attribute == (int) 'T' ? y : point.y+y);
points[i]=end;
@@ -5508,7 +5509,7 @@
GetMagickToken(p,&p,token);
if (*token == ',')
GetMagickToken(p,&p,token);
- y=atof(token);
+ y=StringToDouble(token);
point.y=(double) (attribute == (int) 'V' ? y : point.y+y);
TracePoint(q,point);
q+=q->coordinates;
diff --git a/magick/enhance.c b/magick/enhance.c
index 4009edd..ef143ae 100644
--- a/magick/enhance.c
+++ b/magick/enhance.c
@@ -66,6 +66,7 @@
#include "magick/resample-private.h"
#include "magick/statistic.h"
#include "magick/string_.h"
+#include "magick/string-private.h"
#include "magick/thread-private.h"
#include "magick/token.h"
#include "magick/xml-tree.h"
@@ -371,9 +372,9 @@
GetMagickToken(p,&p,token);
switch (i)
{
- case 0: color_correction.red.slope=atof(token); break;
- case 1: color_correction.green.slope=atof(token); break;
- case 2: color_correction.blue.slope=atof(token); break;
+ case 0: color_correction.red.slope=StringToDouble(token); break;
+ case 1: color_correction.green.slope=StringToDouble(token); break;
+ case 2: color_correction.blue.slope=StringToDouble(token); break;
}
}
}
@@ -389,9 +390,9 @@
GetMagickToken(p,&p,token);
switch (i)
{
- case 0: color_correction.red.offset=atof(token); break;
- case 1: color_correction.green.offset=atof(token); break;
- case 2: color_correction.blue.offset=atof(token); break;
+ case 0: color_correction.red.offset=StringToDouble(token); break;
+ case 1: color_correction.green.offset=StringToDouble(token); break;
+ case 2: color_correction.blue.offset=StringToDouble(token); break;
}
}
}
@@ -407,9 +408,9 @@
GetMagickToken(p,&p,token);
switch (i)
{
- case 0: color_correction.red.power=atof(token); break;
- case 1: color_correction.green.power=atof(token); break;
- case 2: color_correction.blue.power=atof(token); break;
+ case 0: color_correction.red.power=StringToDouble(token); break;
+ case 1: color_correction.green.power=StringToDouble(token); break;
+ case 2: color_correction.blue.power=StringToDouble(token); break;
}
}
}
@@ -426,7 +427,7 @@
content=GetXMLTreeContent(saturation);
p=(const char *) content;
GetMagickToken(p,&p,token);
- color_correction.saturation=atof(token);
+ color_correction.saturation=StringToDouble(token);
}
}
ccc=DestroyXMLTree(ccc);
diff --git a/magick/fx.c b/magick/fx.c
index 4cf1778..3dcc822 100644
--- a/magick/fx.c
+++ b/magick/fx.c
@@ -80,6 +80,7 @@
#include "magick/splay-tree.h"
#include "magick/statistic.h"
#include "magick/string_.h"
+#include "magick/string-private.h"
#include "magick/thread-private.h"
#include "magick/transform.h"
#include "magick/utility.h"
@@ -327,7 +328,7 @@
attenuate=1.0;
option=GetImageArtifact(image,"attenuate");
if (option != (char *) NULL)
- attenuate=atof(option);
+ attenuate=StringToDouble(option);
status=MagickTrue;
progress=0;
random_info=AcquireRandomInfoThreadSet();
@@ -1474,7 +1475,7 @@
symbol);
value=(const char *) GetValueFromSplayTree(fx_info->symbols,key);
if (value != (const char *) NULL)
- return(QuantumScale*atof(value));
+ return(QuantumScale*StringToDouble(value));
(void) DeleteNodeFromSplayTree(fx_info->symbols,key);
if (LocaleNCompare(symbol,"depth",5) == 0)
{
@@ -1545,7 +1546,7 @@
}
(void) AddValueToSplayTree(fx_info->symbols,ConstantString(key),
ConstantString(statistic));
- return(QuantumScale*atof(statistic));
+ return(QuantumScale*StringToDouble(statistic));
}
static MagickRealType
@@ -2147,7 +2148,7 @@
}
value=(const char *) GetValueFromSplayTree(fx_info->symbols,symbol);
if (value != (const char *) NULL)
- return((MagickRealType) atof(value));
+ return((MagickRealType) StringToDouble(value));
(void) ThrowMagickException(exception,GetMagickModule(),OptionError,
"UnableToParseExpression","`%s'",symbol);
return(0.0);
diff --git a/magick/geometry.c b/magick/geometry.c
index 549c618..0f9a16c 100644
--- a/magick/geometry.c
+++ b/magick/geometry.c
@@ -47,6 +47,7 @@
#include "magick/geometry.h"
#include "magick/memory_.h"
#include "magick/string_.h"
+#include "magick/string-private.h"
#include "magick/token.h"
/*
@@ -655,12 +656,12 @@
GetMagickToken(p,&p,token);
switch (i)
{
- case 0: affine_matrix->sx=atof(token); break;
- case 1: affine_matrix->rx=atof(token); break;
- case 2: affine_matrix->ry=atof(token); break;
- case 3: affine_matrix->sy=atof(token); break;
- case 4: affine_matrix->tx=atof(token); flags|=XValue; break;
- case 5: affine_matrix->ty=atof(token); flags|=YValue; break;
+ case 0: affine_matrix->sx=StringToDouble(token); break;
+ case 1: affine_matrix->rx=StringToDouble(token); break;
+ case 2: affine_matrix->ry=StringToDouble(token); break;
+ case 3: affine_matrix->sy=StringToDouble(token); break;
+ case 4: affine_matrix->tx=StringToDouble(token); flags|=XValue; break;
+ case 5: affine_matrix->ty=StringToDouble(token); flags|=YValue; break;
}
}
determinant=(affine_matrix->sx*affine_matrix->sy-affine_matrix->rx*
diff --git a/magick/image.c b/magick/image.c
index e2cbfac..0158636 100644
--- a/magick/image.c
+++ b/magick/image.c
@@ -87,6 +87,7 @@
#include "magick/signature-private.h"
#include "magick/statistic.h"
#include "magick/string_.h"
+#include "magick/string-private.h"
#include "magick/thread-private.h"
#include "magick/threshold.h"
#include "magick/timer.h"
@@ -3095,7 +3096,7 @@
last;
(void) CloneString(&image_info->scenes,subimage);
- image_info->scene=(unsigned long) atol(image_info->scenes);
+ image_info->scene=(unsigned long) StringToLong(image_info->scenes);
image_info->number_scenes=image_info->scene;
p=image_info->scenes;
for (q=(char *) image_info->scenes; *q != '\0'; p++)
@@ -3956,7 +3957,7 @@
&image->exception);
option=GetImageOption(image_info,"bias");
if (option != (const char *) NULL)
- image->bias=StringToDouble(option,QuantumRange);
+ image->bias=SiPrefixToDouble(option,QuantumRange);
option=GetImageOption(image_info,"black-point-compensation");
if (option != (const char *) NULL)
image->black_point_compensation=(MagickBooleanType) ParseMagickOption(
@@ -3975,7 +3976,7 @@
(void) QueryColorDatabase(option,&image->border_color,&image->exception);
option=GetImageOption(image_info,"colors");
if (option != (const char *) NULL)
- image->colors=(unsigned long) atol(option);
+ image->colors=(unsigned long) StringToLong(option);
option=GetImageOption(image_info,"compose");
if (option != (const char *) NULL)
image->compose=(CompositeOperator) ParseMagickOption(MagickComposeOptions,
@@ -4028,7 +4029,7 @@
}
option=GetImageOption(image_info,"depth");
if (option != (const char *) NULL)
- image->depth=(unsigned long) atol(option);
+ image->depth=(unsigned long) StringToLong(option);
option=GetImageOption(image_info,"dispose");
if (option != (const char *) NULL)
image->dispose=(DisposeType) ParseMagickOption(MagickDisposeOptions,
@@ -4045,7 +4046,7 @@
MagickFalse,option);
option=GetImageOption(image_info,"fuzz");
if (option != (const char *) NULL)
- image->fuzz=StringToDouble(option,QuantumRange);
+ image->fuzz=SiPrefixToDouble(option,QuantumRange);
option=GetImageOption(image_info,"gravity");
if (option != (const char *) NULL)
image->gravity=(GravityType) ParseMagickOption(MagickGravityOptions,
@@ -4073,7 +4074,7 @@
MagickInterpolateOptions,MagickFalse,option);
option=GetImageOption(image_info,"loop");
if (option != (const char *) NULL)
- image->iterations=(unsigned long) atol(option);
+ image->iterations=(unsigned long) StringToLong(option);
option=GetImageOption(image_info,"mattecolor");
if (option != (const char *) NULL)
(void) QueryColorDatabase(option,&image->matte_color,&image->exception);
@@ -4083,7 +4084,7 @@
MagickOrientationOptions,MagickFalse,option);
option=GetImageOption(image_info,"quality");
if (option != (const char *) NULL)
- image->quality=(unsigned long) atol(option);
+ image->quality=(unsigned long) StringToLong(option);
option=GetImageOption(image_info,"page");
if (option != (const char *) NULL)
{
@@ -4107,7 +4108,7 @@
image->quality=image_info->quality;
option=GetImageOption(image_info,"scene");
if (option != (const char *) NULL)
- image->scene=(unsigned long) atol(option);
+ image->scene=(unsigned long) StringToLong(option);
option=GetImageOption(image_info,"taint");
if (option != (const char *) NULL)
image->taint=(MagickBooleanType) ParseMagickOption(MagickBooleanOptions,
diff --git a/magick/log.c b/magick/log.c
index 6b17249..347bb87 100644
--- a/magick/log.c
+++ b/magick/log.c
@@ -52,6 +52,7 @@
#include "magick/semaphore.h"
#include "magick/timer.h"
#include "magick/string_.h"
+#include "magick/string-private.h"
#include "magick/token.h"
#include "magick/thread_.h"
#include "magick/thread-private.h"
@@ -1447,7 +1448,7 @@
log_info->generations=(~0UL);
break;
}
- log_info->generations=(unsigned long) atol(token);
+ log_info->generations=(unsigned long) StringToLong(token);
break;
}
break;
@@ -1462,7 +1463,7 @@
log_info->limit=(~0UL);
break;
}
- log_info->limit=(unsigned long) atol(token);
+ log_info->limit=(unsigned long) StringToLong(token);
break;
}
break;
diff --git a/magick/magic.c b/magick/magic.c
index 25b1bff..34263ae 100644
--- a/magick/magic.c
+++ b/magick/magic.c
@@ -49,6 +49,7 @@
#include "magick/memory_.h"
#include "magick/semaphore.h"
#include "magick/string_.h"
+#include "magick/string-private.h"
#include "magick/token.h"
#include "magick/utility.h"
#include "magick/xml-tree.h"
@@ -804,7 +805,7 @@
{
if (LocaleCompare((char *) keyword,"offset") == 0)
{
- magic_info->offset=(MagickOffsetType) atol(token);
+ magic_info->offset=(MagickOffsetType) StringToLong(token);
break;
}
break;
diff --git a/magick/methods.h b/magick/methods.h
index 588f2ff..b01ee72 100644
--- a/magick/methods.h
+++ b/magick/methods.h
@@ -1136,7 +1136,7 @@
#define StringInfoToHexString PrependMagickMethod(StringInfoToHexString)
#define StringInfoToString PrependMagickMethod(StringInfoToString)
#define StringToArgv PrependMagickMethod(StringToArgv)
-#define StringToDouble PrependMagickMethod(StringToDouble)
+#define SiPrefixToDouble PrependMagickMethod(SiPrefixToDouble)
#define StringToken PrependMagickMethod(StringToken)
#define StringToList PrependMagickMethod(StringToList)
#define StringToStringInfo PrependMagickMethod(StringToStringInfo)
diff --git a/magick/property.c b/magick/property.c
index 49d4f2e..3929e9c 100644
--- a/magick/property.c
+++ b/magick/property.c
@@ -71,6 +71,7 @@
#include "magick/signature-private.h"
#include "magick/statistic.h"
#include "magick/string_.h"
+#include "magick/string-private.h"
#include "magick/token.h"
#include "magick/utility.h"
#include "magick/xml-tree.h"
@@ -574,7 +575,7 @@
*name='\0';
sub_number=1;
if (*name == '#')
- sub_number=atol(&name[1]);
+ sub_number=StringToLong(&name[1]);
sub_number=MagickMax(sub_number,1L);
resource=(char *) NULL;
status=MagickFalse;
@@ -3265,7 +3266,7 @@
{
if (LocaleCompare(property,"bias") == 0)
{
- image->bias=StringToDouble(value,QuantumRange);
+ image->bias=SiPrefixToDouble(value,QuantumRange);
break;
}
status=AddValueToSplayTree((SplayTreeInfo *) image->properties,
@@ -3342,7 +3343,7 @@
}
if (LocaleCompare(property,"depth") == 0)
{
- image->depth=(unsigned long) atol(value);
+ image->depth=(unsigned long) StringToLong(value);
break;
}
if (LocaleCompare(property,"dispose") == 0)
@@ -3414,7 +3415,7 @@
{
if (LocaleCompare(property,"loop") == 0)
{
- image->iterations=(unsigned long) atol(value);
+ image->iterations=(unsigned long) StringToLong(value);
break;
}
status=AddValueToSplayTree((SplayTreeInfo *) image->properties,
diff --git a/magick/quantum.c b/magick/quantum.c
index 32fedc5..8792224 100644
--- a/magick/quantum.c
+++ b/magick/quantum.c
@@ -63,6 +63,7 @@
#include "magick/statistic.h"
#include "magick/stream.h"
#include "magick/string_.h"
+#include "magick/string-private.h"
#include "magick/thread-private.h"
#include "magick/utility.h"
@@ -361,10 +362,10 @@
MagickQuantumFormatOptions,MagickFalse,option);
option=GetImageOption(image_info,"quantum:minimum");
if (option != (char *) NULL)
- quantum_info->minimum=atof(option);
+ quantum_info->minimum=StringToDouble(option);
option=GetImageOption(image_info,"quantum:maximum");
if (option != (char *) NULL)
- quantum_info->maximum=atof(option);
+ quantum_info->maximum=StringToDouble(option);
if ((quantum_info->minimum == 0.0) && (quantum_info->maximum == 0.0))
quantum_info->scale=0.0;
else
@@ -378,7 +379,7 @@
quantum_info->minimum);
option=GetImageOption(image_info,"quantum:scale");
if (option != (char *) NULL)
- quantum_info->scale=atof(option);
+ quantum_info->scale=StringToDouble(option);
option=GetImageOption(image_info,"quantum:polarity");
if (option != (char *) NULL)
quantum_info->min_is_white=LocaleCompare(option,"min-is-white") == 0 ?
diff --git a/magick/resize.c b/magick/resize.c
index 8f4d19f..d2bf41d 100644
--- a/magick/resize.c
+++ b/magick/resize.c
@@ -64,6 +64,7 @@
#include "magick/resize.h"
#include "magick/resize-private.h"
#include "magick/string_.h"
+#include "magick/string-private.h"
#include "magick/thread-private.h"
#include "magick/utility.h"
#include "magick/version.h"
@@ -596,7 +597,7 @@
resize_filter->blur = blur;
artifact=GetImageArtifact(image,"filter:blur");
if (artifact != (const char *) NULL)
- resize_filter->blur = atof(artifact);
+ resize_filter->blur = StringToDouble(artifact);
if ( resize_filter->blur < MagickEpsilon )
resize_filter->blur = (MagickRealType) MagickEpsilon;
@@ -676,7 +677,7 @@
/* Filter support overrides */
artifact=GetImageArtifact(image,"filter:lobes");
if (artifact != (const char *) NULL) {
- long lobes = atol(artifact);
+ long lobes = StringToLong(artifact);
if ( lobes < 1 ) lobes = 1;
resize_filter->support = (MagickRealType) lobes;
if ( filter_type == BesselFilter ) {
@@ -686,7 +687,7 @@
}
artifact=GetImageArtifact(image,"filter:support");
if (artifact != (const char *) NULL)
- resize_filter->support = fabs(atof(artifact));
+ resize_filter->support = fabs(StringToDouble(artifact));
/* Scale windowing function separatally to the support 'clipping' window
that calling operator is planning to actually use. - Expert Use Only
@@ -694,7 +695,7 @@
resize_filter->window_support = resize_filter->support;
artifact=GetImageArtifact(image,"filter:win-support");
if (artifact != (const char *) NULL)
- resize_filter->window_support = fabs(atof(artifact));
+ resize_filter->window_support = fabs(StringToDouble(artifact));
/* Set Cubic Spline B,C values, calculate Cubic coefficents */
B=0.0;
@@ -711,16 +712,16 @@
}
artifact=GetImageArtifact(image,"filter:b");
if (artifact != (const char *) NULL) {
- B=atof(artifact);
+ B=StringToDouble(artifact);
C=(1.0-B)/2.0; /* Calculate C as if it is a Keys cubic filter */
artifact=GetImageArtifact(image,"filter:c");
if (artifact != (const char *) NULL)
- C=atof(artifact);
+ C=StringToDouble(artifact);
}
else {
artifact=GetImageArtifact(image,"filter:c");
if (artifact != (const char *) NULL) {
- C=atof(artifact);
+ C=StringToDouble(artifact);
B=1.0-2.0*C; /* Calculate B as if it is a Keys cubic filter */
}
}
diff --git a/magick/resource.c b/magick/resource.c
index f38ba10..ca4f731 100644
--- a/magick/resource.c
+++ b/magick/resource.c
@@ -56,6 +56,7 @@
#include "magick/semaphore.h"
#include "magick/signature-private.h"
#include "magick/string_.h"
+#include "magick/string-private.h"
#include "magick/splay-tree.h"
#include "magick/thread-private.h"
#include "magick/token.h"
@@ -886,7 +887,7 @@
double
value;
- value=StringToDouble(string,interval);
+ value=SiPrefixToDouble(string,interval);
if (value >= (double) MagickULLConstant(~0))
return(MagickULLConstant(~0));
return((MagickSizeType) value);
@@ -992,7 +993,7 @@
limit=GetPolicyValue("thread");
if (limit != (char *) NULL)
{
- SetOpenMPMaximumThreads((unsigned long) atol(limit));
+ SetOpenMPMaximumThreads((unsigned long) StringToLong(limit));
(void) SetMagickResourceLimit(ThreadResource,StringToSizeType(limit,
100.0));
limit=DestroyString(limit);
diff --git a/magick/shear.c b/magick/shear.c
index 705a26c..23355c7 100644
--- a/magick/shear.c
+++ b/magick/shear.c
@@ -72,6 +72,8 @@
#include "magick/resource_.h"
#include "magick/shear.h"
#include "magick/statistic.h"
+#include "magick/string_.h"
+#include "magick/string-private.h"
#include "magick/threshold.h"
#include "magick/transform.h"
@@ -959,7 +961,7 @@
/*
Auto-crop image.
*/
- GetImageBackgroundColor(clone_image,atol(artifact),exception);
+ GetImageBackgroundColor(clone_image,StringToLong(artifact),exception);
deskew_image=AffineTransformImage(clone_image,&affine_matrix,exception);
clone_image=DestroyImage(clone_image);
if (deskew_image == (Image *) NULL)
diff --git a/magick/string-private.h b/magick/string-private.h
new file mode 100644
index 0000000..1449176
--- /dev/null
+++ b/magick/string-private.h
@@ -0,0 +1,69 @@
+/*
+ Copyright 1999-2010 ImageMagick Studio LLC, a non-profit organization
+ dedicated to making software imaging solutions freely available.
+
+ You may not use this file except in compliance with the License.
+ obtain a copy of the License at
+
+ http://www.imagemagick.org/script/license.php
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+
+ MagickCore private string methods.
+*/
+#ifndef _MAGICKCORE_STRING_PRIVATE_H
+#define _MAGICKCORE_STRING_PRIVATE_H
+
+#if defined(__cplusplus) || defined(c_plusplus)
+extern "C" {
+#endif
+
+static inline double SiPrefixToDouble(const char *string,const double interval)
+{
+ char
+ *q;
+
+ double
+ scale,
+ value;
+
+ assert(string != (char *) NULL);
+ value=strtod(string,&q);
+ scale=1000.0;
+ if ((*q != '\0') && (tolower((int) ((unsigned char) *(q+1))) == 'i'))
+ scale=1024.0;
+ switch (tolower((int) ((unsigned char) *q)))
+ {
+ case '%': value*=pow(scale,0)*interval/100.0; break;
+ case 'k': value*=pow(scale,1); break;
+ case 'm': value*=pow(scale,2); break;
+ case 'g': value*=pow(scale,3); break;
+ case 't': value*=pow(scale,4); break;
+ case 'p': value*=pow(scale,5); break;
+ case 'e': value*=pow(scale,6); break;
+ case 'z': value*=pow(scale,7); break;
+ case 'y': value*=pow(scale,8); break;
+ default: break;
+ }
+ return(value);
+}
+
+static inline double StringToDouble(const char *value)
+{
+ return(strtod(value,(char **) NULL));
+}
+
+static inline long StringToLong(const char *value)
+{
+ return(strtol(value,(char **) NULL,10));
+}
+
+#if defined(__cplusplus) || defined(c_plusplus)
+}
+#endif
+
+#endif
diff --git a/magick/string.c b/magick/string.c
index 98df848..5851a4b 100644
--- a/magick/string.c
+++ b/magick/string.c
@@ -1967,61 +1967,6 @@
% %
% %
% %
-% S t r i n g T o D o u b l e %
-% %
-% %
-% %
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-%
-% StringToDouble() converts a text string to a double. If the string contains
-% a percent sign (e.g. 50%) that percentage of the interval is returned.
-%
-% The format of the StringToDouble method is:
-%
-% double StringToDouble(const char *string,const double interval)
-%
-% A description of each parameter follows:
-%
-% o string: Specifies the string representing a value.
-%
-% o interval: Specifies the interval; used for obtaining a percentage.
-%
-*/
-MagickExport double StringToDouble(const char *string,const double interval)
-{
- char
- *q;
-
- double
- scale,
- value;
-
- assert(string != (char *) NULL);
- value=strtod(string,&q);
- scale=1000.0;
- if ((*q != '\0') && (tolower((int) ((unsigned char) *(q+1))) == 'i'))
- scale=1024.0;
- switch (tolower((int) ((unsigned char) *q)))
- {
- case '%': value*=pow(scale,0)*interval/100.0; break;
- case 'k': value*=pow(scale,1); break;
- case 'm': value*=pow(scale,2); break;
- case 'g': value*=pow(scale,3); break;
- case 't': value*=pow(scale,4); break;
- case 'p': value*=pow(scale,5); break;
- case 'e': value*=pow(scale,6); break;
- case 'z': value*=pow(scale,7); break;
- case 'y': value*=pow(scale,8); break;
- default: break;
- }
- return(value);
-}
-
-/*
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-% %
-% %
-% %
% S t r i n g I n f o T o H e x S t r i n g %
% %
% %
diff --git a/magick/string_.h b/magick/string_.h
index d98c4e3..1b978f1 100644
--- a/magick/string_.h
+++ b/magick/string_.h
@@ -59,9 +59,6 @@
extern MagickExport const char
*GetStringInfoPath(const StringInfo *);
-extern MagickExport double
- StringToDouble(const char *,const double);
-
extern MagickExport long
FormatMagickSize(const MagickSizeType,const MagickBooleanType,char *),
FormatMagickString(char *,const size_t,const char *,...)
diff --git a/magick/threshold.c b/magick/threshold.c
index 7f149ee..98d89be 100644
--- a/magick/threshold.c
+++ b/magick/threshold.c
@@ -65,6 +65,7 @@
#include "magick/monitor.h"
#include "magick/monitor-private.h"
#include "magick/montage.h"
+#include "magick/option.h"
#include "magick/pixel-private.h"
#include "magick/quantize.h"
#include "magick/quantum.h"
@@ -76,9 +77,9 @@
#include "magick/shear.h"
#include "magick/signature-private.h"
#include "magick/string_.h"
+#include "magick/string-private.h"
#include "magick/transform.h"
#include "magick/threshold.h"
-#include "magick/option.h"
#include "magick/xml-tree.h"
/*
@@ -947,7 +948,7 @@
map = DestroyThresholdMap(map);
return(map);
}
- map->width = (unsigned long) atoi(attr);
+ map->width = (unsigned long) StringToLong(attr);
if ( map->width == 0 ) {
(void) ThrowMagickException(exception,GetMagickModule(),OptionError,
"XmlInvalidAttribute", "<levels width>, map \"%s\"", map_id);
@@ -964,7 +965,7 @@
map = DestroyThresholdMap(map);
return(map);
}
- map->height = (unsigned long) atoi(attr);
+ map->height = (unsigned long) StringToLong(attr);
if ( map->height == 0 ) {
(void) ThrowMagickException(exception,GetMagickModule(),OptionError,
"XmlInvalidAttribute", "<levels height>, map \"%s\"", map_id);
@@ -981,7 +982,7 @@
map = DestroyThresholdMap(map);
return(map);
}
- map->divisor = atoi(attr);
+ map->divisor = StringToLong(attr);
if ( map->divisor < 2 ) {
(void) ThrowMagickException(exception,GetMagickModule(),OptionError,
"XmlInvalidAttribute", "<levels divisor>, map \"%s\"", map_id);
diff --git a/magick/type.c b/magick/type.c
index a79ed24..8940a5f 100644
--- a/magick/type.c
+++ b/magick/type.c
@@ -53,6 +53,7 @@
#include "magick/semaphore.h"
#include "magick/splay-tree.h"
#include "magick/string_.h"
+#include "magick/string-private.h"
#include "magick/type.h"
#include "magick/token.h"
#include "magick/utility.h"
@@ -1102,7 +1103,7 @@
{
if (LocaleCompare((char *) keyword,"face") == 0)
{
- type_info->face=(unsigned long) atol(token);
+ type_info->face=(unsigned long) StringToLong(token);
break;
}
if (LocaleCompare((char *) keyword,"family") == 0)
@@ -1224,7 +1225,7 @@
{
if (LocaleCompare((char *) keyword,"weight") == 0)
{
- type_info->weight=(unsigned long) atol(token);
+ type_info->weight=(unsigned long) StringToLong(token);
if (LocaleCompare(token,"bold") == 0)
type_info->weight=700;
if (LocaleCompare(token,"normal") == 0)
diff --git a/magick/xml-tree.c b/magick/xml-tree.c
index a9b6fd9..169f382 100644
--- a/magick/xml-tree.c
+++ b/magick/xml-tree.c
@@ -55,6 +55,7 @@
#include "magick/memory_.h"
#include "magick/semaphore.h"
#include "magick/string_.h"
+#include "magick/string-private.h"
#include "magick/xml-tree.h"
#include "magick/utility.h"
@@ -244,7 +245,7 @@
node=child;
if (node == (XMLTreeInfo *) NULL)
break;
- for (j=atol(subnode)-1; j > 0; j--)
+ for (j=StringToLong(subnode)-1; j > 0; j--)
{
node=GetXMLTreeOrdered(node);
if (node == (XMLTreeInfo *) NULL)
@@ -875,7 +876,7 @@
node=GetXMLTreeChild(node,tag);
if (node == (XMLTreeInfo *) NULL)
break;
- for (j=atol(subnode)-1; j > 0; j--)
+ for (j=StringToLong(subnode)-1; j > 0; j--)
{
node=GetXMLTreeOrdered(node);
if (node == (XMLTreeInfo *) NULL)
diff --git a/magick/xwindow.c b/magick/xwindow.c
index a7b9aa6..9d56d79 100644
--- a/magick/xwindow.c
+++ b/magick/xwindow.c
@@ -71,6 +71,7 @@
#include "magick/shear.h"
#include "magick/statistic.h"
#include "magick/string_.h"
+#include "magick/string-private.h"
#include "magick/transform.h"
#include "magick/utility.h"
#include "magick/widget.h"
@@ -3464,7 +3465,7 @@
"borderColor",BorderColor);
resource_value=XGetResourceClass(database,client_name,"borderWidth",
(char *) "2");
- resource_info->border_width=(unsigned int) atoi(resource_value);
+ resource_info->border_width=(unsigned int) StringToLong(resource_value);
resource_value=XGetResourceClass(database,client_name,"colormap",
(char *) "shared");
resource_info->colormap=UndefinedColormap;
@@ -3485,7 +3486,7 @@
(char *) "False");
resource_info->confirm_edit=IsMagickTrue(resource_value);
resource_value=XGetResourceClass(database,client_name,"delay",(char *) "1");
- resource_info->delay=(unsigned int) atoi(resource_value);
+ resource_info->delay=(unsigned int) StringToLong(resource_value);
resource_info->display_gamma=XGetResourceClass(database,client_name,
"displayGamma",(char *) "2.2");
resource_value=XGetResourceClass(database,client_name,"displayWarnings",
@@ -3540,7 +3541,7 @@
resource_info->immutable=IsMagickTrue(resource_value);
resource_value=XGetResourceClass(database,client_name,"magnify",
(char *) "3");
- resource_info->magnify=(unsigned int) atoi(resource_value);
+ resource_info->magnify=(unsigned int) StringToLong(resource_value);
resource_info->map_type=XGetResourceClass(database,client_name,"map",
(char *) NULL);
resource_info->matte_color=XGetResourceInstance(database,client_name,
@@ -3570,9 +3571,9 @@
resource_info->pen_colors[10]=XGetResourceClass(database,client_name,"pen0",
(char *) "gray");
resource_value=XGetResourceClass(database,client_name,"pause",(char *) "0");
- resource_info->pause=(unsigned int) atoi(resource_value);
+ resource_info->pause=(unsigned int) StringToLong(resource_value);
resource_value=XGetResourceClass(database,client_name,"quantum",(char *) "1");
- resource_info->quantum=atoi(resource_value);
+ resource_info->quantum=StringToLong(resource_value);
resource_info->text_font=XGetResourceClass(database,client_name,(char *)
"font",(char *) "fixed");
resource_info->text_font=XGetResourceClass(database,client_name,
@@ -3581,7 +3582,7 @@
(char *) NULL);
resource_value=XGetResourceClass(database,client_name,"undoCache",
(char *) "16");
- resource_info->undo_cache=(unsigned int) atol(resource_value);
+ resource_info->undo_cache=(unsigned int) StringToLong(resource_value);
resource_value=XGetResourceClass(database,client_name,"update",
(char *) "False");
resource_info->update=IsMagickTrue(resource_value);
diff --git a/tests/validate.c b/tests/validate.c
index 24cc998..4783498 100644
--- a/tests/validate.c
+++ b/tests/validate.c
@@ -43,6 +43,7 @@
#include <stdio.h>
#include <string.h>
#include <math.h>
+#include "magick/string-private.h"
#include "wand/MagickWand.h"
#include "validate.h"
@@ -1290,7 +1291,7 @@
{
if (LocaleCompare("bench",option+1) == 0)
{
- iterations=(unsigned long) atol(argv[++i]);
+ iterations=(unsigned long) StringToLong(argv[++i]);
break;
}
ThrowValidateException(OptionError,"UnrecognizedOption",option)
diff --git a/wand/animate.c b/wand/animate.c
index eb60086..24b284d 100644
--- a/wand/animate.c
+++ b/wand/animate.c
@@ -44,6 +44,7 @@
#include "wand/MagickWand.h"
#include "wand/mogrify-private.h"
#include "magick/animate-private.h"
+#include "magick/string-private.h"
/*
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
@@ -523,7 +524,7 @@
i++;
if ((i == (long) argc) || (IsGeometry(argv[i]) == MagickFalse))
ThrowAnimateException(OptionError,"MissingArgument",option);
- resource_info.border_width=(unsigned int) atoi(argv[i]);
+ resource_info.border_width=(unsigned int) StringToLong(argv[i]);
break;
}
ThrowAnimateException(OptionError,"UnrecognizedOption",option);
@@ -614,7 +615,7 @@
ThrowAnimateException(OptionError,"MissingArgument",option);
if (IsGeometry(argv[i]) == MagickFalse)
ThrowAnimateInvalidArgumentException(option,argv[i]);
- quantize_info->number_colors=(unsigned long) atol(argv[i]);
+ quantize_info->number_colors=(unsigned long) StringToLong(argv[i]);
break;
}
if (LocaleCompare("colorspace",option+1) == 0)
@@ -1112,7 +1113,7 @@
ThrowAnimateException(OptionError,"MissingArgument",option);
if (IsGeometry(argv[i]) == MagickFalse)
ThrowAnimateInvalidArgumentException(option,argv[i]);
- resource_info.pause=(unsigned int) atoi(argv[i]);
+ resource_info.pause=(unsigned int) StringToLong(argv[i]);
break;
}
if (LocaleCompare("page",option+1) == 0)
@@ -1347,7 +1348,7 @@
ThrowAnimateException(OptionError,"MissingArgument",option);
if (IsGeometry(argv[i]) == MagickFalse)
ThrowAnimateInvalidArgumentException(option,argv[i]);
- quantize_info->tree_depth=(unsigned long) atol(argv[i]);
+ quantize_info->tree_depth=(unsigned long) StringToLong(argv[i]);
break;
}
if (LocaleCompare("trim",option+1) == 0)
diff --git a/wand/compare.c b/wand/compare.c
index dbb0969..c4a8429 100644
--- a/wand/compare.c
+++ b/wand/compare.c
@@ -44,6 +44,7 @@
#include "wand/studio.h"
#include "wand/MagickWand.h"
#include "wand/mogrify-private.h"
+#include "magick/string-private.h"
/*
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
@@ -528,7 +529,7 @@
if (*option == '+')
dissimilarity_threshold=DefaultDissimilarityThreshold;
else
- dissimilarity_threshold=atof(argv[i]);
+ dissimilarity_threshold=StringToDouble(argv[i]);
break;
}
if (LocaleCompare("duration",option+1) == 0)
diff --git a/wand/composite.c b/wand/composite.c
index 1f36de7..1f88a50 100644
--- a/wand/composite.c
+++ b/wand/composite.c
@@ -43,6 +43,7 @@
#include "wand/studio.h"
#include "wand/MagickWand.h"
#include "wand/mogrify-private.h"
+#include "magick/string-private.h"
/*
Typedef declarations.
@@ -1387,7 +1388,7 @@
ThrowCompositeException(OptionError,"MissingArgument",option);
if (IsGeometry(argv[i]) == MagickFalse)
ThrowCompositeInvalidArgumentException(option,argv[i]);
- composite_options.stegano=atol(argv[i])+1;
+ composite_options.stegano=StringToLong(argv[i])+1;
break;
}
if (LocaleCompare("stereo",option+1) == 0)
diff --git a/wand/display.c b/wand/display.c
index a855c8e..eb90d2f 100644
--- a/wand/display.c
+++ b/wand/display.c
@@ -45,6 +45,7 @@
#include "wand/MagickWand.h"
#include "wand/mogrify-private.h"
#include "magick/display-private.h"
+#include "magick/string-private.h"
/*
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
@@ -437,7 +438,7 @@
"pageGeometry",(char *) NULL);
resource_value=XGetResourceInstance(resource_database,GetClientName(),
"quality","75");
- image_info->quality=(unsigned long) atol(resource_value);
+ image_info->quality=(unsigned long) StringToLong(resource_value);
resource_value=XGetResourceInstance(resource_database,GetClientName(),
"verbose","False");
image_info->verbose=IsMagickTrue(resource_value);
@@ -742,7 +743,7 @@
ThrowDisplayException(OptionError,"MissingArgument",option);
if (IsGeometry(argv[i]) == MagickFalse)
ThrowDisplayInvalidArgumentException(option,argv[i]);
- resource_info.border_width=(unsigned int) atoi(argv[i]);
+ resource_info.border_width=(unsigned int) StringToLong(argv[i]);
break;
}
ThrowDisplayException(OptionError,"UnrecognizedOption",option);
@@ -815,7 +816,7 @@
ThrowDisplayException(OptionError,"MissingArgument",option);
if (IsGeometry(argv[i]) == MagickFalse)
ThrowDisplayInvalidArgumentException(option,argv[i]);
- quantize_info->number_colors=(unsigned long) atol(argv[i]);
+ quantize_info->number_colors=(unsigned long) StringToLong(argv[i]);
break;
}
if (LocaleCompare("colorspace",option+1) == 0)
@@ -1342,7 +1343,7 @@
ThrowDisplayException(OptionError,"MissingArgument",option);
if (IsGeometry(argv[i]) == MagickFalse)
ThrowDisplayInvalidArgumentException(option,argv[i]);
- iterations=(unsigned long) atol(argv[i]);
+ iterations=(unsigned long) StringToLong(argv[i]);
break;
}
ThrowDisplayException(OptionError,"UnrecognizedOption",option);
@@ -1359,7 +1360,7 @@
ThrowDisplayException(OptionError,"MissingArgument",option);
if (IsGeometry(argv[i]) == MagickFalse)
ThrowDisplayInvalidArgumentException(option,argv[i]);
- resource_info.magnify=(unsigned int) atoi(argv[i]);
+ resource_info.magnify=(unsigned int) StringToLong(argv[i]);
break;
}
if (LocaleCompare("map",option+1) == 0)
@@ -1739,7 +1740,7 @@
ThrowDisplayException(OptionError,"MissingArgument",option);
if (IsGeometry(argv[i]) == MagickFalse)
ThrowDisplayInvalidArgumentException(option,argv[i]);
- quantize_info->tree_depth=(unsigned long) atol(argv[i]);
+ quantize_info->tree_depth=(unsigned long) StringToLong(argv[i]);
break;
}
if (LocaleCompare("trim",option+1) == 0)
@@ -1758,7 +1759,7 @@
ThrowDisplayException(OptionError,"MissingArgument",option);
if (IsGeometry(argv[i]) == MagickFalse)
ThrowDisplayInvalidArgumentException(option,argv[i]);
- resource_info.update=(unsigned int) atoi(argv[i]);
+ resource_info.update=(unsigned int) StringToLong(argv[i]);
break;
}
if (LocaleCompare("use-pixmap",option+1) == 0)
diff --git a/wand/drawing-wand.c b/wand/drawing-wand.c
index adb3b6f..e827432 100644
--- a/wand/drawing-wand.c
+++ b/wand/drawing-wand.c
@@ -50,6 +50,7 @@
#include "wand/MagickWand.h"
#include "wand/magick-wand-private.h"
#include "wand/wand.h"
+#include "magick/string-private.h"
/*
Define declarations.
@@ -6128,7 +6129,7 @@
value=GetXMLTreeContent(child);
if (value != (const char *) NULL)
CurrentContext->fill.opacity=RoundToQuantum((MagickRealType)
- QuantumRange*(1.0-atof(value)));
+ QuantumRange*(1.0-StringToDouble(value)));
}
child=GetXMLTreeChild(xml_info,"fill-rule");
if (child != (XMLTreeInfo *) NULL)
@@ -6149,7 +6150,7 @@
{
value=GetXMLTreeContent(child);
if (value != (const char *) NULL)
- CurrentContext->pointsize=atof(value);
+ CurrentContext->pointsize=StringToDouble(value);
}
child=GetXMLTreeChild(xml_info,"font-stretch");
if (child != (XMLTreeInfo *) NULL)
@@ -6172,7 +6173,7 @@
{
value=GetXMLTreeContent(child);
if (value != (const char *) NULL)
- CurrentContext->weight=(unsigned long) atol(value);
+ CurrentContext->weight=(unsigned long) StringToLong(value);
}
child=GetXMLTreeChild(xml_info,"gravity");
if (child != (XMLTreeInfo *) NULL)
@@ -6195,7 +6196,7 @@
{
value=GetXMLTreeContent(child);
if (value != (const char *) NULL)
- CurrentContext->stroke_antialias=atol(value) != 0 ? MagickTrue :
+ CurrentContext->stroke_antialias=StringToLong(value) != 0 ? MagickTrue :
MagickFalse;
}
child=GetXMLTreeChild(xml_info,"stroke-dasharray");
@@ -6245,7 +6246,7 @@
GetMagickToken(q,&q,token);
if (*token == ',')
GetMagickToken(q,&q,token);
- CurrentContext->dash_pattern[j]=atof(token);
+ CurrentContext->dash_pattern[j]=StringToDouble(token);
}
if ((x & 0x01) != 0)
for ( ; j < (2*x); j++)
@@ -6260,7 +6261,7 @@
{
value=GetXMLTreeContent(child);
if (value != (const char *) NULL)
- CurrentContext->dash_offset=atof(value);
+ CurrentContext->dash_offset=StringToDouble(value);
}
child=GetXMLTreeChild(xml_info,"stroke-linecap");
if (child != (XMLTreeInfo *) NULL)
@@ -6283,7 +6284,7 @@
{
value=GetXMLTreeContent(child);
if (value != (const char *) NULL)
- CurrentContext->miterlimit=(unsigned long) atol(value);
+ CurrentContext->miterlimit=(unsigned long) StringToLong(value);
}
child=GetXMLTreeChild(xml_info,"stroke-opacity");
if (child != (XMLTreeInfo *) NULL)
@@ -6291,14 +6292,14 @@
value=GetXMLTreeContent(child);
if (value != (const char *) NULL)
CurrentContext->stroke.opacity=RoundToQuantum((MagickRealType)
- QuantumRange*(1.0-atof(value)));
+ QuantumRange*(1.0-StringToDouble(value)));
}
child=GetXMLTreeChild(xml_info,"stroke-width");
if (child != (XMLTreeInfo *) NULL)
{
value=GetXMLTreeContent(child);
if (value != (const char *) NULL)
- CurrentContext->stroke_width=atof(value);
+ CurrentContext->stroke_width=StringToDouble(value);
}
child=GetXMLTreeChild(xml_info,"text-align");
if (child != (XMLTreeInfo *) NULL)
@@ -6313,7 +6314,7 @@
{
value=GetXMLTreeContent(child);
if (value != (const char *) NULL)
- CurrentContext->text_antialias=atol(value) != 0 ? MagickTrue :
+ CurrentContext->text_antialias=StringToLong(value) != 0 ? MagickTrue :
MagickFalse;
}
child=GetXMLTreeChild(xml_info,"text-undercolor");
diff --git a/wand/import.c b/wand/import.c
index 5846b93..bbf223f 100644
--- a/wand/import.c
+++ b/wand/import.c
@@ -45,6 +45,7 @@
#include "wand/MagickWand.h"
#include "wand/mogrify-private.h"
#include "magick/xwindow-private.h"
+#include "magick/string-private.h"
/*
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
@@ -370,7 +371,7 @@
ximage_info.borders=IsMagickTrue(resource_value);
resource_value=XGetResourceInstance(resource_database,GetClientName(),
"delay","0");
- resource_info.delay=(unsigned int) atoi(resource_value);
+ resource_info.delay=(unsigned int) StringToLong(resource_value);
image_info->density=XGetResourceInstance(resource_database,GetClientName(),
"density",(char *) NULL);
resource_value=XGetResourceInstance(resource_database,GetClientName(),
@@ -397,10 +398,10 @@
"pageGeometry",(char *) NULL);
resource_value=XGetResourceInstance(resource_database,GetClientName(),
"pause","0");
- resource_info.pause=(unsigned int) atol(resource_value);
+ resource_info.pause=(unsigned int) StringToLong(resource_value);
resource_value=XGetResourceInstance(resource_database,GetClientName(),
"quality","85");
- image_info->quality=(unsigned long) atol(resource_value);
+ image_info->quality=(unsigned long) StringToLong(resource_value);
resource_value=XGetResourceInstance(resource_database,GetClientName(),
"screen","False");
ximage_info.screen=IsMagickTrue(resource_value);
@@ -551,7 +552,7 @@
ThrowImportException(OptionError,"MissingArgument",option);
if (IsGeometry(argv[i]) == MagickFalse)
ThrowImportInvalidArgumentException(option,argv[i]);
- quantize_info->number_colors=(unsigned long) atol(argv[i]);
+ quantize_info->number_colors=(unsigned long) StringToLong(argv[i]);
break;
}
if (LocaleCompare("colorspace",option+1) == 0)
@@ -1015,7 +1016,7 @@
ThrowImportException(OptionError,"MissingArgument",option);
if (IsGeometry(argv[i]) == MagickFalse)
ThrowImportInvalidArgumentException(option,argv[i]);
- resource_info.pause=(unsigned int) atoi(argv[i]);
+ resource_info.pause=(unsigned int) StringToLong(argv[i]);
break;
}
if (LocaleCompare("ping",option+1) == 0)
@@ -1174,7 +1175,7 @@
ThrowImportException(OptionError,"MissingArgument",option);
if (IsGeometry(argv[i]) == MagickFalse)
ThrowImportInvalidArgumentException(option,argv[i]);
- snapshots=atol(argv[i]);
+ snapshots=StringToLong(argv[i]);
break;
}
if (LocaleCompare("strip",option+1) == 0)
@@ -1225,7 +1226,7 @@
ThrowImportException(OptionError,"MissingArgument",option);
if (IsGeometry(argv[i]) == MagickFalse)
ThrowImportInvalidArgumentException(option,argv[i]);
- quantize_info->tree_depth=(unsigned long) atol(argv[i]);
+ quantize_info->tree_depth=(unsigned long) StringToLong(argv[i]);
break;
}
if (LocaleCompare("trim",option+1) == 0)
diff --git a/wand/magick-property.c b/wand/magick-property.c
index eb45e34..3f7ff2d 100644
--- a/wand/magick-property.c
+++ b/wand/magick-property.c
@@ -50,6 +50,7 @@
#include "wand/MagickWand.h"
#include "wand/magick-wand-private.h"
#include "wand/wand.h"
+#include "magick/string-private.h"
/*
Define declarations.
@@ -1484,7 +1485,7 @@
while (((int) *p != 0) && ((isspace((int) ((unsigned char) *p)) != 0) ||
(*p == ',')))
p++;
- sampling_factors[i]=atof(p);
+ sampling_factors[i]=StringToDouble(p);
i++;
}
*number_factors=(unsigned long) i;
diff --git a/wand/mogrify.c b/wand/mogrify.c
index 1c22382..479261a 100644
--- a/wand/mogrify.c
+++ b/wand/mogrify.c
@@ -48,6 +48,7 @@
#include "wand/MagickWand.h"
#include "wand/mogrify-private.h"
#include "magick/thread-private.h"
+#include "magick/string-private.h"
/*
Define declarations.
@@ -135,13 +136,13 @@
if ((strlen(option) == 1) || ((*option != '-') && (*option != '+')))
continue;
if (LocaleCompare("bench",option+1) == 0)
- iterations=(unsigned long) atol(argv[++i]);
+ iterations=(unsigned long) StringToLong(argv[++i]);
if (LocaleCompare("concurrent",option+1) == 0)
concurrent=MagickTrue;
if (LocaleCompare("debug",option+1) == 0)
(void) SetLogEventMask(argv[++i]);
if (LocaleCompare("duration",option+1) == 0)
- duration=atof(argv[++i]);
+ duration=StringToDouble(argv[++i]);
if (LocaleCompare("regard-warnings",option+1) == 0)
regard_warnings=MagickTrue;
}
@@ -482,7 +483,7 @@
error = MagickTrue;
break;
}
- sparse_arguments[x++]=atof(token);
+ sparse_arguments[x++]=StringToDouble(token);
/* Y coordinate */
token[0]=','; while ( token[0] == ',' ) GetMagickToken(p,&p,token);
if ( token[0] == '\0' ) break;
@@ -493,7 +494,7 @@
error = MagickTrue;
break;
}
- sparse_arguments[x++]=atof(token);
+ sparse_arguments[x++]=StringToDouble(token);
/* color values for this control point */
#if 0
if ( (color_from_image ) {
@@ -531,35 +532,35 @@
while ( token[0] == ',' ) GetMagickToken(p,&p,token);
if ( token[0] == '\0' || isalpha((int)token[0]) || token[0] == '#' )
break;
- sparse_arguments[x++] = atof(token);
+ sparse_arguments[x++] = StringToDouble(token);
token[0] = ','; /* used this token - get another */
}
if ( channels & GreenChannel ) {
while ( token[0] == ',' ) GetMagickToken(p,&p,token);
if ( token[0] == '\0' || isalpha((int)token[0]) || token[0] == '#' )
break;
- sparse_arguments[x++] = atof(token);
+ sparse_arguments[x++] = StringToDouble(token);
token[0] = ','; /* used this token - get another */
}
if ( channels & BlueChannel ) {
while ( token[0] == ',' ) GetMagickToken(p,&p,token);
if ( token[0] == '\0' || isalpha((int)token[0]) || token[0] == '#' )
break;
- sparse_arguments[x++] = atof(token);
+ sparse_arguments[x++] = StringToDouble(token);
token[0] = ','; /* used this token - get another */
}
if ( channels & IndexChannel ) {
while ( token[0] == ',' ) GetMagickToken(p,&p,token);
if ( token[0] == '\0' || isalpha((int)token[0]) || token[0] == '#' )
break;
- sparse_arguments[x++] = atof(token);
+ sparse_arguments[x++] = StringToDouble(token);
token[0] = ','; /* used this token - get another */
}
if ( channels & OpacityChannel ) {
while ( token[0] == ',' ) GetMagickToken(p,&p,token);
if ( token[0] == '\0' || isalpha((int)token[0]) || token[0] == '#' )
break;
- sparse_arguments[x++] = atof(token);
+ sparse_arguments[x++] = StringToDouble(token);
token[0] = ','; /* used this token - get another */
}
#endif
@@ -1126,7 +1127,7 @@
Reduce the number of colors in the image.
*/
(void) SyncImageSettings(image_info,*image);
- quantize_info->number_colors=(unsigned long) atol(argv[i+1]);
+ quantize_info->number_colors=(unsigned long) StringToLong(argv[i+1]);
if (quantize_info->number_colors == 0)
break;
if (((*image)->storage_class == DirectClass) ||
@@ -1237,7 +1238,7 @@
GetMagickToken(p,&p,token);
if (*token == ',')
GetMagickToken(p,&p,token);
- kernel[x]=atof(token);
+ kernel[x]=StringToDouble(token);
}
for ( ; x < (long) (order*order); x++)
kernel[x]=0.0;
@@ -1267,7 +1268,7 @@
Cycle an image colormap.
*/
(void) SyncImageSettings(image_info,*image);
- (void) CycleColormapImage(*image,atoi(argv[i+1]));
+ (void) CycleColormapImage(*image,StringToLong(argv[i+1]));
InheritException(exception,&(*image)->exception);
break;
}
@@ -1308,7 +1309,7 @@
(void) SetImageDepth(*image,MAGICKCORE_QUANTUM_DEPTH);
break;
}
- (void) SetImageDepth(*image,(unsigned long) atol(argv[i+1]));
+ (void) SetImageDepth(*image,(unsigned long) StringToLong(argv[i+1]));
break;
}
if (LocaleCompare("deskew",option+1) == 0)
@@ -1326,7 +1327,7 @@
if (*option == '+')
threshold=40.0*QuantumRange/100.0;
else
- threshold=StringToDouble(argv[i+1],QuantumRange);
+ threshold=SiPrefixToDouble(argv[i+1],QuantumRange);
deskew_image=DeskewImage(*image,threshold,exception);
if (deskew_image == (Image *) NULL)
break;
@@ -1410,7 +1411,7 @@
GetMagickToken(p,&p,token);
if (*token == ',')
GetMagickToken(p,&p,token);
- arguments[x]=atof(token);
+ arguments[x]=StringToDouble(token);
}
args=DestroyString(args);
distort_image=DistortImage(*image,method,number_arguments,arguments,
@@ -1549,7 +1550,7 @@
(void) SyncImageSettings(image_info,*image);
op=(MagickEvaluateOperator) ParseMagickOption(MagickEvaluateOptions,
MagickFalse,argv[i+1]);
- constant=StringToDouble(argv[i+2],QuantumRange);
+ constant=SiPrefixToDouble(argv[i+2],QuantumRange);
(void) EvaluateImageChannel(*image,channel,op,constant,exception);
break;
}
@@ -1760,7 +1761,7 @@
GetMagickToken(p,&p,token);
if (*token == ',')
GetMagickToken(p,&p,token);
- parameters[x]=atof(token);
+ parameters[x]=StringToDouble(token);
}
arguments=DestroyString(arguments);
(void) FunctionImageChannel(*image,channel,function,
@@ -1779,13 +1780,13 @@
*/
(void) SyncImageSettings(image_info,*image);
if (*option == '+')
- (*image)->gamma=atof(argv[i+1]);
+ (*image)->gamma=StringToDouble(argv[i+1]);
else
{
if (strchr(argv[i+1],',') != (char *) NULL)
(void) GammaImage(*image,argv[i+1]);
else
- (void) GammaImageChannel(*image,channel,atof(argv[i+1]));
+ (void) GammaImageChannel(*image,channel,StringToDouble(argv[i+1]));
InheritException(exception,&(*image)->exception);
}
break;
@@ -2069,7 +2070,7 @@
}
if (LocaleCompare("linewidth",option+1) == 0)
{
- draw_info->stroke_width=atof(argv[i+1]);
+ draw_info->stroke_width=StringToDouble(argv[i+1]);
break;
}
if (LocaleCompare("liquid-rescale",option+1) == 0)
@@ -2358,7 +2359,7 @@
Posterize image.
*/
(void) SyncImageSettings(image_info,*image);
- (void) PosterizeImage(*image,(unsigned long) atol(argv[i+1]),
+ (void) PosterizeImage(*image,(unsigned long) StringToLong(argv[i+1]),
quantize_info->dither);
InheritException(exception,&(*image)->exception);
break;
@@ -2501,7 +2502,7 @@
Radial blur image.
*/
(void) SyncImageSettings(image_info,*image);
- blur_image=RadialBlurImageChannel(*image,channel,atof(argv[i+1]),
+ blur_image=RadialBlurImageChannel(*image,channel,StringToDouble(argv[i+1]),
exception);
if (blur_image == (Image *) NULL)
break;
@@ -2575,7 +2576,7 @@
GetMagickToken(p,&p,token);
if (*token == ',')
GetMagickToken(p,&p,token);
- color_matrix[x]=atof(token);
+ color_matrix[x]=StringToDouble(token);
}
for ( ; x < (long) (order*order); x++)
color_matrix[x]=0.0;
@@ -2840,7 +2841,7 @@
Sepia-tone image.
*/
(void) SyncImageSettings(image_info,*image);
- threshold=StringToDouble(argv[i+1],QuantumRange);
+ threshold=SiPrefixToDouble(argv[i+1],QuantumRange);
sepia_image=SepiaToneImage(*image,threshold,exception);
if (sepia_image == (Image *) NULL)
break;
@@ -3044,7 +3045,7 @@
threshold;
(void) SyncImageSettings(image_info,*image);
- threshold=StringToDouble(argv[i+1],QuantumRange);
+ threshold=SiPrefixToDouble(argv[i+1],QuantumRange);
(void) SolarizeImage(*image,threshold);
InheritException(exception,&(*image)->exception);
break;
@@ -3157,7 +3158,7 @@
}
if (LocaleCompare("strokewidth",option+1) == 0)
{
- draw_info->stroke_width=atof(argv[i+1]);
+ draw_info->stroke_width=StringToDouble(argv[i+1]);
break;
}
if (LocaleCompare("style",option+1) == 0)
@@ -3204,7 +3205,7 @@
if (*option == '+')
threshold=(double) QuantumRange/2.5;
else
- threshold=StringToDouble(argv[i+1],QuantumRange);
+ threshold=SiPrefixToDouble(argv[i+1],QuantumRange);
(void) BilevelImageChannel(*image,channel,threshold);
InheritException(exception,&(*image)->exception);
break;
@@ -3318,7 +3319,7 @@
}
if (LocaleCompare("treedepth",option+1) == 0)
{
- quantize_info->tree_depth=(unsigned long) atol(argv[i+1]);
+ quantize_info->tree_depth=(unsigned long) StringToLong(argv[i+1]);
break;
}
if (LocaleCompare("trim",option+1) == 0)
@@ -3478,7 +3479,7 @@
}
if (LocaleCompare("weight",option+1) == 0)
{
- draw_info->weight=(unsigned long) atol(argv[i+1]);
+ draw_info->weight=(unsigned long) StringToLong(argv[i+1]);
if (LocaleCompare(argv[i+1],"all") == 0)
draw_info->weight=0;
if (LocaleCompare(argv[i+1],"bold") == 0)
@@ -6361,7 +6362,7 @@
limit=MagickResourceInfinity;
if (LocaleCompare("unlimited",argv[i+1]) != 0)
- limit=(MagickSizeType) StringToDouble(argv[i+1],100.0);
+ limit=(MagickSizeType) SiPrefixToDouble(argv[i+1],100.0);
(void) SetMagickResourceLimit(MemoryResource,limit);
(void) SetMagickResourceLimit(MapResource,2*limit);
break;
@@ -6388,7 +6389,7 @@
}
if (LocaleCompare("colors",option+1) == 0)
{
- image_info->colors=(unsigned long) atol(argv[i+1]);
+ image_info->colors=(unsigned long) StringToLong(argv[i+1]);
break;
}
if (LocaleCompare("colorspace",option+1) == 0)
@@ -6515,7 +6516,7 @@
image_info->depth=MAGICKCORE_QUANTUM_DEPTH;
break;
}
- image_info->depth=(unsigned long) atol(argv[i+1]);
+ image_info->depth=(unsigned long) StringToLong(argv[i+1]);
break;
}
if (LocaleCompare("display",option+1) == 0)
@@ -6647,7 +6648,7 @@
(void) SetImageOption(image_info,option+1,"0");
break;
}
- image_info->fuzz=StringToDouble(argv[i+1],(double) QuantumRange+
+ image_info->fuzz=SiPrefixToDouble(argv[i+1],(double) QuantumRange+
1.0);
(void) SetImageOption(image_info,option+1,argv[i+1]);
break;
@@ -6775,7 +6776,7 @@
MagickFalse,argv[i+1]);
limit=MagickResourceInfinity;
if (LocaleCompare("unlimited",argv[i+2]) != 0)
- limit=(MagickSizeType) StringToDouble(argv[i+2],100.0);
+ limit=(MagickSizeType) SiPrefixToDouble(argv[i+2],100.0);
(void) SetMagickResourceLimit(type,limit);
break;
}
@@ -7034,7 +7035,7 @@
(void) SetImageOption(image_info,option+1,"0");
break;
}
- image_info->quality=(unsigned long) atol(argv[i+1]);
+ image_info->quality=(unsigned long) StringToLong(argv[i+1]);
(void) SetImageOption(image_info,option+1,argv[i+1]);
break;
}
@@ -7101,7 +7102,7 @@
(void) SetImageOption(image_info,option+1,"0");
break;
}
- image_info->scene=(unsigned long) atol(argv[i+1]);
+ image_info->scene=(unsigned long) StringToLong(argv[i+1]);
(void) SetImageOption(image_info,option+1,argv[i+1]);
break;
}
@@ -7116,7 +7117,7 @@
SeedPseudoRandomGenerator(seed);
break;
}
- seed=(unsigned long) atol(argv[i+1]);
+ seed=(unsigned long) StringToLong(argv[i+1]);
SeedPseudoRandomGenerator(seed);
break;
}
@@ -7730,7 +7731,7 @@
index=0;
if (*option != '+')
- index=atol(argv[i+1]);
+ index=StringToLong(argv[i+1]);
p=RemoveLastImageFromList(images);
if (p == (Image *) NULL)
{
@@ -7954,7 +7955,7 @@
*morph_image;
(void) SyncImagesSettings(image_info,*images);
- morph_image=MorphImages(*images,(unsigned long) atol(argv[i+1]),
+ morph_image=MorphImages(*images,(unsigned long) StringToLong(argv[i+1]),
exception);
if (morph_image == (Image *) NULL)
{
diff --git a/wand/montage.c b/wand/montage.c
index 5a39e73..fa2c4a7 100644
--- a/wand/montage.c
+++ b/wand/montage.c
@@ -45,6 +45,7 @@
#include "wand/studio.h"
#include "wand/MagickWand.h"
#include "wand/mogrify-private.h"
+#include "magick/string-private.h"
/*
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
@@ -538,7 +539,7 @@
ThrowMontageException(OptionError,"MissingArgument",option);
if (IsGeometry(argv[i]) == MagickFalse)
ThrowMontageInvalidArgumentException(option,argv[i]);
- montage_info->border_width=(unsigned long) atol(argv[i]);
+ montage_info->border_width=(unsigned long) StringToLong(argv[i]);
break;
}
if (LocaleCompare("bordercolor",option+1) == 0)
@@ -562,7 +563,7 @@
ThrowMontageException(OptionError,"MissingArgument",option);
if (IsGeometry(argv[i]) == MagickFalse)
ThrowMontageInvalidArgumentException(option,argv[i]);
- montage_info->border_width=(unsigned long) atol(argv[i]);
+ montage_info->border_width=(unsigned long) StringToLong(argv[i]);
break;
}
ThrowMontageException(OptionError,"UnrecognizedOption",option)
@@ -1236,7 +1237,7 @@
ThrowMontageException(OptionError,"MissingArgument",option);
if (IsGeometry(argv[i]) == MagickFalse)
ThrowMontageInvalidArgumentException(option,argv[i]);
- montage_info->pointsize=atof(argv[i]);
+ montage_info->pointsize=StringToDouble(argv[i]);
break;
}
if (LocaleCompare("polaroid",option+1) == 0)
@@ -1383,7 +1384,7 @@
ThrowMontageException(OptionError,"MissingArgument",option);
if (IsSceneGeometry(argv[i],MagickFalse) == MagickFalse)
ThrowMontageInvalidArgumentException(option,argv[i]);
- first_scene=atol(argv[i]);
+ first_scene=StringToLong(argv[i]);
last_scene=first_scene;
(void) sscanf(argv[i],"%ld-%ld",&first_scene,&last_scene);
break;