]> granicus.if.org Git - imagemagick/blobdiff - coders/xc.c
Accommodate background color index in PLTE chunk
[imagemagick] / coders / xc.c
index 59b81700d323997dfd96b4df96add7dc3bab4794..8299a5092cabc5a0aa1190152bcc6754fe8c8217 100644 (file)
@@ -17,7 +17,7 @@
 %                                 July 1992                                   %
 %                                                                             %
 %                                                                             %
-%  Copyright 1999-2011 ImageMagick Studio LLC, a non-profit organization      %
+%  Copyright 1999-2012 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  %
@@ -96,9 +96,6 @@ static Image *ReadXCImage(const ImageInfo *image_info,ExceptionInfo *exception)
   MagickBooleanType
     status;
 
-  PixelInfo
-    color;
-
   PixelInfo
     pixel;
 
@@ -128,16 +125,14 @@ static Image *ReadXCImage(const ImageInfo *image_info,ExceptionInfo *exception)
     image->rows=1;
   (void) CopyMagickString(image->filename,image_info->filename,MaxTextExtent);
   status=QueryColorCompliance((char *) image_info->filename,AllCompliance,
-    &color,exception);
+    &pixel,exception);
   if (status == MagickFalse)
     {
       image=DestroyImage(image);
       return((Image *) NULL);
     }
-  image->colorspace=color.colorspace;
-  image->matte=color.matte;
-  pixel.black=0;
-  SetPixelInfo(image,&color,&pixel);
+  SetImageColorspace(image,pixel.colorspace,exception);
+  image->matte=pixel.matte;
   for (y=0; y < (ssize_t) image->rows; y++)
   {
     q=QueueAuthenticPixels(image,0,y,image->columns,1,exception);
@@ -146,8 +141,6 @@ static Image *ReadXCImage(const ImageInfo *image_info,ExceptionInfo *exception)
     for (x=0; x < (ssize_t) image->columns; x++)
     {
       SetPixelInfoPixel(image,&pixel,q);
-      if (image->colorspace == CMYKColorspace)
-        SetPixelBlack(image,pixel.black,q);
       q+=GetPixelChannels(image);
     }
     if (SyncAuthenticPixels(image,exception) == MagickFalse)