ThrowReaderException(CorruptImageError,"ImproperImageHeader");
count=(ssize_t) sscanf(buffer,"PG%[ \t]%2s%[ \t+-]%d%[ \t]%d%[ \t]%d",sans,
endian,sign,&precision,sans,&width,sans,&height);
+ if (count != 8)
+ ThrowReaderException(CorruptImageError,"ImproperImageHeader");
image->depth=(size_t) precision;
if (LocaleCompare(endian,"ML") == 0)
image->endian=MSBEndian;
/*
Convert PGX image.
*/
- (void) SetImageColorspace(image,sGRAYColorspace,exception);
+ (void) SetImageColorspace(image,GRAYColorspace,exception);
quantum_info=AcquireQuantumInfo(image_info,image);
if (quantum_info == (QuantumInfo *) NULL)
ThrowReaderException(ResourceLimitError,"MemoryAllocationFailed");
status=OpenBlob(image_info,image,WriteBinaryBlobMode,exception);
if (status == MagickFalse)
return(status);
- (void) FormatLocaleString(buffer,MagickPathExtent,"PG ML + %ld %lu %lu\n",
- image->depth,image->columns,image->rows);
+ (void) FormatLocaleString(buffer,MagickPathExtent,"PG ML + %g %g %g\n",
+ (double) image->depth,(double) image->columns,(double) image->rows);
(void) WriteBlob(image,strlen(buffer),(unsigned char *) buffer);
(void) TransformImageColorspace(image,sRGBColorspace,exception);
quantum_info=AcquireQuantumInfo(image_info,image);