]> granicus.if.org Git - imagemagick/blobdiff - coders/txt.c
(no commit message)
[imagemagick] / coders / txt.c
index 6c74bd00ffddd401ddc9e9e0ad182391c0c37198..52822789fe6126feaa3221675fc6d47c9749d1e6 100644 (file)
@@ -706,9 +706,6 @@ static MagickBooleanType WriteTXTImage(const ImageInfo *image_info,Image *image,
         break;
       for (x=0; x < (ssize_t) image->columns; x++)
       {
-        (void) FormatLocaleString(buffer,MaxTextExtent,"%.20g,%.20g ",(double)
-          x,(double) y);
-        (void) WriteBlobString(image,buffer);
         GetPixelInfoPixel(image,p,&pixel);
         if (pixel.colorspace == LabColorspace)
           {
@@ -722,15 +719,20 @@ static MagickBooleanType WriteTXTImage(const ImageInfo *image_info,Image *image,
             */
             if (GetPixelAlpha(image,p) == (Quantum) OpaqueAlpha)
               {
-                (void) QueryColorname(image,&pixel,SVGCompliance,tuple,exception);
-                (void) WriteBlobString(image," ");
+                (void) QueryColorname(image,&pixel,SVGCompliance,tuple,
+                  exception);
+                (void) FormatLocaleString(buffer,MaxTextExtent,"%.20g,%.20g ",
+                  (double) x,(double) y);
+                (void) WriteBlobString(image,buffer);
                 (void) WriteBlobString(image,tuple);
                 (void) WriteBlobString(image," ");
               }
             p+=GetPixelChannels(image);
             continue;
           }
-        (void) WriteBlobString(image,": ");
+        (void) FormatLocaleString(buffer,MaxTextExtent,"%.20g,%.20g: ",(double)
+          x,(double) y);
+        (void) WriteBlobString(image,buffer);
         (void) CopyMagickString(tuple,"(",MaxTextExtent);
         if (pixel.colorspace == GRAYColorspace)
           ConcatenateColorComponent(&pixel,GrayPixelChannel,X11Compliance,