]> granicus.if.org Git - imagemagick/blobdiff - coders/html.c
(no commit message)
[imagemagick] / coders / html.c
index 6bcb45be8bbaf7159048fd4bdfaed8b07785851a..527e622b97ac594e545b2f094253892ed495f4f5 100644 (file)
@@ -18,7 +18,7 @@
 %                                 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  %
@@ -244,12 +244,14 @@ static MagickBooleanType WriteHTMLImage(const ImageInfo *image_info,
   if (image->debug != MagickFalse)
     (void) LogMagickEvent(TraceEvent,GetMagickModule(),"%s",
       image_info->filename);
+  assert(exception != (ExceptionInfo *) NULL);
+  assert(exception->signature == MagickSignature);
   status=OpenBlob(image_info,image,WriteBinaryBlobMode,exception);
   if (status == MagickFalse)
     return(status);
   (void) CloseBlob(image);
-  if (IsRGBColorspace(image->colorspace) == MagickFalse)
-    (void) TransformImageColorspace(image,RGBColorspace);
+  if (IssRGBColorspace(image->colorspace) == MagickFalse)
+    (void) TransformImageColorspace(image,sRGBColorspace,exception);
   *url='\0';
   if ((LocaleCompare(image_info->magick,"FTP") == 0) ||
       (LocaleCompare(image_info->magick,"HTTP") == 0))
@@ -258,7 +260,7 @@ static MagickBooleanType WriteHTMLImage(const ImageInfo *image_info,
         Extract URL base from filename.
       */
       p=strrchr(image->filename,'/');
-      if (p)
+      if (p != (char *) NULL)
         {
           p++;
           (void) CopyMagickString(url,image_info->magick,MaxTextExtent);
@@ -289,6 +291,7 @@ static MagickBooleanType WriteHTMLImage(const ImageInfo *image_info,
       /*
         Open output image file.
       */
+      assert(exception != (ExceptionInfo *) NULL);
       status=OpenBlob(image_info,image,WriteBinaryBlobMode,exception);
       if (status == MagickFalse)
         return(status);
@@ -302,7 +305,7 @@ static MagickBooleanType WriteHTMLImage(const ImageInfo *image_info,
         "\"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);
@@ -337,8 +340,7 @@ static MagickBooleanType WriteHTMLImage(const ImageInfo *image_info,
       (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)
         {