% 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 %
image_info->filename);
assert(exception != (ExceptionInfo *) NULL);
assert(exception->signature == MagickSignature);
- image=AcquireImage(image_info);
+ image=AcquireImage(image_info,exception);
status=OpenBlob(image_info,image,ReadBinaryBlobMode,exception);
if (status == MagickFalse)
{
image->storage_class=PseudoClass;
bits_per_pixel=pdb_image.type == 0 ? 2UL : pdb_image.type == 2 ? 4UL : 1UL;
one=1;
- if (AcquireImageColormap(image,one << bits_per_pixel) == MagickFalse)
+ if (AcquireImageColormap(image,one << bits_per_pixel,exception) == MagickFalse)
ThrowReaderException(ResourceLimitError,"MemoryAllocationFailed");
if (image_info->ping != MagickFalse)
{
for (y=0; y < (ssize_t) image->rows; y++)
{
q=QueueAuthenticPixels(image,0,y,image->columns,1,exception);
- if (q == (const Quantum *) NULL)
+ if (q == (Quantum *) NULL)
break;
for (x=0; x < ((ssize_t) image->columns-7); x+=8)
{
if (status == MagickFalse)
break;
}
- (void) SyncImage(image);
+ (void) SyncImage(image,exception);
break;
}
case 2:
for (y=0; y < (ssize_t) image->rows; y++)
{
q=QueueAuthenticPixels(image,0,y,image->columns,1,exception);
- if (q == (const Quantum *) NULL)
+ if (q == (Quantum *) NULL)
break;
for (x=0; x < (ssize_t) image->columns; x+=4)
{
- index=ConstrainColormapIndex(image,3UL-((*p >> 6) & 0x03));
+ index=ConstrainColormapIndex(image,3UL-((*p >> 6) & 0x03),exception);
SetPixelIndex(image,index,q);
q+=GetPixelChannels(image);
- index=ConstrainColormapIndex(image,3UL-((*p >> 4) & 0x03));
+ index=ConstrainColormapIndex(image,3UL-((*p >> 4) & 0x03),exception);
SetPixelIndex(image,index,q);
q+=GetPixelChannels(image);
- index=ConstrainColormapIndex(image,3UL-((*p >> 2) & 0x03));
+ index=ConstrainColormapIndex(image,3UL-((*p >> 2) & 0x03),exception);
SetPixelIndex(image,index,q);
q+=GetPixelChannels(image);
- index=ConstrainColormapIndex(image,3UL-((*p) & 0x03));
+ index=ConstrainColormapIndex(image,3UL-((*p) & 0x03),exception);
SetPixelIndex(image,index,q);
p++;
q+=GetPixelChannels(image);
if (status == MagickFalse)
break;
}
- (void) SyncImage(image);
+ (void) SyncImage(image,exception);
break;
}
case 4:
for (y=0; y < (ssize_t) image->rows; y++)
{
q=QueueAuthenticPixels(image,0,y,image->columns,1,exception);
- if (q == (const Quantum *) NULL)
+ if (q == (Quantum *) NULL)
break;
for (x=0; x < (ssize_t) image->columns; x+=2)
{
- index=ConstrainColormapIndex(image,15UL-((*p >> 4) & 0x0f));
+ index=ConstrainColormapIndex(image,15UL-((*p >> 4) & 0x0f),exception);
SetPixelIndex(image,index,q);
q+=GetPixelChannels(image);
- index=ConstrainColormapIndex(image,15UL-((*p) & 0x0f));
+ index=ConstrainColormapIndex(image,15UL-((*p) & 0x0f),exception);
SetPixelIndex(image,index,q);
p++;
q+=GetPixelChannels(image);
if (status == MagickFalse)
break;
}
- (void) SyncImage(image);
+ (void) SyncImage(image,exception);
break;
}
default:
*p='\0';
if (comment == (char *) NULL)
ThrowReaderException(ResourceLimitError,"MemoryAllocationFailed");
- (void) SetImageProperty(image,"comment",comment);
+ (void) SetImageProperty(image,"comment",comment,exception);
comment=DestroyString(comment);
}
(void) CloseBlob(image);
assert(image->signature == MagickSignature);
if (image->debug != MagickFalse)
(void) LogMagickEvent(TraceEvent,GetMagickModule(),"%s",image->filename);
+ assert(exception != (ExceptionInfo *) NULL);
+ assert(exception->signature == MagickSignature);
status=OpenBlob(image_info,image,WriteBinaryBlobMode,exception);
if (status == MagickFalse)
return(status);
- if (IsRGBColorspace(image->colorspace) == MagickFalse)
- (void) TransformImageColorspace(image,RGBColorspace);
-
+ if (IssRGBCompatibleColorspace(image->colorspace) == MagickFalse)
+ (void) TransformImageColorspace(image,sRGBColorspace,exception);
if (image -> colors <= 2 || GetImageType( image, exception ) == BilevelType) { /* TS */
bits_per_pixel = 1;
} else if (image -> colors <= 4) {
(void) CopyMagickMemory(pdb_info.id,"View",4);
pdb_info.seed=0;
pdb_info.next_record=0;
- comment=GetImageProperty(image,"comment");
+ comment=GetImageProperty(image,"comment",exception);
pdb_info.number_records=(comment == (const char *) NULL ? 1 : 2);
(void) WriteBlob(image,32,(unsigned char *) pdb_info.name);
(void) WriteBlobMSBShort(image,(unsigned short) pdb_info.attributes);
sizeof(*scanline));
if (scanline == (unsigned char *) NULL)
ThrowWriterException(ResourceLimitError,"MemoryAllocationFailed");
- if (IsRGBColorspace(image->colorspace) == MagickFalse)
- (void) TransformImageColorspace(image,RGBColorspace);
+ if (IssRGBCompatibleColorspace(image->colorspace) == MagickFalse)
+ (void) TransformImageColorspace(image,sRGBColorspace,exception);
/*
Convert to GRAY raster scanline.
*/