]> granicus.if.org Git - imagemagick/blobdiff - coders/uil.c
(no commit message)
[imagemagick] / coders / uil.c
index 6dd194524cf119aa2b34f6ceb3b33cca6ea5a0c6..555b531d37a6120c7cdc27c57108dd03af45e3d3 100644 (file)
 %                          Write X-Motif UIL Table.                           %
 %                                                                             %
 %                              Software Design                                %
-%                                John Cristy                                  %
+%                                   Cristy                                    %
 %                                 July 1992                                   %
 %                                                                             %
 %                                                                             %
-%  Copyright 1999-2012 ImageMagick Studio LLC, a non-profit organization      %
+%  Copyright 1999-2015 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  %
@@ -98,7 +98,7 @@ ModuleExport size_t RegisterUILImage(void)
 
   entry=SetMagickInfo("UIL");
   entry->encoder=(EncodeImageHandler *) WriteUILImage;
-  entry->adjoin=MagickFalse;
+  entry->flags^=CoderAdjoinFlag;
   entry->description=ConstantString("X-Motif UIL table");
   entry->module=ConstantString("UIL");
   (void) RegisterMagickInfo(entry);
@@ -214,8 +214,7 @@ static MagickBooleanType WriteUILImage(const ImageInfo *image_info,Image *image,
   status=OpenBlob(image_info,image,WriteBinaryBlobMode,exception);
   if (status == MagickFalse)
     return(status);
-  if (IssRGBCompatibleColorspace(image->colorspace) == MagickFalse)
-    (void) TransformImageColorspace(image,sRGBColorspace,exception);
+  (void) TransformImageColorspace(image,sRGBColorspace,exception);
   transparent=MagickFalse;
   i=0;
   p=(const Quantum *) NULL;
@@ -230,7 +229,7 @@ static MagickBooleanType WriteUILImage(const ImageInfo *image_info,Image *image,
         Convert DirectClass to PseudoClass image.
       */
       matte_image=(unsigned char *) NULL;
-      if (image->alpha_trait == BlendPixelTrait)
+      if (image->alpha_trait != UndefinedPixelTrait)
         {
           /*
             Map all the transparent pixels.
@@ -275,7 +274,6 @@ static MagickBooleanType WriteUILImage(const ImageInfo *image_info,Image *image,
             {
               if (matte_image[i] != 0)
                 SetPixelIndex(image,image->colors,q);
-              p++;
               q+=GetPixelChannels(image);
             }
           }
@@ -330,8 +328,8 @@ static MagickBooleanType WriteUILImage(const ImageInfo *image_info,Image *image,
     else
       (void) FormatLocaleString(buffer,MaxTextExtent,
         "    color('%s',%s) = '%s'",name,
-        GetPixelInfoIntensity(image->colormap+i) <
-        (QuantumRange/2) ? "background" : "foreground",symbol);
+        GetPixelInfoIntensity(image,image->colormap+i) <
+        (QuantumRange/2.0) ? "background" : "foreground",symbol);
     (void) WriteBlobString(image,buffer);
     (void) FormatLocaleString(buffer,MaxTextExtent,"%s",
       (i == (ssize_t) (colors-1) ? ");\n" : ",\n"));