% Image Montage & Directory Information. %
% %
% Software Design %
-% John Cristy %
+% Cristy %
% July 1992 %
% %
% %
-% Copyright 1999-2012 ImageMagick Studio LLC, a non-profit organization %
+% Copyright 1999-2018 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 %
% obtain a copy of the License at %
% %
-% http://www.imagemagick.org/script/license.php %
+% https://www.imagemagick.org/script/license.php %
% %
% Unless required by applicable law or agreed to in writing, software %
% distributed under the License is distributed on an "AS IS" BASIS, %
MagickInfo
*entry;
- entry=SetMagickInfo("HTM");
+ entry=AcquireMagickInfo("HTML","HTM",
+ "Hypertext Markup Language and a client-side image map");
entry->encoder=(EncodeImageHandler *) WriteHTMLImage;
entry->magick=(IsImageFormatHandler *) IsHTML;
- entry->adjoin=MagickFalse;
- entry->description=ConstantString(
- "Hypertext Markup Language and a client-side image map");
- entry->module=ConstantString("HTML");
+ entry->flags^=CoderAdjoinFlag;
(void) RegisterMagickInfo(entry);
- entry=SetMagickInfo("HTML");
+ entry=AcquireMagickInfo("HTML","HTML",
+ "Hypertext Markup Language and a client-side image map");
entry->encoder=(EncodeImageHandler *) WriteHTMLImage;
entry->magick=(IsImageFormatHandler *) IsHTML;
- entry->adjoin=MagickFalse;
- entry->description=ConstantString(
- "Hypertext Markup Language and a client-side image map");
- entry->module=ConstantString("HTML");
+ entry->flags^=CoderAdjoinFlag;
(void) RegisterMagickInfo(entry);
- entry=SetMagickInfo("SHTML");
+ entry=AcquireMagickInfo("HTML","SHTML",
+ "Hypertext Markup Language and a client-side image map");
entry->encoder=(EncodeImageHandler *) WriteHTMLImage;
entry->magick=(IsImageFormatHandler *) IsHTML;
- entry->adjoin=MagickFalse;
- entry->description=ConstantString(
- "Hypertext Markup Language and a client-side image map");
- entry->module=ConstantString("HTML");
+ entry->flags^=CoderAdjoinFlag;
(void) RegisterMagickInfo(entry);
return(MagickImageCoderSignature);
}
Image *image,ExceptionInfo *exception)
{
char
- basename[MaxTextExtent],
- buffer[MaxTextExtent],
- filename[MaxTextExtent],
- mapname[MaxTextExtent],
- url[MaxTextExtent];
+ basename[MagickPathExtent],
+ buffer[MagickPathExtent],
+ filename[MagickPathExtent],
+ mapname[MagickPathExtent],
+ url[MagickPathExtent];
Image
*next;
Open image.
*/
assert(image_info != (const ImageInfo *) NULL);
- assert(image_info->signature == MagickSignature);
+ assert(image_info->signature == MagickCoreSignature);
assert(image != (Image *) NULL);
- assert(image->signature == MagickSignature);
+ assert(image->signature == MagickCoreSignature);
if (image->debug != MagickFalse)
(void) LogMagickEvent(TraceEvent,GetMagickModule(),"%s",
image_info->filename);
assert(exception != (ExceptionInfo *) NULL);
- assert(exception->signature == MagickSignature);
+ assert(exception->signature == MagickCoreSignature);
status=OpenBlob(image_info,image,WriteBinaryBlobMode,exception);
if (status == MagickFalse)
return(status);
(void) CloseBlob(image);
- if (IsRGBColorspace(image->colorspace) == MagickFalse)
- (void) TransformImageColorspace(image,RGBColorspace,exception);
+ (void) TransformImageColorspace(image,sRGBColorspace,exception);
*url='\0';
if ((LocaleCompare(image_info->magick,"FTP") == 0) ||
(LocaleCompare(image_info->magick,"HTTP") == 0))
if (p != (char *) NULL)
{
p++;
- (void) CopyMagickString(url,image_info->magick,MaxTextExtent);
- (void) ConcatenateMagickString(url,":",MaxTextExtent);
+ (void) CopyMagickString(url,image_info->magick,MagickPathExtent);
+ (void) ConcatenateMagickString(url,":",MagickPathExtent);
url[strlen(url)+p-image->filename]='\0';
(void) ConcatenateMagickString(url,image->filename,
p-image->filename+2);
- (void) CopyMagickString(image->filename,p,MaxTextExtent);
+ (void) CopyMagickString(image->filename,p,MagickPathExtent);
}
}
/*
Refer to image map file.
*/
- (void) CopyMagickString(filename,image->filename,MaxTextExtent);
+ (void) CopyMagickString(filename,image->filename,MagickPathExtent);
AppendImageFormat("map",filename);
GetPathComponent(filename,BasePath,basename);
- (void) CopyMagickString(mapname,basename,MaxTextExtent);
- (void) CopyMagickString(image->filename,image_info->filename,MaxTextExtent);
- (void) CopyMagickString(filename,image->filename,MaxTextExtent);
+ (void) CopyMagickString(mapname,basename,MagickPathExtent);
+ (void) CopyMagickString(image->filename,image_info->filename,MagickPathExtent);
+ (void) CopyMagickString(filename,image->filename,MagickPathExtent);
write_info=CloneImageInfo(image_info);
+ *write_info->magick='\0';
write_info->adjoin=MagickTrue;
status=MagickTrue;
if (LocaleCompare(image_info->magick,"SHTML") != 0)
(void) WriteBlobString(image,"<head>\n");
value=GetImageProperty(image,"label",exception);
if (value != (const char *) NULL)
- (void) FormatLocaleString(buffer,MaxTextExtent,"<title>%s</title>\n",
+ (void) FormatLocaleString(buffer,MagickPathExtent,"<title>%s</title>\n",
value);
else
{
GetPathComponent(filename,BasePath,basename);
- (void) FormatLocaleString(buffer,MaxTextExtent,
+ (void) FormatLocaleString(buffer,MagickPathExtent,
"<title>%s</title>\n",basename);
}
(void) WriteBlobString(image,buffer);
(void) WriteBlobString(image,"</head>\n");
(void) WriteBlobString(image,"<body style=\"text-align: center;\">\n");
- (void) FormatLocaleString(buffer,MaxTextExtent,"<h1>%s</h1>\n",
+ (void) FormatLocaleString(buffer,MagickPathExtent,"<h1>%s</h1>\n",
image->filename);
(void) WriteBlobString(image,buffer);
(void) WriteBlobString(image,"<div>\n");
- (void) CopyMagickString(filename,image->filename,MaxTextExtent);
+ (void) CopyMagickString(filename,image->filename,MagickPathExtent);
AppendImageFormat("png",filename);
- (void) FormatLocaleString(buffer,MaxTextExtent,"<img usemap=\"#%s\" "
+ (void) FormatLocaleString(buffer,MagickPathExtent,"<img usemap=\"#%s\" "
"src=\"%s\" style=\"border: 0;\" alt=\"Image map\" />\n",mapname,
filename);
(void) WriteBlobString(image,buffer);
/*
Write an image map.
*/
- (void) FormatLocaleString(buffer,MaxTextExtent,
+ (void) FormatLocaleString(buffer,MagickPathExtent,
"<map id=\"%s\" name=\"%s\">\n",mapname,mapname);
(void) WriteBlobString(image,buffer);
- (void) FormatLocaleString(buffer,MaxTextExtent," <area href=\"%s",
- url);
+ (void) FormatLocaleString(buffer,MagickPathExtent," <area href=\"%s",url);
(void) WriteBlobString(image,buffer);
if (image->directory == (char *) NULL)
{
- (void) FormatLocaleString(buffer,MaxTextExtent,
+ (void) FormatLocaleString(buffer,MagickPathExtent,
"%s\" shape=\"rect\" coords=\"0,0,%.20g,%.20g\" alt=\"\" />\n",
image->filename,(double) geometry.width-1,(double) geometry.height-
1);
(void) WriteBlobByte(image,(unsigned char) *p);
else
{
- (void) FormatLocaleString(buffer,MaxTextExtent,"\" shape="
+ (void) FormatLocaleString(buffer,MagickPathExtent,"\" shape="
"\"rect\" coords=\"%.20g,%.20g,%.20g,%.20g\" alt=\"\" />\n",
(double) geometry.x,(double) geometry.y,(double) (geometry.x+
geometry.width-1),(double) (geometry.y+geometry.height-1));
(void) WriteBlobString(image,buffer);
if (*(p+1) != '\0')
{
- (void) FormatLocaleString(buffer,MaxTextExtent,
+ (void) FormatLocaleString(buffer,MagickPathExtent,
" <area href=%s\"",url);
(void) WriteBlobString(image,buffer);
}
}
}
(void) WriteBlobString(image,"</map>\n");
- (void) CopyMagickString(filename,image->filename,MaxTextExtent);
+ (void) CopyMagickString(filename,image->filename,MagickPathExtent);
(void) WriteBlobString(image,"</div>\n");
(void) WriteBlobString(image,"</body>\n");
(void) WriteBlobString(image,"</html>\n");
/*
Write the image as PNG.
*/
- (void) CopyMagickString(image->filename,filename,MaxTextExtent);
+ (void) CopyMagickString(image->filename,filename,MagickPathExtent);
AppendImageFormat("png",image->filename);
next=GetNextImageInList(image);
image->next=NewImageList();
- (void) CopyMagickString(image->magick,"PNG",MaxTextExtent);
+ (void) CopyMagickString(image->magick,"PNG",MagickPathExtent);
(void) WriteImage(write_info,image,exception);
image->next=next;
/*
Determine image map filename.
*/
GetPathComponent(image->filename,BasePath,filename);
- (void) ConcatenateMagickString(filename,"_map.shtml",MaxTextExtent);
- (void) CopyMagickString(image->filename,filename,MaxTextExtent);
+ (void) ConcatenateMagickString(filename,"_map.shtml",MagickPathExtent);
+ (void) CopyMagickString(image->filename,filename,MagickPathExtent);
}
/*
Open image map.
/*
Write an image map.
*/
- (void) FormatLocaleString(buffer,MaxTextExtent,
+ (void) FormatLocaleString(buffer,MagickPathExtent,
"<map id=\"%s\" name=\"%s\">\n",mapname,mapname);
(void) WriteBlobString(image,buffer);
- (void) FormatLocaleString(buffer,MaxTextExtent," <area href=\"%s",url);
+ (void) FormatLocaleString(buffer,MagickPathExtent," <area href=\"%s",url);
(void) WriteBlobString(image,buffer);
if (image->directory == (char *) NULL)
{
- (void) FormatLocaleString(buffer,MaxTextExtent,
+ (void) FormatLocaleString(buffer,MagickPathExtent,
"%s\" shape=\"rect\" coords=\"0,0,%.20g,%.20g\" alt=\"\" />\n",
image->filename,(double) geometry.width-1,(double) geometry.height-1);
(void) WriteBlobString(image,buffer);
(void) WriteBlobByte(image,(unsigned char) *p);
else
{
- (void) FormatLocaleString(buffer,MaxTextExtent,"\" shape=\"rect\""
+ (void) FormatLocaleString(buffer,MagickPathExtent,"\" shape=\"rect\""
" coords=\"%.20g,%.20g,%.20g,%.20g\" alt=\"\" />\n",
(double) geometry.x,(double) geometry.y,geometry.x+(double)
geometry.width-1,geometry.y+(double) geometry.height-1);
(void) WriteBlobString(image,buffer);
if (*(p+1) != '\0')
{
- (void) FormatLocaleString(buffer,MaxTextExtent,
+ (void) FormatLocaleString(buffer,MagickPathExtent,
" <area href=%s\"",url);
(void) WriteBlobString(image,buffer);
}
}
(void) WriteBlobString(image,"</map>\n");
(void) CloseBlob(image);
- (void) CopyMagickString(image->filename,filename,MaxTextExtent);
+ (void) CopyMagickString(image->filename,filename,MagickPathExtent);
return(status);
}