% 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 %
#include "MagickCore/blob-private.h"
#include "MagickCore/color-private.h"
#include "MagickCore/colorspace.h"
+#include "MagickCore/colorspace-private.h"
#include "MagickCore/constitute.h"
#include "MagickCore/exception.h"
#include "MagickCore/exception-private.h"
Forward declarations.
*/
static MagickBooleanType
- WriteHTMLImage(const ImageInfo *,Image *);
+ WriteHTMLImage(const ImageInfo *,Image *,ExceptionInfo *);
\f
/*
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
% The format of the WriteHTMLImage method is:
%
-% MagickBooleanType WriteHTMLImage(const ImageInfo *image_info,Image *image)
+% MagickBooleanType WriteHTMLImage(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 WriteHTMLImage(const ImageInfo *image_info,
- Image *image)
+ Image *image,ExceptionInfo *exception)
{
char
basename[MaxTextExtent],
if (image->debug != MagickFalse)
(void) LogMagickEvent(TraceEvent,GetMagickModule(),"%s",
image_info->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);
(void) CloseBlob(image);
- if (image->colorspace != RGBColorspace)
- (void) TransformImageColorspace(image,RGBColorspace);
+ if (IssRGBCompatibleColorspace(image->colorspace) == MagickFalse)
+ (void) TransformImageColorspace(image,sRGBColorspace,exception);
*url='\0';
if ((LocaleCompare(image_info->magick,"FTP") == 0) ||
(LocaleCompare(image_info->magick,"HTTP") == 0))
Extract URL base from filename.
*/
p=strrchr(image->filename,'/');
- if (p)
+ if (p != (char *) NULL)
{
p++;
(void) CopyMagickString(url,image_info->magick,MaxTextExtent);
/*
Open output image file.
*/
- status=OpenBlob(image_info,image,WriteBinaryBlobMode,&image->exception);
+ assert(exception != (ExceptionInfo *) NULL);
+ status=OpenBlob(image_info,image,WriteBinaryBlobMode,exception);
if (status == MagickFalse)
return(status);
/*
"\"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd\">\n");
(void) WriteBlobString(image,"<html>\n");
(void) WriteBlobString(image,"<head>\n");
- value=GetImageProperty(image,"label");
+ value=GetImageProperty(image,"label",exception);
if (value != (const char *) NULL)
(void) FormatLocaleString(buffer,MaxTextExtent,"<title>%s</title>\n",
value);
(void) FormatLocaleString(buffer,MaxTextExtent,
"<map id=\"%s\" name=\"%s\">\n",mapname,mapname);
(void) WriteBlobString(image,buffer);
- (void) FormatLocaleString(buffer,MaxTextExtent," <area href=\"%s",
- url);
+ (void) FormatLocaleString(buffer,MaxTextExtent," <area href=\"%s",url);
(void) WriteBlobString(image,buffer);
if (image->directory == (char *) NULL)
{
next=GetNextImageInList(image);
image->next=NewImageList();
(void) CopyMagickString(image->magick,"PNG",MaxTextExtent);
- (void) WriteImage(write_info,image);
+ (void) WriteImage(write_info,image,exception);
image->next=next;
/*
Determine image map filename.
/*
Open image map.
*/
- status=OpenBlob(write_info,image,WriteBinaryBlobMode,&image->exception);
+ status=OpenBlob(write_info,image,WriteBinaryBlobMode,exception);
if (status == MagickFalse)
return(status);
write_info=DestroyImageInfo(write_info);