% July 1992 %
% %
% %
-% Copyright 1999-2010 ImageMagick Studio LLC, a non-profit organization %
+% Copyright 1999-2013 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 %
/*
Include declarations.
*/
-#include "magick/studio.h"
-#include "magick/blob.h"
-#include "magick/blob-private.h"
-#include "magick/colorspace.h"
-#include "magick/exception.h"
-#include "magick/exception-private.h"
-#include "magick/compress.h"
-#include "magick/image.h"
-#include "magick/image-private.h"
-#include "magick/list.h"
-#include "magick/magick.h"
-#include "magick/memory_.h"
-#include "magick/monitor.h"
-#include "magick/monitor-private.h"
-#include "magick/quantum-private.h"
-#include "magick/static.h"
-#include "magick/string_.h"
-#include "magick/module.h"
+#include "MagickCore/studio.h"
+#include "MagickCore/attribute.h"
+#include "MagickCore/blob.h"
+#include "MagickCore/blob-private.h"
+#include "MagickCore/colormap.h"
+#include "MagickCore/colorspace.h"
+#include "MagickCore/colorspace-private.h"
+#include "MagickCore/exception.h"
+#include "MagickCore/exception-private.h"
+#include "MagickCore/compress.h"
+#include "MagickCore/image.h"
+#include "MagickCore/image-private.h"
+#include "MagickCore/list.h"
+#include "MagickCore/magick.h"
+#include "MagickCore/memory_.h"
+#include "MagickCore/monitor.h"
+#include "MagickCore/monitor-private.h"
+#include "MagickCore/quantum-private.h"
+#include "MagickCore/static.h"
+#include "MagickCore/string_.h"
+#include "MagickCore/module.h"
\f
/*
Forward declarations.
*/
static MagickBooleanType
- WriteFAXImage(const ImageInfo *,Image *);
+ WriteFAXImage(const ImageInfo *,Image *,ExceptionInfo *);
\f
/*
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
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)
{
if (image->rows == 0)
image->rows=3508;
image->depth=8;
- if (AcquireImageColormap(image,2) == MagickFalse)
+ if (AcquireImageColormap(image,2,exception) == MagickFalse)
ThrowReaderException(ResourceLimitError,"MemoryAllocationFailed");
/*
Monochrome colormap.
*/
- image->colormap[0].red=(Quantum) QuantumRange;
- image->colormap[0].green=(Quantum) QuantumRange;
- image->colormap[0].blue=(Quantum) QuantumRange;
+ image->colormap[0].red=QuantumRange;
+ image->colormap[0].green=QuantumRange;
+ image->colormap[0].blue=QuantumRange;
image->colormap[1].red=(Quantum) 0;
image->colormap[1].green=(Quantum) 0;
image->colormap[1].blue=(Quantum) 0;
(void) CloseBlob(image);
return(GetFirstImageInList(image));
}
- status=HuffmanDecodeImage(image);
+ status=HuffmanDecodeImage(image,exception);
if (status == MagickFalse)
ThrowReaderException(CorruptImageError,"UnableToReadImageData");
if (EOFBlob(image) != MagickFalse)
%
% The format of the RegisterFAXImage method is:
%
-% unsigned long RegisterFAXImage(void)
+% size_t RegisterFAXImage(void)
%
*/
-ModuleExport unsigned long RegisterFAXImage(void)
+ModuleExport size_t RegisterFAXImage(void)
{
MagickInfo
*entry;
%
% The format of the WriteFAXImage method is:
%
-% MagickBooleanType WriteFAXImage(const ImageInfo *image_info,Image *image)
+% MagickBooleanType WriteFAXImage(const ImageInfo *image_info,
+% Image *image,ExceptionInfo *exception)
%
% A description of each parameter follows.
%
%
% o image: The image.
%
+% o exception: return any errors or warnings in this structure.
+%
*/
-static MagickBooleanType WriteFAXImage(const ImageInfo *image_info,Image *image)
+static MagickBooleanType WriteFAXImage(const ImageInfo *image_info,Image *image,
+ ExceptionInfo *exception)
{
ImageInfo
*write_info;
assert(image->signature == MagickSignature);
if (image->debug != MagickFalse)
(void) LogMagickEvent(TraceEvent,GetMagickModule(),"%s",image->filename);
- status=OpenBlob(image_info,image,WriteBinaryBlobMode,&image->exception);
+ assert(exception != (ExceptionInfo *) NULL);
+ assert(exception->signature == MagickSignature);
+ status=OpenBlob(image_info,image,WriteBinaryBlobMode,exception);
if (status == MagickFalse)
return(status);
write_info=CloneImageInfo(image_info);
/*
Convert MIFF to monochrome.
*/
- if (image->colorspace != RGBColorspace)
- (void) TransformImageColorspace(image,RGBColorspace);
- status=HuffmanEncodeImage(write_info,image,image);
+ if (IssRGBCompatibleColorspace(image->colorspace) == MagickFalse)
+ (void) TransformImageColorspace(image,sRGBColorspace,exception);
+ status=HuffmanEncodeImage(write_info,image,image,exception);
if (GetNextImageInList(image) == (Image *) NULL)
break;
image=SyncNextImageInList(image);