% March 2000 %
% %
% %
-% Copyright 1999-2010 ImageMagick Studio LLC, a non-profit organization %
+% Copyright 1999-2011 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. You may %
#include "magick/token.h"
#include "magick/utility.h"
#if defined(MAGICKCORE_XML_DELEGATE)
-# if defined(__WINDOWS__)
+# if defined(MAGICKCORE_WINDOWS_SUPPORT)
# if defined(__MINGW32__)
# define _MSC_VER
# else
AffineMatrix
affine;
- unsigned long
+ size_t
width,
height;
SVGInfo
*svg_info;
- svg_info=(SVGInfo *) AcquireAlignedMemory(1,sizeof(*svg_info));
+ svg_info=(SVGInfo *) AcquireMagickMemory(sizeof(*svg_info));
if (svg_info == (SVGInfo *) NULL)
return((SVGInfo *) NULL);
(void) ResetMagickMemory(svg_info,0,sizeof(*svg_info));
svg_info->text=AcquireString("");
- svg_info->scale=(double *) AcquireAlignedMemory(1,sizeof(*svg_info->scale));
+ svg_info->scale=(double *) AcquireMagickMemory(sizeof(*svg_info->scale));
if (svg_info->scale == (double *) NULL)
ThrowFatalException(ResourceLimitFatalError,"MemoryAllocationFailed");
GetAffineMatrix(&svg_info->affine);
*text,
**tokens;
- register long
+ register ssize_t
i;
SVGInfo
*svg_info;
svg_info=(SVGInfo *) context;
+ (void) svg_info;
*number_tokens=0;
if (style == (const char *) NULL)
return((char **) NULL);
*p,
*q;
- register long
+ register ssize_t
i;
SVGInfo
(void) LogMagickEvent(CoderEvent,GetMagickModule(),
" SAX.setDocumentLocator()");
svg_info=(SVGInfo *) context;
+ (void) svg_info;
}
static void SVGStartDocument(void *context)
SVGInfo
*svg_info;
- register long
+ register ssize_t
i,
j;
break;
}
}
+ if (strchr((char *) name,':') != (char *) NULL)
+ {
+ /*
+ Skip over namespace.
+ */
+ for ( ; *name != ':'; name++) ;
+ name++;
+ }
switch (*name)
{
case 'C':
if (LocaleCompare((const char *) name,"linearGradient") == 0)
{
MVGPrintf(svg_info->file,
- "push gradient '%s' linear %.15g,%.15g %.15g,%.15g\n",id,
+ "push gradient '%s' linear %g,%g %g,%g\n",id,
svg_info->segment.x1,svg_info->segment.y1,svg_info->segment.x2,
svg_info->segment.y2);
break;
if (LocaleCompare((const char *) name,"pattern") == 0)
{
MVGPrintf(svg_info->file,
- "push pattern '%s' %.15g,%.15g %.15g,%.15g\n",id,
+ "push pattern '%s' %g,%g %g,%g\n",id,
svg_info->bounds.x,svg_info->bounds.y,svg_info->bounds.width,
svg_info->bounds.height);
break;
if (LocaleCompare((const char *) name,"radialGradient") == 0)
{
MVGPrintf(svg_info->file,
- "push gradient '%s' radial %.15g,%.15g %.15g,%.15g %.15g\n",
+ "push gradient '%s' radial %g,%g %g,%g %g\n",
id,svg_info->element.cx,svg_info->element.cy,
svg_info->element.major,svg_info->element.minor,
svg_info->element.angle);
*text;
text=EscapeString(svg_info->text,'\'');
- MVGPrintf(svg_info->file,"text %.15g,%.15g '%s'\n",
+ MVGPrintf(svg_info->file,"text %g,%g '%s'\n",
svg_info->bounds.x-svg_info->center.x,svg_info->bounds.y-
svg_info->center.y,text);
text=DestroyString(text);
{
if (LocaleCompare(keyword,"angle") == 0)
{
- MVGPrintf(svg_info->file,"angle %.15g\n",
+ MVGPrintf(svg_info->file,"angle %g\n",
GetUserSpaceCoordinateValue(svg_info,0,value));
break;
}
if (LocaleCompare(keyword,"font-size") == 0)
{
svg_info->pointsize=GetUserSpaceCoordinateValue(svg_info,0,value);
- MVGPrintf(svg_info->file,"font-size %.15g\n",svg_info->pointsize);
+ MVGPrintf(svg_info->file,"font-size %g\n",svg_info->pointsize);
break;
}
if (LocaleCompare(keyword,"font-weight") == 0)
default:
break;
}
- transform.sx=current.sx*affine.sx+current.ry*affine.rx;
- transform.rx=current.rx*affine.sx+current.sy*affine.rx;
- transform.ry=current.sx*affine.ry+current.ry*affine.sy;
- transform.sy=current.rx*affine.ry+current.sy*affine.sy;
- transform.tx=current.sx*affine.tx+current.ry*affine.ty+
- current.tx;
- transform.ty=current.rx*affine.tx+current.sy*affine.ty+
- current.ty;
+ transform.sx=affine.sx*current.sx+affine.ry*current.rx;
+ transform.rx=affine.rx*current.sx+affine.sy*current.rx;
+ transform.ry=affine.sx*current.ry+affine.ry*current.sy;
+ transform.sy=affine.rx*current.ry+affine.sy*current.sy;
+ transform.tx=affine.sx*current.tx+affine.ry*current.ty+
+ affine.tx;
+ transform.ty=affine.rx*current.tx+affine.sy*current.ty+
+ affine.ty;
}
MVGPrintf(svg_info->file,
- "affine %.15g %.15g %.15g %.15g %.15g %.15g\n",transform.sx,
+ "affine %g %g %g %g %g %g\n",transform.sx,
transform.rx,transform.ry,transform.sy,transform.tx,
transform.ty);
for (j=0; tokens[j] != (char *) NULL; j++)
angle;
angle=GetUserSpaceCoordinateValue(svg_info,0,value);
- MVGPrintf(svg_info->file,"translate %.15g,%.15g\n",
+ MVGPrintf(svg_info->file,"translate %g,%g\n",
svg_info->bounds.x,svg_info->bounds.y);
svg_info->bounds.x=0;
svg_info->bounds.y=0;
- MVGPrintf(svg_info->file,"rotate %.15g\n",angle);
+ MVGPrintf(svg_info->file,"rotate %g\n",angle);
break;
}
if (LocaleCompare(keyword,"rx") == 0)
}
if (LocaleCompare(keyword,"stroke-width") == 0)
{
- MVGPrintf(svg_info->file,"stroke-width %.15g\n",
+ MVGPrintf(svg_info->file,"stroke-width %g\n",
GetUserSpaceCoordinateValue(svg_info,1,value));
break;
}
{
svg_info->pointsize=GetUserSpaceCoordinateValue(
svg_info,0,value);
- MVGPrintf(svg_info->file,"font-size %.15g\n",
+ MVGPrintf(svg_info->file,"font-size %g\n",
svg_info->pointsize);
break;
}
{
if (LocaleCompare(keyword,"offset") == 0)
{
- MVGPrintf(svg_info->file,"offset %.15g\n",
+ MVGPrintf(svg_info->file,"offset %g\n",
GetUserSpaceCoordinateValue(svg_info,1,value));
break;
}
}
if (LocaleCompare(keyword,"stroke-width") == 0)
{
- MVGPrintf(svg_info->file,"stroke-width %.15g\n",
+ MVGPrintf(svg_info->file,"stroke-width %g\n",
GetUserSpaceCoordinateValue(svg_info,1,value));
break;
}
default:
break;
}
- transform.sx=current.sx*affine.sx+current.ry*affine.rx;
- transform.rx=current.rx*affine.sx+current.sy*affine.rx;
- transform.ry=current.sx*affine.ry+current.ry*affine.sy;
- transform.sy=current.rx*affine.ry+current.sy*affine.sy;
- transform.tx=current.sx*affine.tx+current.ry*affine.ty+
- current.tx;
- transform.ty=current.rx*affine.tx+current.sy*affine.ty+
- current.ty;
+ transform.sx=affine.sx*current.sx+affine.ry*current.rx;
+ transform.rx=affine.rx*current.sx+affine.sy*current.rx;
+ transform.ry=affine.sx*current.ry+affine.ry*current.sy;
+ transform.sy=affine.rx*current.ry+affine.sy*current.sy;
+ transform.tx=affine.sx*current.tx+affine.ry*current.ty+
+ affine.tx;
+ transform.ty=affine.rx*current.tx+affine.sy*current.ty+
+ affine.ty;
}
MVGPrintf(svg_info->file,
- "affine %.15g %.15g %.15g %.15g %.15g %.15g\n",transform.sx,
+ "affine %g %g %g %g %g %g\n",transform.sx,
transform.rx,transform.ry,transform.sy,transform.tx,
transform.ty);
for (j=0; tokens[j] != (char *) NULL; j++)
if ((svg_info->view_box.width == 0.0) ||
(svg_info->view_box.height == 0.0))
svg_info->view_box=svg_info->bounds;
- svg_info->width=(unsigned long) (svg_info->bounds.width+0.5);
- svg_info->height=(unsigned long) (svg_info->bounds.height+0.5);
- MVGPrintf(svg_info->file,"viewbox 0 0 %lu %lu\n",svg_info->width,
- svg_info->height);
+ svg_info->width=(size_t) floor(svg_info->bounds.width+0.5);
+ svg_info->height=(size_t) floor(svg_info->bounds.height+0.5);
+ MVGPrintf(svg_info->file,"viewbox 0 0 %.20g %.20g\n",(double)
+ svg_info->width,(double) svg_info->height);
sx=(double) svg_info->width/svg_info->view_box.width;
sy=(double) svg_info->height/svg_info->view_box.height;
- MVGPrintf(svg_info->file,"affine %.15g 0 0 %.15g 0.0 0.0\n",sx,sy);
+ MVGPrintf(svg_info->file,"affine %g 0 0 %g 0.0 0.0\n",sx,sy);
}
}
(void) LogMagickEvent(CoderEvent,GetMagickModule()," )");
(void) LogMagickEvent(CoderEvent,GetMagickModule(),
" SAX.endElement(%s)",name);
svg_info=(SVGInfo *) context;
+ if (strchr((char *) name,':') != (char *) NULL)
+ {
+ /*
+ Skip over namespace.
+ */
+ for ( ; *name != ':'; name++) ;
+ name++;
+ }
switch (*name)
{
case 'C':
{
if (LocaleCompare((const char *) name,"circle") == 0)
{
- MVGPrintf(svg_info->file,"circle %.15g,%.15g %.15g,%.15g\n",
+ MVGPrintf(svg_info->file,"circle %g,%g %g,%g\n",
svg_info->element.cx,svg_info->element.cy,svg_info->element.cx,
svg_info->element.cy+svg_info->element.minor);
MVGPrintf(svg_info->file,"pop graphic-context\n");
angle;
angle=svg_info->element.angle;
- MVGPrintf(svg_info->file,"ellipse %.15g,%.15g %.15g,%.15g 0,360\n",
+ MVGPrintf(svg_info->file,"ellipse %g,%g %g,%g 0,360\n",
svg_info->element.cx,svg_info->element.cy,
angle == 0.0 ? svg_info->element.major : svg_info->element.minor,
angle == 0.0 ? svg_info->element.minor : svg_info->element.major);
{
if (LocaleCompare((const char *) name,"image") == 0)
{
- MVGPrintf(svg_info->file,"image Over %.15g,%.15g %.15g,%.15g '%s'\n",
+ MVGPrintf(svg_info->file,"image Over %g,%g %g,%g '%s'\n",
svg_info->bounds.x,svg_info->bounds.y,svg_info->bounds.width,
svg_info->bounds.height,svg_info->url);
MVGPrintf(svg_info->file,"pop graphic-context\n");
{
if (LocaleCompare((const char *) name,"line") == 0)
{
- MVGPrintf(svg_info->file,"line %.15g,%.15g %.15g,%.15g\n",
+ MVGPrintf(svg_info->file,"line %g,%g %g,%g\n",
svg_info->segment.x1,svg_info->segment.y1,svg_info->segment.x2,
svg_info->segment.y2);
MVGPrintf(svg_info->file,"pop graphic-context\n");
{
if ((svg_info->radius.x == 0.0) && (svg_info->radius.y == 0.0))
{
- MVGPrintf(svg_info->file,"rectangle %.15g,%.15g %.15g,%.15g\n",
+ MVGPrintf(svg_info->file,"rectangle %g,%g %g,%g\n",
svg_info->bounds.x,svg_info->bounds.y,
svg_info->bounds.x+svg_info->bounds.width,
svg_info->bounds.y+svg_info->bounds.height);
if (svg_info->radius.y == 0.0)
svg_info->radius.y=svg_info->radius.x;
MVGPrintf(svg_info->file,
- "roundRectangle %.15g,%.15g %.15g,%.15g %.15g,%.15g\n",
+ "roundRectangle %g,%g %g,%g %g,%g\n",
svg_info->bounds.x,svg_info->bounds.y,svg_info->bounds.x+
svg_info->bounds.width,svg_info->bounds.y+svg_info->bounds.height,
svg_info->radius.x,svg_info->radius.y);
text=EscapeString(svg_info->text,'\'');
StripString(text);
- MVGPrintf(svg_info->file,"text %.15g,%.15g '%s'\n",
+ MVGPrintf(svg_info->file,"text %g,%g '%s'\n",
svg_info->bounds.x-svg_info->center.x,svg_info->bounds.y-
svg_info->center.y,text);
text=DestroyString(text);
text=EscapeString(svg_info->text,'\'');
StripString(text);
- MVGPrintf(svg_info->file,"text %.15g,%.15g '%s'\n",
+ MVGPrintf(svg_info->file,"text %g,%g '%s'\n",
svg_info->bounds.x,svg_info->bounds.y,text);
text=DestroyString(text);
draw_info=CloneDrawInfo(svg_info->image_info,(DrawInfo *) NULL);
register char
*p;
- register long
+ register ssize_t
i;
SVGInfo
Receiving some characters from the parser.
*/
(void) LogMagickEvent(CoderEvent,GetMagickModule(),
- " SAX.characters(%s,%lu)",c,(unsigned long) length);
+ " SAX.characters(%s,%.20g)",c,(double) length);
svg_info=(SVGInfo *) context;
if (svg_info->text != (char *) NULL)
svg_info->text=(char *) ResizeQuantumMemory(svg_info->text,
if (svg_info->text == (char *) NULL)
return;
p=svg_info->text+strlen(svg_info->text);
- for (i=0; i < (long) length; i++)
+ for (i=0; i < (ssize_t) length; i++)
*p++=c[i];
*p='\0';
}
(void) LogMagickEvent(CoderEvent,GetMagickModule(),
" SAX.ignorableWhitespace(%.30s, %d)",c,length);
svg_info=(SVGInfo *) context;
+ (void) svg_info;
}
static void SVGProcessingInstructions(void *context,const xmlChar *target,
(void) LogMagickEvent(CoderEvent,GetMagickModule(),
" SAX.processingInstruction(%s, %s)",target,data);
svg_info=(SVGInfo *) context;
+ (void) svg_info;
}
static void SVGComment(void *context,const xmlChar *value)
}
#if defined(MAGICKCORE_RSVG_DELEGATE)
-#if !defined(MAGICKCORE_CAIRO_DELEGATE)
static void SVGSetImageSize(int *width,int *height,gpointer context)
{
Image
*height=(int) (*height*image->y_resolution/72.0);
}
#endif
-#endif
#if defined(__cplusplus) || defined(c_plusplus)
}
status,
unique_file;
- long
+ ssize_t
n;
SVGInfo
GError
*error;
- long
+ ssize_t
y;
PixelPacket
fill_color;
- register long
+ register ssize_t
x;
register PixelPacket
if (svg_handle == (RsvgHandle *) NULL)
ThrowReaderException(ResourceLimitError,"MemoryAllocationFailed");
rsvg_handle_set_base_uri(svg_handle,image_info->filename);
-#if !defined(MAGICKCORE_CAIRO_DELEGATE)
rsvg_handle_set_size_callback(svg_handle,SVGSetImageSize,image,NULL);
-#endif
if ((image->x_resolution != 72.0) && (image->y_resolution != 72.0))
rsvg_handle_set_dpi_x_y(svg_handle,image->x_resolution,
image->y_resolution);
#else
p=gdk_pixbuf_get_pixels(pixel_info);
#endif
- for (y=0; y < (long) image->rows; y++)
+ for (y=0; y < (ssize_t) image->rows; y++)
{
q=GetAuthenticPixels(image,0,y,image->columns,1,exception);
if (q == (PixelPacket *) NULL)
break;
- for (x=0; x < (long) image->columns; x++)
+ for (x=0; x < (ssize_t) image->columns; x++)
{
#if defined(MAGICKCORE_CAIRO_DELEGATE)
fill_color.blue=ScaleCharToQuantum(*p++);
break;
if (image->previous == (Image *) NULL)
{
- status=SetImageProgress(image,LoadImageTag,y,image->rows);
+ status=SetImageProgress(image,LoadImageTag,(MagickOffsetType) y,
+ image->rows);
if (status == MagickFalse)
break;
}
%
% The format of the RegisterSVGImage method is:
%
-% unsigned long RegisterSVGImage(void)
+% size_t RegisterSVGImage(void)
%
*/
-ModuleExport unsigned long RegisterSVGImage(void)
+ModuleExport size_t RegisterSVGImage(void)
{
char
version[MaxTextExtent];
return;
}
(void) FormatMagickString(transform,MaxTextExtent,
- "\" transform=\"scale(%.15g,%.15g)\">\n",affine->sx,affine->sy);
+ "\" transform=\"scale(%g,%g)\">\n",affine->sx,affine->sy);
(void) WriteBlobString(image,transform);
return;
}
theta=(180.0/MagickPI)*atan2(affine->rx,affine->sx);
(void) FormatMagickString(transform,MaxTextExtent,
- "\" transform=\"rotate(%.15g)\">\n",theta);
+ "\" transform=\"rotate(%g)\">\n",theta);
(void) WriteBlobString(image,transform);
return;
}
(fabs(affine->sy-1.0) < MagickEpsilon))
{
(void) FormatMagickString(transform,MaxTextExtent,
- "\" transform=\"translate(%.15g,%.15g)\">\n",affine->tx,affine->ty);
+ "\" transform=\"translate(%g,%g)\">\n",affine->tx,affine->ty);
(void) WriteBlobString(image,transform);
return;
}
}
(void) FormatMagickString(transform,MaxTextExtent,
- "\" transform=\"matrix(%.15g %.15g %.15g %.15g %.15g %.15g)\">\n",
+ "\" transform=\"matrix(%g %g %g %g %g %g)\">\n",
affine->sx,affine->rx,affine->ry,affine->sy,affine->tx,affine->ty);
(void) WriteBlobString(image,transform);
}
char
*p;
- long
+ ssize_t
value;
value=strtol(point,&p,10);
+ (void) value;
return(p != point ? MagickTrue : MagickFalse);
}
static MagickBooleanType TraceSVGImage(Image *image)
{
- long
+ ssize_t
y;
register const PixelPacket
*p;
- register long
+ register ssize_t
x;
#if defined(MAGICKCORE_AUTOTRACE_DELEGATE)
ImageType
type;
- register long
+ register ssize_t
i;
- unsigned long
+ size_t
number_planes;
/*
number_planes=1;
trace=at_bitmap_new(image->columns,image->rows,number_planes);
i=0;
- for (y=0; y < (long) image->rows; y++)
+ for (y=0; y < (ssize_t) image->rows; y++)
{
p=GetVirtualPixels(image,0,y,image->columns,1,&image->exception);
if (p == (const PixelPacket *) NULL)
break;
- for (x=0; x < (long) image->columns; x++)
+ for (x=0; x < (ssize_t) image->columns; x++)
{
- trace->bitmap[i++]=GetRedSample(p);
+ trace->bitmap[i++]=GetRedPixelComponent(p);
if (number_planes == 3)
{
- trace->bitmap[i++]=GetGreenSample(p);
- trace->bitmap[i++]=GetBlueSample(p);
+ trace->bitmap[i++]=GetGreenPixelComponent(p);
+ trace->bitmap[i++]=GetBluePixelComponent(p);
}
p++;
}
(void) WriteBlobString(image,
" \"http://www.w3.org/TR/2001/REC-SVG-20010904/DTD/svg10.dtd\">\n");
(void) FormatMagickString(message,MaxTextExtent,
- "<svg width=\"%lu\" height=\"%lu\">\n",image->columns,image->rows);
+ "<svg width=\"%.20g\" height=\"%.20g\">\n",(double) image->columns,
+ (double) image->rows);
(void) WriteBlobString(image,message);
GetMagickPixelPacket(image,&pixel);
- for (y=0; y < (long) image->rows; y++)
+ for (y=0; y < (ssize_t) image->rows; y++)
{
p=GetVirtualPixels(image,0,y,image->columns,1,&image->exception);
if (p == (const PixelPacket *) NULL)
break;
indexes=GetVirtualIndexQueue(image);
- for (x=0; x < (long) image->columns; x++)
+ for (x=0; x < (ssize_t) image->columns; x++)
{
SetMagickPixelPacket(image,p,indexes+x,&pixel);
(void) QueryMagickColorname(image,&pixel,SVGCompliance,tuple,
&image->exception);
(void) FormatMagickString(message,MaxTextExtent,
- " <circle cx=\"%ld\" cy=\"%ld\" r=\"1\" fill=\"%s\"/>\n",x,y,tuple);
+ " <circle cx=\"%.20g\" cy=\"%.20g\" r=\"1\" fill=\"%s\"/>\n",
+ (double) x,(double) y,tuple);
(void) WriteBlobString(image,message);
p++;
}
int
n;
- long
+ ssize_t
j;
MagickBooleanType
PrimitiveType
primitive_type;
- register long
+ register ssize_t
x;
- register long
+ register ssize_t
i;
size_t
SVGInfo
svg_info;
- unsigned long
+ size_t
number_points;
/*
(void) WriteBlobString(image,
" \"http://www.w3.org/TR/2001/REC-SVG-20010904/DTD/svg10.dtd\">\n");
(void) FormatMagickString(message,MaxTextExtent,
- "<svg width=\"%lu\" height=\"%lu\">\n",image->columns,image->rows);
+ "<svg width=\"%.20g\" height=\"%.20g\">\n",(double) image->columns,(double)
+ image->rows);
(void) WriteBlobString(image,message);
/*
Allocate primitive info memory.
svg_info.segment.y2=StringToDouble(token);
svg_info.element.minor=StringToDouble(token);
(void) FormatMagickString(message,MaxTextExtent,
- "<%sGradient id=\"%s\" x1=\"%.15g\" y1=\"%.15g\" x2=\"%.15g\" "
- "y2=\"%.15g\">\n",type,name,svg_info.segment.x1,
+ "<%sGradient id=\"%s\" x1=\"%g\" y1=\"%g\" x2=\"%g\" "
+ "y2=\"%g\">\n",type,name,svg_info.segment.x1,
svg_info.segment.y1,svg_info.segment.x2,svg_info.segment.y2);
if (LocaleCompare(type,"radial") == 0)
{
GetMagickToken(q,&q,token);
svg_info.element.angle=StringToDouble(token);
(void) FormatMagickString(message,MaxTextExtent,
- "<%sGradient id=\"%s\" cx=\"%.15g\" cy=\"%.15g\" r=\"%.15g\" "
- "fx=\"%.15g\" fy=\"%.15g\">\n",type,name,
+ "<%sGradient id=\"%s\" cx=\"%g\" cy=\"%g\" r=\"%g\" "
+ "fx=\"%g\" fy=\"%g\">\n",type,name,
svg_info.element.cx,svg_info.element.cy,
svg_info.element.angle,svg_info.element.major,
svg_info.element.minor);
GetMagickToken(q,&q,token);
svg_info.bounds.height=StringToDouble(token);
(void) FormatMagickString(message,MaxTextExtent,
- "<pattern id=\"%s\" x=\"%.15g\" y=\"%.15g\" width=\"%.15g\" "
- "height=\"%.15g\">\n",name,svg_info.bounds.x,
+ "<pattern id=\"%s\" x=\"%g\" y=\"%g\" width=\"%g\" "
+ "height=\"%g\">\n",name,svg_info.bounds.x,
svg_info.bounds.y,svg_info.bounds.width,
svg_info.bounds.height);
(void) WriteBlobString(image,message);
{
if (IsPoint(q))
{
- long
+ ssize_t
k;
p=q;
primitive_info[i].coordinates=0;
primitive_info[i].method=FloodfillMethod;
i++;
- if (i < (long) (number_points-6*BezierQuantum-360))
+ if (i < (ssize_t) (number_points-6*BezierQuantum-360))
continue;
number_points+=6*BezierQuantum+360;
primitive_info=(PrimitiveInfo *) ResizeQuantumMemory(primitive_info,
break;
}
(void) FormatMagickString(message,MaxTextExtent,
- " <line x1=\"%.15g\" y1=\"%.15g\" x2=\"%.15g\" y2=\"%.15g\"/>\n",
+ " <line x1=\"%g\" y1=\"%g\" x2=\"%g\" y2=\"%g\"/>\n",
primitive_info[j].point.x,primitive_info[j].point.y,
primitive_info[j+1].point.x,primitive_info[j+1].point.y);
(void) WriteBlobString(image,message);
break;
}
(void) FormatMagickString(message,MaxTextExtent,
- " <rect x=\"%.15g\" y=\"%.15g\" width=\"%.15g\" height=\"%.15g\"/>\n",
+ " <rect x=\"%g\" y=\"%g\" width=\"%g\" height=\"%g\"/>\n",
primitive_info[j].point.x,primitive_info[j].point.y,
primitive_info[j+1].point.x-primitive_info[j].point.x,
primitive_info[j+1].point.y-primitive_info[j].point.y);
break;
}
(void) FormatMagickString(message,MaxTextExtent,
- " <rect x=\"%.15g\" y=\"%.15g\" width=\"%.15g\" height=\"%.15g\" rx=\"%.15g\" "
- "ry=\"%.15g\"/>\n",primitive_info[j].point.x,
+ " <rect x=\"%g\" y=\"%g\" width=\"%g\" height=\"%g\" rx=\"%g\" "
+ "ry=\"%g\"/>\n",primitive_info[j].point.x,
primitive_info[j].point.y,primitive_info[j+1].point.x-
primitive_info[j].point.x,primitive_info[j+1].point.y-
primitive_info[j].point.y,primitive_info[j+2].point.x,
break;
}
(void) FormatMagickString(message,MaxTextExtent,
- " <ellipse cx=\"%.15g\" cy=\"%.15g\" rx=\"%.15g\" ry=\"%.15g\"/>\n",
+ " <ellipse cx=\"%g\" cy=\"%g\" rx=\"%g\" ry=\"%g\"/>\n",
primitive_info[j].point.x,primitive_info[j].point.y,
primitive_info[j+1].point.x,primitive_info[j+1].point.y);
(void) WriteBlobString(image,message);
alpha=primitive_info[j+1].point.x-primitive_info[j].point.x;
beta=primitive_info[j+1].point.y-primitive_info[j].point.y;
(void) FormatMagickString(message,MaxTextExtent,
- " <circle cx=\"%.15g\" cy=\"%.15g\" r=\"%.15g\"/>\n",
+ " <circle cx=\"%g\" cy=\"%g\" r=\"%g\"/>\n",
primitive_info[j].point.x,primitive_info[j].point.y,
hypot(alpha,beta));
(void) WriteBlobString(image,message);
length=strlen(message);
for ( ; j < i; j++)
{
- (void) FormatMagickString(message,MaxTextExtent,"%.15g,%.15g ",
+ (void) FormatMagickString(message,MaxTextExtent,"%g,%g ",
primitive_info[j].point.x,primitive_info[j].point.y);
length+=strlen(message);
if (length >= 80)
length=strlen(message);
for ( ; j < i; j++)
{
- (void) FormatMagickString(message,MaxTextExtent,"%.15g,%.15g ",
+ (void) FormatMagickString(message,MaxTextExtent,"%g,%g ",
primitive_info[j].point.x,primitive_info[j].point.y);
length+=strlen(message);
if (length >= 80)
for (p=token; *p != '\0'; p++)
if (isalpha((int) *p))
number_attributes++;
- if (i > (long) (number_points-6*BezierQuantum*number_attributes-1))
+ if (i > (ssize_t) (number_points-6*BezierQuantum*number_attributes-1))
{
number_points+=6*BezierQuantum*number_attributes;
primitive_info=(PrimitiveInfo *) ResizeQuantumMemory(primitive_info,
}
GetMagickToken(q,&q,token);
(void) FormatMagickString(message,MaxTextExtent,
- " <text x=\"%.15g\" y=\"%.15g\">",primitive_info[j].point.x,
+ " <text x=\"%g\" y=\"%g\">",primitive_info[j].point.x,
primitive_info[j].point.y);
(void) WriteBlobString(image,message);
for (p=token; *p != '\0'; p++)
}
GetMagickToken(q,&q,token);
(void) FormatMagickString(message,MaxTextExtent,
- " <image x=\"%.15g\" y=\"%.15g\" width=\"%.15g\" height=\"%.15g\" "
+ " <image x=\"%g\" y=\"%g\" width=\"%g\" height=\"%g\" "
"xlink:href=\"%s\"/>\n",primitive_info[j].point.x,
primitive_info[j].point.y,primitive_info[j+1].point.x,
primitive_info[j+1].point.y,token);