]> granicus.if.org Git - imagemagick/blobdiff - wand/drawing-wand.c
(no commit message)
[imagemagick] / wand / drawing-wand.c
index e1eeb20df9d60afb863bf2a646c63b2319a724da..e7eccec364065c9f04a414c2034df47599a19cea 100644 (file)
@@ -562,8 +562,8 @@ WandExport DrawingWand *CloneDrawingWand(const DrawingWand *wand)
       "MemoryAllocationFailed",GetExceptionMessage(errno));
   (void) ResetMagickMemory(clone_wand,0,sizeof(*clone_wand));
   clone_wand->id=AcquireWandId();
-  (void) FormatMagickString(clone_wand->name,MaxTextExtent,"DrawingWand-%lu",
-    clone_wand->id);
+  (void) FormatMagickString(clone_wand->name,MaxTextExtent,"DrawingWand-%.20g",
+    (double) clone_wand->id);
   clone_wand->exception=AcquireExceptionInfo();
   InheritException(clone_wand->exception,wand->exception);
   clone_wand->mvg=AcquireString(wand->mvg);
@@ -1033,7 +1033,7 @@ WandExport MagickBooleanType DrawComposite(DrawingWand *wand,
       char
         buffer[MaxTextExtent];
 
-      (void) FormatMagickString(buffer,MaxTextExtent,"%ld bytes",
+      (void) FormatMagickString(buffer,MaxTextExtent,"%.20g bytes",(double)
         (4L*blob_length/3L+4L));
       ThrowDrawException(ResourceLimitWarning,"MemoryAllocationFailed",
         wand->name);
@@ -1228,7 +1228,7 @@ WandExport void DrawGetBorderColor(const DrawingWand *wand,
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 %
 %  DrawGetClipPath() obtains the current clipping path ID. The value returned
-%  must be deallocated by the user when it is no ssize_ter needed.
+%  must be deallocated by the user when it is no longer needed.
 %
 %  The format of the DrawGetClipPath method is:
 %
@@ -1519,7 +1519,7 @@ WandExport FillRule DrawGetFillRule(const DrawingWand *wand)
 %
 %  DrawGetFont() returns a null-terminaged string specifying the font used
 %  when annotating with text. The value returned must be freed by the user
-%  when no ssize_ter needed.
+%  when no longer needed.
 %
 %  The format of the DrawGetFont method is:
 %
@@ -1553,7 +1553,7 @@ WandExport char *DrawGetFont(const DrawingWand *wand)
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 %
 %  DrawGetFontFamily() returns the font family to use when annotating with text.
-%  The value returned must be freed by the user when it is no ssize_ter needed.
+%  The value returned must be freed by the user when it is no longer needed.
 %
 %  The format of the DrawGetFontFamily method is:
 %
@@ -1850,7 +1850,7 @@ WandExport void DrawGetStrokeColor(const DrawingWand *wand,
 %
 %  DrawGetStrokeDashArray() returns an array representing the pattern of
 %  dashes and gaps used to stroke paths (see DrawSetStrokeDashArray). The
-%  array must be freed once it is no ssize_ter required by the user.
+%  array must be freed once it is no longer required by the user.
 %
 %  The format of the DrawGetStrokeDashArray method is:
 %
@@ -2216,7 +2216,7 @@ WandExport DecorationType DrawGetTextDecoration(const DrawingWand *wand)
 %
 %  DrawGetTextEncoding() returns a null-terminated string which specifies the
 %  code set used for text annotations. The string must be freed by the user
-%  once it is no ssize_ter required.
+%  once it is no longer required.
 %
 %  The format of the DrawGetTextEncoding method is:
 %
@@ -2345,7 +2345,7 @@ WandExport double DrawGetTextInterwordSpacing(DrawingWand *wand)
 %
 %  DrawGetVectorGraphics() returns a null-terminated string which specifies the
 %  vector graphics generated by any graphics calls made since the wand was
-%  instantiated.  The string must be freed by the user once it is no ssize_ter
+%  instantiated.  The string must be freed by the user once it is no longer
 %  required.
 %
 %  The format of the DrawGetVectorGraphics method is:
@@ -2471,7 +2471,7 @@ WandExport char *DrawGetVectorGraphics(DrawingWand *wand)
   child=AddChildToXMLTree(xml_info,"font-weight",0);
   if (child != (XMLTreeInfo *) NULL)
     {
-      (void) FormatMagickString(value,MaxTextExtent,"%lu",
+      (void) FormatMagickString(value,MaxTextExtent,"%.20g",(double)
         CurrentContext->weight);
       (void) SetXMLTreeContent(child,value);
     }
@@ -2537,13 +2537,14 @@ WandExport char *DrawGetVectorGraphics(DrawingWand *wand)
   if (child != (XMLTreeInfo *) NULL)
     {
       (void) CopyMagickString(value,MagickOptionToMnemonic(
-        MagickLineJoinOptions,(ssize_t) CurrentContext->linejoin),MaxTextExtent);
+        MagickLineJoinOptions,(ssize_t) CurrentContext->linejoin),
+        MaxTextExtent);
       (void) SetXMLTreeContent(child,value);
     }
   child=AddChildToXMLTree(xml_info,"stroke-miterlimit",0);
   if (child != (XMLTreeInfo *) NULL)
     {
-      (void) FormatMagickString(value,MaxTextExtent,"%lu",
+      (void) FormatMagickString(value,MaxTextExtent,"%.20g",(double)
         CurrentContext->miterlimit);
       (void) SetXMLTreeContent(child,value);
     }
@@ -4026,9 +4027,9 @@ WandExport MagickBooleanType DrawPopPattern(DrawingWand *wand)
     }
   (void) FormatMagickString(key,MaxTextExtent,"%s",wand->pattern_id);
   (void) SetImageArtifact(wand->image,key,wand->mvg+wand->pattern_offset);
-  (void) FormatMagickString(geometry,MaxTextExtent,"%lux%lu%+ld%+ld",
-    wand->pattern_bounds.width,wand->pattern_bounds.height,
-    wand->pattern_bounds.x,wand->pattern_bounds.y);
+  (void) FormatMagickString(geometry,MaxTextExtent,"%.20gx%.20g%+.20g%+.20g",
+    (double) wand->pattern_bounds.width,(double) wand->pattern_bounds.height,
+    (double) wand->pattern_bounds.x,(double) wand->pattern_bounds.y);
   (void) SetImageArtifact(wand->image,key,geometry);
   wand->pattern_id=DestroyString(wand->pattern_id);
   wand->pattern_offset=0;
@@ -4770,7 +4771,7 @@ WandExport void DrawSetOpacity(DrawingWand *wand,const double opacity)
   if ((wand->filter_off != MagickFalse) ||
       (CurrentContext->opacity != quantum_opacity))
     {
-      CurrentContext->opacity=opacity;
+      CurrentContext->opacity=(Quantum) opacity;
       (void) MvgPrintf(wand,"opacity %g\n",opacity);
     }
 }
@@ -5123,7 +5124,7 @@ WandExport void DrawSetFontWeight(DrawingWand *wand,
       (CurrentContext->weight != font_weight))
     {
       CurrentContext->weight=font_weight;
-      (void) MvgPrintf(wand,"font-weight %lu\n",font_weight);
+      (void) MvgPrintf(wand,"font-weight %.20g\n",(double) font_weight);
     }
 }
 \f
@@ -5608,7 +5609,7 @@ WandExport void DrawSetStrokeMiterLimit(DrawingWand *wand,
   if (CurrentContext->miterlimit != miterlimit)
     {
       CurrentContext->miterlimit=miterlimit;
-      (void) MvgPrintf(wand,"stroke-miterlimit %lu\n",miterlimit);
+      (void) MvgPrintf(wand,"stroke-miterlimit %.20g\n",(double) miterlimit);
     }
 }
 \f
@@ -6070,7 +6071,7 @@ static inline MagickBooleanType IsPoint(const char *point)
   char
     *p;
 
-  ssize_t
+  long
     value;
 
   value=strtol(point,&p,10);
@@ -6500,14 +6501,15 @@ WandExport void DrawTranslate(DrawingWand *wand,const double x,const double y)
 %    o y2: bottom y ordinate
 %
 */
-WandExport void DrawSetViewbox(DrawingWand *wand,size_t x1,
-  size_t y1,size_t x2,size_t y2)
+WandExport void DrawSetViewbox(DrawingWand *wand,ssize_t x1,ssize_t y1,
+  ssize_t x2,ssize_t y2)
 {
   assert(wand != (DrawingWand *) NULL);
   assert(wand->signature == WandSignature);
   if (wand->debug != MagickFalse)
     (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
-  (void) MvgPrintf(wand,"viewbox %lu %lu %lu %lu\n",x1,y1,x2,y2);
+  (void) MvgPrintf(wand,"viewbox %.20g %.20g %.20g %.20g\n",(double) x1,
+    (double) y1,(double) x2,(double) y2);
 }
 \f
 /*
@@ -6582,8 +6584,8 @@ WandExport DrawingWand *NewDrawingWand(void)
       GetExceptionMessage(errno));
   (void) ResetMagickMemory(wand,0,sizeof(*wand));
   wand->id=AcquireWandId();
-  (void) FormatMagickString(wand->name,MaxTextExtent,"%s-%lu",DrawingWandId,
-    wand->id);
+  (void) FormatMagickString(wand->name,MaxTextExtent,"%s-%.20g",DrawingWandId,
+    (double) wand->id);
   if (wand->debug != MagickFalse)
     (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
   wand->mvg=(char *) NULL;