% July 1992 %
% %
% %
-% Copyright 1999-2011 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 "MagickCore/studio.h"
+#include "MagickCore/attribute.h"
#include "MagickCore/blob.h"
#include "MagickCore/blob-private.h"
#include "MagickCore/constitute.h"
Forward declarations.
*/
static MagickBooleanType
- WriteCLIPImage(const ImageInfo *,Image *);
+ WriteCLIPImage(const ImageInfo *,Image *,ExceptionInfo *);
\f
/*
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% The format of the WriteCLIPImage method is:
%
% MagickBooleanType WriteCLIPImage(const ImageInfo *image_info,
-% Image *image)
+% 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 WriteCLIPImage(const ImageInfo *image_info,
- Image *image)
+ Image *image,ExceptionInfo *exception)
{
Image
*clip_image;
MagickBooleanType
status;
- if (image->clip_mask == (Image *) NULL)
- (void) ClipImage(image);
- if (image->clip_mask == (Image *) NULL)
+ if (image->mask == MagickFalse)
+ (void) ClipImage(image,exception);
+ if (image->mask == MagickFalse)
ThrowWriterException(CoderError,"ImageDoesNotHaveAClipMask");
- clip_image=CloneImage(image->clip_mask,0,0,MagickTrue,&image->exception);
+ clip_image=GetImageMask(image,exception);
if (clip_image == (Image *) NULL)
return(MagickFalse);
- (void) SetImageType(clip_image,TrueColorType);
(void) CopyMagickString(clip_image->filename,image->filename,MaxTextExtent);
write_info=CloneImageInfo(image_info);
- (void) SetImageInfo(write_info,1,&image->exception);
+ (void) SetImageInfo(write_info,1,exception);
if (LocaleCompare(write_info->magick,"CLIP") == 0)
(void) FormatLocaleString(clip_image->filename,MaxTextExtent,"miff:%s",
write_info->filename);
- status=WriteImage(write_info,clip_image);
+ status=WriteImage(write_info,clip_image,exception);
clip_image=DestroyImage(clip_image);
write_info=DestroyImageInfo(write_info);
return(status);