% May 2001 %
% %
% %
-% Copyright 1999-2014 ImageMagick Studio LLC, a non-profit organization %
+% Copyright 1999-2015 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/utility.h"
#include "MagickCore/utility-private.h"
#include "MagickCore/xml-tree.h"
+#include "MagickCore/xml-tree-private.h"
\f
/*
Define declarations.
{ "B", "RAW" },
{ "BRF", "BRAILLE" },
{ "BGRA", "BGR" },
+ { "BGRO", "BGR" },
{ "CMYKA", "CMYK" },
{ "C", "RAW" },
{ "CAL", "CALS" },
{ "CANVAS", "XC" },
+ { "CMYKA", "CMYK" },
{ "CR2", "DNG" },
{ "CRW", "DNG" },
{ "CUR", "ICON" },
+ { "DATA", "INLINE" },
{ "DCR", "DNG" },
{ "DCX", "PCX" },
{ "DFONT", "TTF" },
+ { "DXT1", "DDS" },
+ { "DXT5", "DDS" },
{ "EPDF", "PDF" },
{ "EPI", "PS" },
{ "EPS2", "PS2" },
{ "GRANITE", "MAGICK" },
{ "GROUP4", "TIFF" },
{ "GV", "DOT" },
+ { "HTM", "HTML" },
+ { "ICB", "TGA" },
+ { "ICO", "ICON" },
+ { "IIQ", "DNG" },
{ "K25", "DNG" },
{ "KDC", "DNG" },
{ "H", "MAGICK" },
{ "JBG", "JBIG" },
{ "JNG", "PNG" },
{ "JPC", "JP2" },
+ { "JPT", "JP2" },
+ { "JPM", "JP2" },
{ "J2C", "JP2" },
{ "J2K", "JP2" },
+ { "JNG", "PNG" },
+ { "JPE", "JPEG" },
{ "JPG", "JPEG" },
+ { "JPM", "JP2" },
+ { "JPS", "JPEG" },
+ { "JPT", "JP2" },
{ "JPX", "JP2" },
{ "K", "RAW" },
+ { "K25", "DNG" },
+ { "KDC", "DNG" },
{ "LOGO", "MAGICK" },
+ { "M", "RAW" },
{ "M2V", "MPEG" },
{ "M4V", "MPEG" },
- { "M", "RAW" },
+ { "MEF", "DNG" },
+ { "MKV", "MPEG" },
{ "MNG", "PNG" },
{ "MOV", "MPEG" },
{ "MP4", "MPEG" },
{ "PAM", "PNM" },
{ "PBM", "PNM" },
{ "PCDS", "PCD" },
+ { "PCT", "PICT" },
{ "PDFA", "PDF" },
{ "PEF", "DNG" },
{ "PEF", "DNG" },
{ "PICON", "XPM" },
{ "PJPEG", "JPEG" },
{ "PM", "XPM" },
+ { "PNG00", "PNG" },
{ "PNG24", "PNG" },
{ "PNG32", "PNG" },
+ { "PNG48", "PNG" },
+ { "PNG64", "PNG" },
{ "PNG8", "PNG" },
{ "PPM", "PNM" },
{ "PSB", "PSD" },
{ "PTIF", "TIFF" },
+ { "R", "RAW" },
{ "RADIAL-GRADIENT", "GRADIENT" },
{ "RAF", "DNG" },
{ "RAS", "SUN" },
+ { "RAW", "DNG" },
{ "RGBA", "RGB" },
{ "RGBO", "RGB" },
{ "RMF", "DNG" },
- { "R", "RAW" },
{ "ROSE", "MAGICK" },
{ "RW2", "DNG" },
{ "SHTML", "HTML" },
+ { "SIX", "SIXEL" },
{ "SPARSE-COLOR", "TXT" },
{ "SR2", "DNG" },
{ "SRF", "DNG" },
% %
% %
% %
-% A c q u i r e C o d e r S p l a y T r e e %
++ A c q u i r e C o d e r C a c h e %
% %
% %
% %
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
-% AcquireCoderCache() caches one or more coder configurations which
-% provides a mapping between coder attributes and a coder name.
+% AcquireCoderCache() caches one or more coder configurations which provides a
+% mapping between coder attributes and a coder name.
%
% The format of the AcquireCoderCache coder is:
%
option=(const StringInfo *) GetNextValueInLinkedList(options);
while (option != (const StringInfo *) NULL)
{
- status&=LoadCoderCache(coder_cache,(const char *) GetStringInfoDatum(option),
- GetStringInfoPath(option),0,exception);
+ status&=LoadCoderCache(coder_cache,(const char *)
+ GetStringInfoDatum(option),GetStringInfoPath(option),0,exception);
option=(const StringInfo *) GetNextValueInLinkedList(options);
}
options=DestroyConfigureOptions(options);
coder_info->magick=(char *) p->magick;
coder_info->name=(char *) p->name;
coder_info->exempt=MagickTrue;
- coder_info->signature=MagickSignature;
+ coder_info->signature=MagickCoreSignature;
status&=AddValueToSplayTree(coder_cache,ConstantString(coder_info->magick),
coder_info);
if (status == MagickFalse)
*/
MagickPrivate MagickBooleanType CoderComponentGenesis(void)
{
- coder_semaphore=AcquireSemaphoreInfo();
+ if (coder_semaphore == (SemaphoreInfo *) NULL)
+ coder_semaphore=AcquireSemaphoreInfo();
return(MagickTrue);
}
\f
% %
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
-% IsCoderTreeInstantiated() determines if the coder tree is instantiated.
-% If not, it instantiates the tree and returns it.
+% IsCoderTreeInstantiated() determines if the coder tree is instantiated. If
+% not, it instantiates the tree and returns it.
%
% The format of the IsCoderInstantiated method is:
%
ActivateSemaphoreInfo(&coder_semaphore);
LockSemaphoreInfo(coder_semaphore);
if (coder_cache == (SplayTreeInfo *) NULL)
- (void) AcquireCoderCache(MagickCoderFilename,exception);
+ coder_cache=AcquireCoderCache(MagickCoderFilename,exception);
UnlockSemaphoreInfo(coder_semaphore);
}
return(coder_cache != (SplayTreeInfo *) NULL ? MagickTrue : MagickFalse);
ExceptionInfo *exception)
{
char
- keyword[MaxTextExtent],
+ keyword[MagickPathExtent],
*token;
const char
CoderInfo
*coder_info;
- MagickBooleanType
+ MagickStatusType
status;
/*
GetMagickToken(q,&q,token);
if (*token == '\0')
break;
- (void) CopyMagickString(keyword,token,MaxTextExtent);
+ (void) CopyMagickString(keyword,token,MagickPathExtent);
if (LocaleNCompare(keyword,"<!DOCTYPE",9) == 0)
{
/*
*/
while (((*token != '/') && (*(token+1) != '>')) && (*q != '\0'))
{
- (void) CopyMagickString(keyword,token,MaxTextExtent);
+ (void) CopyMagickString(keyword,token,MagickPathExtent);
GetMagickToken(q,&q,token);
if (*token != '=')
continue;
else
{
char
- path[MaxTextExtent],
+ path[MagickPathExtent],
*xml;
GetPathComponent(filename,HeadPath,path);
if (*path != '\0')
(void) ConcatenateMagickString(path,DirectorySeparator,
- MaxTextExtent);
+ MagickPathExtent);
if (*token == *DirectorySeparator)
- (void) CopyMagickString(path,token,MaxTextExtent);
+ (void) CopyMagickString(path,token,MagickPathExtent);
else
- (void) ConcatenateMagickString(path,token,MaxTextExtent);
- xml=FileToString(path,~0UL,exception);
+ (void) ConcatenateMagickString(path,token,MagickPathExtent);
+ xml=FileToXML(path,~0UL);
if (xml != (char *) NULL)
{
status&=LoadCoderCache(coder_cache,xml,path,depth+1,
(void) ResetMagickMemory(coder_info,0,sizeof(*coder_info));
coder_info->path=ConstantString(filename);
coder_info->exempt=MagickFalse;
- coder_info->signature=MagickSignature;
+ coder_info->signature=MagickCoreSignature;
continue;
}
if (coder_info == (CoderInfo *) NULL)
}
}
token=(char *) RelinquishMagickMemory(token);
- return(status);
+ return(status != 0 ? MagickTrue : MagickFalse);
}