]> granicus.if.org Git - imagemagick/commitdiff
(no commit message)
authorcristy <urban-warrior@git.imagemagick.org>
Sun, 12 Apr 2015 13:18:38 +0000 (13:18 +0000)
committercristy <urban-warrior@git.imagemagick.org>
Sun, 12 Apr 2015 13:18:38 +0000 (13:18 +0000)
coders/pcl.c
coders/pdf.c
coders/ps.c
coders/svg.c
coders/xps.c

index d978a4bd8eed52695e90fefdbfd8b0f6d5d8236d..81163c14562e6e1baac760bd88ccc7743fd96d7f 100644 (file)
@@ -152,10 +152,10 @@ static Image *ReadPCLImage(const ImageInfo *image_info,ExceptionInfo *exception)
 
   char
     command[MaxTextExtent],
-    density[MaxTextExtent],
+    *density,
     filename[MaxTextExtent],
     geometry[MaxTextExtent],
-    options[MaxTextExtent],
+    *options,
     input_filename[MaxTextExtent];
 
   const char
@@ -323,16 +323,16 @@ static Image *ReadPCLImage(const ImageInfo *image_info,ExceptionInfo *exception)
        delegate_info=GetDelegateInfo("pcl:color",(char *) NULL,exception);
   if (delegate_info == (const DelegateInfo *) NULL)
     return((Image *) NULL);
-  *options='\0';
   if ((page.width == 0) || (page.height == 0))
     (void) ParseAbsoluteGeometry(PSPageGeometry,&page);
   if (image_info->page != (char *) NULL)
     (void) ParseAbsoluteGeometry(image_info->page,&page);
-  (void) FormatLocaleString(density,MaxTextExtent,"%gx%g",
-    image->resolution.x,image->resolution.y);
+  density=AcquireString("");
+  options=AcquireString("");
+  (void) FormatLocaleString(density,MaxTextExtent,"%gx%g",image->resolution.x,
+    image->resolution.y);
   page.width=(size_t) floor(page.width*image->resolution.x/delta.x+0.5);
-  page.height=(size_t) floor(page.height*image->resolution.y/delta.y+
-    0.5);
+  page.height=(size_t) floor(page.height*image->resolution.y/delta.y+0.5);
   (void) FormatLocaleString(options,MaxTextExtent,"-g%.20gx%.20g ",(double)
      page.width,(double) page.height);
   image=DestroyImage(image);
@@ -362,6 +362,8 @@ static Image *ReadPCLImage(const ImageInfo *image_info,ExceptionInfo *exception)
     read_info->antialias != MagickFalse ? 4 : 1,
     read_info->antialias != MagickFalse ? 4 : 1,density,options,
     read_info->filename,input_filename);
+  options=DestroyString(options);
+  density=DestroyString(density);
   status=ExternalDelegateCommand(MagickFalse,read_info->verbose,command,
     (char *) NULL,exception) != 0 ? MagickTrue : MagickFalse;
   image=ReadImage(read_info,exception);
index e94bc3273271522d3af3a4c133176946c4d54ca3..7376bdaf0f202a471d7e215dfa879db277f0dca7 100644 (file)
@@ -381,12 +381,12 @@ static Image *ReadPDFImage(const ImageInfo *image_info,ExceptionInfo *exception)
 
   char
     command[MaxTextExtent],
-    density[MaxTextExtent],
+    *density,
     filename[MaxTextExtent],
     geometry[MaxTextExtent],
     input_filename[MaxTextExtent],
     message[MaxTextExtent],
-    options[MaxTextExtent],
+    *options,
     postscript_filename[MaxTextExtent];
 
   const char
@@ -705,7 +705,8 @@ static Image *ReadPDFImage(const ImageInfo *image_info,ExceptionInfo *exception)
       image=DestroyImage(image);
       return((Image *) NULL);
     }
-  *options='\0';
+  density=AcquireString("");
+  options=AcquireString("");
   (void) FormatLocaleString(density,MaxTextExtent,"%gx%g",image->resolution.x,
     image->resolution.y);
   if ((image_info->page != (char *) NULL) || (fitPage != MagickFalse))
@@ -749,6 +750,8 @@ static Image *ReadPDFImage(const ImageInfo *image_info,ExceptionInfo *exception)
     read_info->antialias != MagickFalse ? 4 : 1,
     read_info->antialias != MagickFalse ? 4 : 1,density,options,filename,
     postscript_filename,input_filename);
+  options=DestroyString(options);
+  density=DestroyString(density);
   *message='\0';
   status=InvokePDFDelegate(read_info->verbose,command,message,exception);
   (void) RelinquishUniqueFileResource(postscript_filename);
index 0fb50bf235b9815cbcfa7df53c981139b261e97f..7385694461e70663d1c6dca6d8f90221106de02c 100644 (file)
@@ -414,12 +414,12 @@ static Image *ReadPSImage(const ImageInfo *image_info,ExceptionInfo *exception)
 
   char
     command[MaxTextExtent],
-    density[MaxTextExtent],
+    *density,
     filename[MaxTextExtent],
     geometry[MaxTextExtent],
     input_filename[MaxTextExtent],
     message[MaxTextExtent],
-    options[MaxTextExtent],
+    *options,
     postscript_filename[MaxTextExtent];
 
   const char
@@ -864,7 +864,8 @@ static Image *ReadPSImage(const ImageInfo *image_info,ExceptionInfo *exception)
       image=DestroyImageList(image);
       return((Image *) NULL);
     }
-  *options='\0';
+  density=AcquireString("");
+  options=AcquireString("");
   (void) FormatLocaleString(density,MaxTextExtent,"%gx%g",resolution.x,
     resolution.y);
   (void) FormatLocaleString(options,MaxTextExtent,"-g%.20gx%.20g ",(double)
@@ -902,6 +903,8 @@ static Image *ReadPSImage(const ImageInfo *image_info,ExceptionInfo *exception)
     read_info->antialias != MagickFalse ? 4 : 1,
     read_info->antialias != MagickFalse ? 4 : 1,density,options,filename,
     postscript_filename,input_filename);
+  options=DestroyString(options);
+  density=DestroyString(density);
   *message='\0';
   status=InvokePostscriptDelegate(read_info->verbose,command,message,exception);
   (void) InterpretImageFilename(image_info,image,filename,1,
index 7db99cbe6b493a62bf545ae01cec51b07fce28eb..e9cb5aa3d80be7e69508f6091dabce9a9a9dc4a4 100644 (file)
@@ -2819,7 +2819,7 @@ static Image *ReadSVGImage(const ImageInfo *image_info,ExceptionInfo *exception)
           char
             background[MaxTextExtent],
             command[MaxTextExtent],
-            density[MaxTextExtent],
+            *density,
             input_filename[MaxTextExtent],
             opacity[MaxTextExtent],
             output_filename[MaxTextExtent],
@@ -2837,6 +2837,7 @@ static Image *ReadSVGImage(const ImageInfo *image_info,ExceptionInfo *exception)
           status=AcquireUniqueSymbolicLink(image->filename,input_filename);
           (void) AcquireUniqueFilename(output_filename);
           (void) AcquireUniqueFilename(unique);
+          density=AcquireString("");
           (void) FormatLocaleString(density,MaxTextExtent,"%.20g,%.20g",
             image->resolution.x,image->resolution.y);
           (void) FormatLocaleString(background,MaxTextExtent,
@@ -2849,6 +2850,7 @@ static Image *ReadSVGImage(const ImageInfo *image_info,ExceptionInfo *exception)
           (void) FormatLocaleString(command,MaxTextExtent,GetDelegateCommands(
             delegate_info),input_filename,output_filename,density,background,
             opacity,unique);
+          density=DestroyString(density);
           status=ExternalDelegateCommand(MagickFalse,image_info->verbose,
             command,(char *) NULL,exception);
           (void) RelinquishUniqueFileResource(unique);
index af6e89329d631116b81579611e6b7c8628af8f2c..41ce5416f8f541872ca691c2ffdc1914d8be1cc0 100644 (file)
@@ -106,10 +106,10 @@ static Image *ReadXPSImage(const ImageInfo *image_info,ExceptionInfo *exception)
 
   char
     command[MaxTextExtent],
-    density[MaxTextExtent],
+    *density,
     filename[MaxTextExtent],
     geometry[MaxTextExtent],
-    options[MaxTextExtent],
+    *options,
     input_filename[MaxTextExtent];
 
   const char
@@ -196,8 +196,6 @@ static Image *ReadXPSImage(const ImageInfo *image_info,ExceptionInfo *exception)
       if ((flags & SigmaValue) == 0)
         image->resolution.y=image->resolution.x;
     }
-  (void) FormatLocaleString(density,MaxTextExtent,"%gx%g",
-    image->resolution.x,image->resolution.y);
   /*
     Determine page geometry from the XPS media box.
   */
@@ -279,7 +277,10 @@ static Image *ReadXPSImage(const ImageInfo *image_info,ExceptionInfo *exception)
        delegate_info=GetDelegateInfo("xps:color",(char *) NULL,exception);
   if (delegate_info == (const DelegateInfo *) NULL)
     return((Image *) NULL);
-  *options='\0';
+  density=AcquireString("");
+  options=AcquireString("");
+  (void) FormatLocaleString(density,MaxTextExtent,"%gx%g",
+    image->resolution.x,image->resolution.y);
   if ((page.width == 0) || (page.height == 0))
     (void) ParseAbsoluteGeometry(PSPageGeometry,&page);
   if (image_info->page != (char *) NULL)
@@ -315,6 +316,8 @@ static Image *ReadXPSImage(const ImageInfo *image_info,ExceptionInfo *exception)
     read_info->antialias != MagickFalse ? 4 : 1,
     read_info->antialias != MagickFalse ? 4 : 1,density,options,
     read_info->filename,input_filename);
+  options=DestroyString(options);
+  density=DestroyString(density);
   status=ExternalDelegateCommand(MagickFalse,read_info->verbose,command,
     (char *) NULL,exception) != 0 ? MagickTrue : MagickFalse;
   image=ReadImage(read_info,exception);