% July 1992 %
% %
% %
-% Copyright 1999-2010 ImageMagick Studio LLC, a non-profit organization %
+% Copyright 1999-2011 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 %
*/
static int CompareXPMColor(const void *target,const void *source)
-{
+{
const char
*p,
*q;
-
+
p=(const char *) target;
q=(const char *) source;
return(strcmp(p,q));
*indexes;
register ssize_t
- i,
x;
register PixelPacket
/*
Remove unquoted characters.
*/
- i=0;
active=MagickFalse;
q=xpm_buffer;
while (*p != '\0')
/*
Read image colormap.
*/
- i=1;
next=NextXPMLine(xpm_buffer);
for (j=0; (j < (ssize_t) image->colors) && (next != (char*) NULL); j++)
{
image->storage_class=DirectClass;
image->matte=MagickTrue;
}
- if (QueryColorDatabase(target,&image->colormap[j],exception) == MagickFalse)
+ status=QueryColorCompliance(target,AllCompliance,&image->colormap[j],
+ exception);
+ if (status == MagickFalse)
break;
}
if (j < (ssize_t) image->colors)
% %
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
-% Procedure WritePICONImage() writes an image to a file in the Personal Icon
-% format.
+% WritePICONImage() writes an image to a file in the Personal Icon format.
%
% The format of the WritePICONImage method is:
%
% %
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
-% Procedure WriteXPMImage() writes an image to a file in the X pixmap format.
+% WriteXPMImage() writes an image to a file in the X pixmap format.
%
% The format of the WriteXPMImage method is:
%
%
% o image: The image.
%
-%
*/
static MagickBooleanType WriteXPMImage(const ImageInfo *image_info,Image *image)
{
(void) FormatMagickString(buffer,MaxTextExtent,"xpm_%s",basename);
(void) CopyMagickString(basename,buffer,MaxTextExtent);
}
- for (i=0; basename[i] != '\0'; i++)
- if (isalpha((int) ((unsigned char) basename[i])) == 0)
+ if (isalpha((int) ((unsigned char) basename[0])) == 0)
+ basename[0]='_';
+ for (i=1; basename[i] != '\0'; i++)
+ if (isalnum((int) ((unsigned char) basename[i])) == 0)
basename[i]='_';
(void) FormatMagickString(buffer,MaxTextExtent,
"static char *%s[] = {\n",basename);