% July 1992 %
% %
% %
-% Copyright 1999-2015 ImageMagick Studio LLC, a non-profit organization %
+% Copyright 1999-2017 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 Image *ReadXBMImage(const ImageInfo *image_info,ExceptionInfo *exception)
{
char
- buffer[MaxTextExtent],
- name[MaxTextExtent];
+ buffer[MagickPathExtent],
+ name[MagickPathExtent];
Image
*image;
Open image file.
*/
assert(image_info != (const ImageInfo *) NULL);
- assert(image_info->signature == MagickSignature);
+ assert(image_info->signature == MagickCoreSignature);
if (image_info->debug != MagickFalse)
(void) LogMagickEvent(TraceEvent,GetMagickModule(),"%s",
image_info->filename);
assert(exception != (ExceptionInfo *) NULL);
- assert(exception->signature == MagickSignature);
+ assert(exception->signature == MagickCoreSignature);
image=AcquireImage(image_info,exception);
status=OpenBlob(image_info,image,ReadBinaryBlobMode,exception);
if (status == MagickFalse)
width=0;
height=0;
while (ReadBlobString(image,buffer) != (char *) NULL)
- if (sscanf(buffer,"#define %s %u",name,&width) == 2)
+ if (sscanf(buffer,"#define %32s %u",name,&width) == 2)
if ((strlen(name) >= 6) &&
(LocaleCompare(name+strlen(name)-6,"_width") == 0))
break;
while (ReadBlobString(image,buffer) != (char *) NULL)
- if (sscanf(buffer,"#define %s %u",name,&height) == 2)
+ if (sscanf(buffer,"#define %32s %u",name,&height) == 2)
if ((strlen(name) >= 7) &&
(LocaleCompare(name+strlen(name)-7,"_height") == 0))
break;
version=11;
while (ReadBlobString(image,buffer) != (char *) NULL)
{
- if (sscanf(buffer,"static short %s = {",name) == 1)
+ if (sscanf(buffer,"static short %32s = {",name) == 1)
version=10;
else
- if (sscanf(buffer,"static unsigned char %s = {",name) == 1)
+ if (sscanf(buffer,"static unsigned char %32s = {",name) == 1)
version=11;
else
- if (sscanf(buffer,"static char %s = {",name) == 1)
+ if (sscanf(buffer,"static char %32s = {",name) == 1)
version=11;
else
continue;
MagickInfo
*entry;
- entry=SetMagickInfo("XBM");
+ entry=AcquireMagickInfo("XBM","XBM",
+ "X Windows system bitmap (black and white)");
entry->decoder=(DecodeImageHandler *) ReadXBMImage;
entry->encoder=(EncodeImageHandler *) WriteXBMImage;
entry->magick=(IsImageFormatHandler *) IsXBM;
entry->flags^=CoderAdjoinFlag;
- entry->description=ConstantString(
- "X Windows system bitmap (black and white)");
- entry->module=ConstantString("XBM");
(void) RegisterMagickInfo(entry);
return(MagickImageCoderSignature);
}
ExceptionInfo *exception)
{
char
- basename[MaxTextExtent],
- buffer[MaxTextExtent];
+ basename[MagickPathExtent],
+ buffer[MagickPathExtent];
MagickBooleanType
status;
Open output image file.
*/
assert(image_info != (const ImageInfo *) NULL);
- assert(image_info->signature == MagickSignature);
+ assert(image_info->signature == MagickCoreSignature);
assert(image != (Image *) NULL);
- assert(image->signature == MagickSignature);
+ assert(image->signature == MagickCoreSignature);
if (image->debug != MagickFalse)
(void) LogMagickEvent(TraceEvent,GetMagickModule(),"%s",image->filename);
assert(exception != (ExceptionInfo *) NULL);
- assert(exception->signature == MagickSignature);
+ assert(exception->signature == MagickCoreSignature);
status=OpenBlob(image_info,image,WriteBinaryBlobMode,exception);
if (status == MagickFalse)
return(status);
Write X bitmap header.
*/
GetPathComponent(image->filename,BasePath,basename);
- (void) FormatLocaleString(buffer,MaxTextExtent,"#define %s_width %.20g\n",
+ (void) FormatLocaleString(buffer,MagickPathExtent,"#define %s_width %.20g\n",
basename,(double) image->columns);
(void) WriteBlob(image,strlen(buffer),(unsigned char *) buffer);
- (void) FormatLocaleString(buffer,MaxTextExtent,"#define %s_height %.20g\n",
+ (void) FormatLocaleString(buffer,MagickPathExtent,"#define %s_height %.20g\n",
basename,(double) image->rows);
(void) WriteBlob(image,strlen(buffer),(unsigned char *) buffer);
- (void) FormatLocaleString(buffer,MaxTextExtent,
+ (void) FormatLocaleString(buffer,MagickPathExtent,
"static char %s_bits[] = {\n",basename);
(void) WriteBlob(image,strlen(buffer),(unsigned char *) buffer);
- (void) CopyMagickString(buffer," ",MaxTextExtent);
+ (void) CopyMagickString(buffer," ",MagickPathExtent);
(void) WriteBlob(image,strlen(buffer),(unsigned char *) buffer);
/*
Convert MIFF to X bitmap pixels.
count=0;
x=0;
y=0;
- (void) CopyMagickString(buffer," ",MaxTextExtent);
+ (void) CopyMagickString(buffer," ",MagickPathExtent);
(void) WriteBlob(image,strlen(buffer),(unsigned char *) buffer);
for (y=0; y < (ssize_t) image->rows; y++)
{
/*
Write a bitmap byte to the image file.
*/
- (void) FormatLocaleString(buffer,MaxTextExtent,"0x%02X, ",
+ (void) FormatLocaleString(buffer,MagickPathExtent,"0x%02X, ",
(unsigned int) (byte & 0xff));
(void) WriteBlob(image,strlen(buffer),(unsigned char *) buffer);
count++;
if (count == 12)
{
- (void) CopyMagickString(buffer,"\n ",MaxTextExtent);
+ (void) CopyMagickString(buffer,"\n ",MagickPathExtent);
(void) WriteBlob(image,strlen(buffer),(unsigned char *) buffer);
count=0;
};
Write a bitmap byte to the image file.
*/
byte>>=(8-bit);
- (void) FormatLocaleString(buffer,MaxTextExtent,"0x%02X, ",
+ (void) FormatLocaleString(buffer,MagickPathExtent,"0x%02X, ",
(unsigned int) (byte & 0xff));
(void) WriteBlob(image,strlen(buffer),(unsigned char *) buffer);
count++;
if (count == 12)
{
- (void) CopyMagickString(buffer,"\n ",MaxTextExtent);
+ (void) CopyMagickString(buffer,"\n ",MagickPathExtent);
(void) WriteBlob(image,strlen(buffer),(unsigned char *) buffer);
count=0;
};
if (status == MagickFalse)
break;
}
- (void) CopyMagickString(buffer,"};\n",MaxTextExtent);
+ (void) CopyMagickString(buffer,"};\n",MagickPathExtent);
(void) WriteBlob(image,strlen(buffer),(unsigned char *) buffer);
(void) CloseBlob(image);
return(MagickTrue);