2 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
6 % M M AAA GGGG IIIII CCCC K K %
7 % MM MM A A G I C K K %
8 % M M M AAAAA G GGG I C KKK %
9 % M M A A G G I C K K %
10 % M M A A GGGG IIIII CCCC K K %
13 % Methods to Read or List ImageMagick Image formats %
21 % Copyright 1999-2011 ImageMagick Studio LLC, a non-profit organization %
22 % dedicated to making software imaging solutions freely available. %
24 % You may not use this file except in compliance with the License. You may %
25 % obtain a copy of the License at %
27 % http://www.imagemagick.org/script/license.php %
29 % Unless required by applicable law or agreed to in writing, software %
30 % distributed under the License is distributed on an "AS IS" BASIS, %
31 % WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. %
32 % See the License for the specific language governing permissions and %
33 % limitations under the License. %
35 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
43 #include "magick/studio.h"
44 #include "magick/annotate.h"
45 #include "magick/blob.h"
46 #include "magick/blob-private.h"
47 #include "magick/cache.h"
48 #include "magick/coder.h"
49 #include "magick/client.h"
50 #include "magick/coder.h"
51 #include "magick/configure.h"
52 #include "magick/constitute.h"
53 #include "magick/delegate.h"
54 #include "magick/draw.h"
55 #include "magick/exception.h"
56 #include "magick/exception-private.h"
57 #include "magick/locale_.h"
58 #include "magick/log.h"
59 #include "magick/magic.h"
60 #include "magick/magick.h"
61 #include "magick/memory_.h"
62 #include "magick/mime.h"
63 #include "magick/module.h"
64 #if defined(MAGICKCORE_WINDOWS_SUPPORT)
65 # include "magick/nt-feature.h"
67 #include "magick/random_.h"
68 #include "magick/registry.h"
69 #include "magick/resource_.h"
70 #include "magick/policy.h"
71 #include "magick/semaphore.h"
72 #include "magick/semaphore-private.h"
73 #include "magick/signature-private.h"
74 #include "magick/splay-tree.h"
75 #include "magick/string_.h"
76 #include "magick/string-private.h"
77 #include "magick/thread_.h"
78 #include "magick/thread-private.h"
79 #include "magick/token.h"
80 #include "magick/utility.h"
81 #include "magick/xwindow-private.h"
86 #if !defined(MAGICKCORE_RETSIGTYPE)
87 # define MAGICKCORE_RETSIGTYPE void
90 # define SIG_DFL ((SignalHandler *) 0)
93 # define SIG_ERR ((SignalHandler *) -1)
100 Typedef declarations.
102 typedef MAGICKCORE_RETSIGTYPE
109 *magick_semaphore = (SemaphoreInfo *) NULL;
112 *signal_handlers[SIGMAX] = { (SignalHandler *) NULL };
115 *magick_list = (SplayTreeInfo *) NULL;
117 static volatile MagickBooleanType
118 instantiate_magick = MagickFalse,
119 instantiate_magickcore = MagickFalse;
122 Forward declarations.
124 static MagickBooleanType
125 InitializeMagickList(ExceptionInfo *);
128 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
132 + G e t I m a g e D e c o d e r %
136 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
138 % GetImageDecoder() returns the image decoder.
140 % The format of the GetImageDecoder method is:
142 % DecodeImageHandler *GetImageDecoder(const MagickInfo *magick_info)
144 % A description of each parameter follows:
146 % o magick_info: The magick info.
149 MagickExport DecodeImageHandler *GetImageDecoder(const MagickInfo *magick_info)
151 (void) LogMagickEvent(TraceEvent,GetMagickModule(),"...");
152 assert(magick_info != (MagickInfo *) NULL);
153 assert(magick_info->signature == MagickSignature);
154 return(magick_info->decoder);
158 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
162 + G e t I m a g e E n c o d e r %
166 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
168 % GetImageEncoder() returns the image encoder.
170 % The format of the GetImageEncoder method is:
172 % EncodeImageHandler *GetImageEncoder(const MagickInfo *magick_info)
174 % A description of each parameter follows:
176 % o magick_info: The magick info.
179 MagickExport EncodeImageHandler *GetImageEncoder(const MagickInfo *magick_info)
181 (void) LogMagickEvent(TraceEvent,GetMagickModule(),"...");
182 assert(magick_info != (MagickInfo *) NULL);
183 assert(magick_info->signature == MagickSignature);
184 return(magick_info->encoder);
188 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
192 + G e t I m a g e M a g i c k %
196 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
198 % GetImageMagick() searches for an image format that matches the specified
199 % magick string. If one is found, MagickTrue is returned otherwise
202 % The format of the GetImageMagick method is:
204 % MagickBooleanType GetImageMagick(const unsigned char *magick,
205 % const size_t length,char *format)
207 % A description of each parameter follows:
209 % o magick: the image format we are searching for.
211 % o length: the length of the binary string.
213 % o format: the image format as determined by the magick bytes.
216 MagickExport MagickBooleanType GetImageMagick(const unsigned char *magick,
217 const size_t length,char *format)
225 register const MagickInfo
228 (void) LogMagickEvent(TraceEvent,GetMagickModule(),"...");
229 assert(magick != (const unsigned char *) NULL);
230 exception=AcquireExceptionInfo();
231 p=GetMagickInfo("*",exception);
232 exception=DestroyExceptionInfo(exception);
233 if (p == (const MagickInfo *) NULL)
236 LockSemaphoreInfo(magick_semaphore);
237 ResetSplayTreeIterator(magick_list);
238 p=(const MagickInfo *) GetNextValueInSplayTree(magick_list);
239 while (p != (const MagickInfo *) NULL)
241 if ((p->magick != (IsImageFormatHandler *) NULL) &&
242 (p->magick(magick,length) != 0))
245 (void) CopyMagickString(format,p->name,MaxTextExtent);
248 p=(const MagickInfo *) GetNextValueInSplayTree(magick_list);
250 UnlockSemaphoreInfo(magick_semaphore);
255 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
259 + G e t M a g i c k A d j o i n %
263 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
265 % GetMagickAdjoin() returns MagickTrue if the magick adjoin is MagickTrue.
267 % The format of the GetMagickAdjoin method is:
269 % MagickBooleanType GetMagickAdjoin(const MagickInfo *magick_info)
271 % A description of each parameter follows:
273 % o magick_info: The magick info.
276 MagickExport MagickBooleanType GetMagickAdjoin(const MagickInfo *magick_info)
278 (void) LogMagickEvent(TraceEvent,GetMagickModule(),"...");
279 assert(magick_info != (MagickInfo *) NULL);
280 assert(magick_info->signature == MagickSignature);
281 return(magick_info->adjoin);
285 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
289 + G e t M a g i c k B l o b S u p p o r t %
293 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
295 % GetMagickBlobSupport() returns MagickTrue if the magick supports blobs.
297 % The format of the GetMagickBlobSupport method is:
299 % MagickBooleanType GetMagickBlobSupport(const MagickInfo *magick_info)
301 % A description of each parameter follows:
303 % o magick_info: The magick info.
306 MagickExport MagickBooleanType GetMagickBlobSupport(
307 const MagickInfo *magick_info)
309 (void) LogMagickEvent(TraceEvent,GetMagickModule(),"...");
310 assert(magick_info != (MagickInfo *) NULL);
311 assert(magick_info->signature == MagickSignature);
312 return(magick_info->blob_support);
316 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
320 + G e t M a g i c k D e s c r i p t i o n %
324 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
326 % GetMagickDescription() returns the magick description.
328 % The format of the GetMagickDescription method is:
330 % const char *GetMagickDescription(const MagickInfo *magick_info)
332 % A description of each parameter follows:
334 % o magick_info: The magick info.
337 MagickExport const char *GetMagickDescription(const MagickInfo *magick_info)
339 (void) LogMagickEvent(TraceEvent,GetMagickModule(),"...");
340 assert(magick_info != (MagickInfo *) NULL);
341 assert(magick_info->signature == MagickSignature);
342 return(magick_info->description);
346 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
350 + G e t M a g i c k E n d i a n S u p p o r t %
354 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
356 % GetMagickEndianSupport() returns the MagickTrue if the coder respects
357 % endianness other than MSBEndian.
359 % The format of the GetMagickEndianSupport method is:
361 % MagickBooleanType GetMagickEndianSupport(const MagickInfo *magick_info)
363 % A description of each parameter follows:
365 % o magick_info: The magick info.
368 MagickExport MagickBooleanType GetMagickEndianSupport(
369 const MagickInfo *magick_info)
371 (void) LogMagickEvent(TraceEvent,GetMagickModule(),"...");
372 assert(magick_info != (MagickInfo *) NULL);
373 assert(magick_info->signature == MagickSignature);
374 return(magick_info->endian_support);
378 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
382 + G e t M a g i c k I n f o %
386 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
388 % GetMagickInfo() returns a pointer MagickInfo structure that matches
389 % the specified name. If name is NULL, the head of the image format list
392 % The format of the GetMagickInfo method is:
394 % const MagickInfo *GetMagickInfo(const char *name,Exception *exception)
396 % A description of each parameter follows:
398 % o name: the image format we are looking for.
400 % o exception: return any errors or warnings in this structure.
403 MagickExport const MagickInfo *GetMagickInfo(const char *name,
404 ExceptionInfo *exception)
406 register const MagickInfo
409 assert(exception != (ExceptionInfo *) NULL);
410 if ((magick_list == (SplayTreeInfo *) NULL) ||
411 (instantiate_magick == MagickFalse))
412 if (InitializeMagickList(exception) == MagickFalse)
413 return((const MagickInfo *) NULL);
414 if ((name == (const char *) NULL) || (LocaleCompare(name,"*") == 0))
416 #if defined(MAGICKCORE_MODULES_SUPPORT)
417 if (LocaleCompare(name,"*") == 0)
418 (void) OpenModules(exception);
420 LockSemaphoreInfo(magick_semaphore);
421 ResetSplayTreeIterator(magick_list);
422 p=(const MagickInfo *) GetNextValueInSplayTree(magick_list);
423 UnlockSemaphoreInfo(magick_semaphore);
429 LockSemaphoreInfo(magick_semaphore);
430 ResetSplayTreeIterator(magick_list);
431 p=(const MagickInfo *) GetNextValueInSplayTree(magick_list);
432 while (p != (const MagickInfo *) NULL)
434 if (LocaleCompare(p->name,name) == 0)
436 p=(const MagickInfo *) GetNextValueInSplayTree(magick_list);
438 #if defined(MAGICKCORE_MODULES_SUPPORT)
439 if (p == (const MagickInfo *) NULL)
442 (void) OpenModule(name,exception);
443 ResetSplayTreeIterator(magick_list);
444 p=(const MagickInfo *) GetNextValueInSplayTree(magick_list);
445 while (p != (const MagickInfo *) NULL)
447 if (LocaleCompare(p->name,name) == 0)
449 p=(const MagickInfo *) GetNextValueInSplayTree(magick_list);
453 UnlockSemaphoreInfo(magick_semaphore);
458 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
462 + G e t M a g i c k I n f o L i s t %
466 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
468 % GetMagickInfoList() returns any image formats that match the specified
471 % The format of the GetMagickInfoList function is:
473 % const MagickInfo **GetMagickInfoList(const char *pattern,
474 % size_t *number_formats,ExceptionInfo *exception)
476 % A description of each parameter follows:
478 % o pattern: Specifies a pointer to a text string containing a pattern.
480 % o number_formats: This integer returns the number of formats in the list.
482 % o exception: return any errors or warnings in this structure.
486 #if defined(__cplusplus) || defined(c_plusplus)
490 static int MagickInfoCompare(const void *x,const void *y)
496 p=(const MagickInfo **) x,
497 q=(const MagickInfo **) y;
498 return(LocaleCompare((*p)->name,(*q)->name));
501 #if defined(__cplusplus) || defined(c_plusplus)
505 MagickExport const MagickInfo **GetMagickInfoList(const char *pattern,
506 size_t *number_formats,ExceptionInfo *exception)
511 register const MagickInfo
518 Allocate magick list.
520 assert(pattern != (char *) NULL);
521 (void) LogMagickEvent(TraceEvent,GetMagickModule(),"%s",pattern);
522 assert(number_formats != (size_t *) NULL);
524 p=GetMagickInfo("*",exception);
525 if (p == (const MagickInfo *) NULL)
526 return((const MagickInfo **) NULL);
527 formats=(const MagickInfo **) AcquireQuantumMemory((size_t)
528 GetNumberOfNodesInSplayTree(magick_list)+1UL,sizeof(*formats));
529 if (formats == (const MagickInfo **) NULL)
530 return((const MagickInfo **) NULL);
532 Generate magick list.
534 LockSemaphoreInfo(magick_semaphore);
535 ResetSplayTreeIterator(magick_list);
536 p=(const MagickInfo *) GetNextValueInSplayTree(magick_list);
537 for (i=0; p != (const MagickInfo *) NULL; )
539 if ((p->stealth == MagickFalse) &&
540 (GlobExpression(p->name,pattern,MagickFalse) != MagickFalse))
542 p=(const MagickInfo *) GetNextValueInSplayTree(magick_list);
544 UnlockSemaphoreInfo(magick_semaphore);
545 qsort((void *) formats,(size_t) i,sizeof(*formats),MagickInfoCompare);
546 formats[i]=(MagickInfo *) NULL;
547 *number_formats=(size_t) i;
552 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
556 + G e t M a g i c k L i s t %
560 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
562 % GetMagickList() returns any image formats that match the specified pattern.
564 % The format of the GetMagickList function is:
566 % char **GetMagickList(const char *pattern,size_t *number_formats,
567 % ExceptionInfo *exception)
569 % A description of each parameter follows:
571 % o pattern: Specifies a pointer to a text string containing a pattern.
573 % o number_formats: This integer returns the number of formats in the list.
575 % o exception: return any errors or warnings in this structure.
579 #if defined(__cplusplus) || defined(c_plusplus)
583 static int MagickCompare(const void *x,const void *y)
591 return(LocaleCompare(*p,*q));
594 #if defined(__cplusplus) || defined(c_plusplus)
598 MagickExport char **GetMagickList(const char *pattern,
599 size_t *number_formats,ExceptionInfo *exception)
604 register const MagickInfo
611 Allocate magick list.
613 assert(pattern != (char *) NULL);
614 (void) LogMagickEvent(TraceEvent,GetMagickModule(),"%s",pattern);
615 assert(number_formats != (size_t *) NULL);
617 p=GetMagickInfo("*",exception);
618 if (p == (const MagickInfo *) NULL)
619 return((char **) NULL);
620 formats=(char **) AcquireQuantumMemory((size_t)
621 GetNumberOfNodesInSplayTree(magick_list)+1UL,sizeof(*formats));
622 if (formats == (char **) NULL)
623 return((char **) NULL);
624 LockSemaphoreInfo(magick_semaphore);
625 ResetSplayTreeIterator(magick_list);
626 p=(const MagickInfo *) GetNextValueInSplayTree(magick_list);
627 for (i=0; p != (const MagickInfo *) NULL; )
629 if ((p->stealth == MagickFalse) &&
630 (GlobExpression(p->name,pattern,MagickFalse) != MagickFalse))
631 formats[i++]=ConstantString(p->name);
632 p=(const MagickInfo *) GetNextValueInSplayTree(magick_list);
634 UnlockSemaphoreInfo(magick_semaphore);
635 qsort((void *) formats,(size_t) i,sizeof(*formats),MagickCompare);
636 formats[i]=(char *) NULL;
637 *number_formats=(size_t) i;
642 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
646 % G e t M a g i c k P r e c i s i o n %
650 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
652 % GetMagickPrecision() returns the maximum number of significant digits to be
655 % The format of the GetMagickPrecision method is:
657 % int GetMagickPrecision(void)
660 MagickExport int GetMagickPrecision(void)
662 #define MagickPrecision 6
664 (void) LogMagickEvent(TraceEvent,GetMagickModule(),"...");
665 if (SetMagickPrecision(0) == 0)
670 (void) SetMagickPrecision(MagickPrecision);
671 limit=GetEnvironmentValue("MAGICK_PRECISION");
672 if (limit == (char *) NULL)
673 limit=GetPolicyValue("precision");
674 if (limit != (char *) NULL)
676 (void) SetMagickPrecision(StringToInteger(limit));
677 limit=DestroyString(limit);
680 return(SetMagickPrecision(0));
684 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
688 + G e t M a g i c k R a w S u p p o r t %
692 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
694 % GetMagickRawSupport() returns the MagickTrue if the coder is a raw format.
696 % The format of the GetMagickRawSupport method is:
698 % MagickBooleanType GetMagickRawSupport(const MagickInfo *magick_info)
700 % A description of each parameter follows:
702 % o magick_info: The magick info.
705 MagickExport MagickBooleanType GetMagickRawSupport(
706 const MagickInfo *magick_info)
708 (void) LogMagickEvent(TraceEvent,GetMagickModule(),"...");
709 assert(magick_info != (MagickInfo *) NULL);
710 assert(magick_info->signature == MagickSignature);
711 return(magick_info->raw);
715 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
719 + G e t M a g i c k S e e k a b l e S t r e a m %
723 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
725 % GetMagickSeekableStream() returns MagickTrue if the magick supports a
728 % The format of the GetMagickSeekableStream method is:
730 % MagickBooleanType GetMagickSeekableStream(const MagickInfo *magick_info)
732 % A description of each parameter follows:
734 % o magick_info: The magick info.
737 MagickExport MagickBooleanType GetMagickSeekableStream(
738 const MagickInfo *magick_info)
740 (void) LogMagickEvent(TraceEvent,GetMagickModule(),"...");
741 assert(magick_info != (MagickInfo *) NULL);
742 assert(magick_info->signature == MagickSignature);
743 return(magick_info->seekable_stream);
747 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
751 + G e t M a g i c k T h r e a d S u p p o r t %
755 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
757 % GetMagickThreadSupport() returns MagickTrue if the magick supports threads.
759 % The format of the GetMagickThreadSupport method is:
761 % MagickStatusType GetMagickThreadSupport(const MagickInfo *magick_info)
763 % A description of each parameter follows:
765 % o magick_info: The magick info.
768 MagickExport MagickStatusType GetMagickThreadSupport(
769 const MagickInfo *magick_info)
771 (void) LogMagickEvent(TraceEvent,GetMagickModule(),"...");
772 assert(magick_info != (MagickInfo *) NULL);
773 assert(magick_info->signature == MagickSignature);
774 return(magick_info->thread_support);
778 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
782 + I n i t i a l i z e M a g i c k L i s t %
786 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
788 % InitializeMagickList() initializes the magick list.
790 % The format of the InitializeMagickList() method is:
792 % InitializeMagickList(Exceptioninfo *exception)
794 % A description of each parameter follows.
796 % o exception: return any errors or warnings in this structure.
800 static void *DestroyMagickNode(void *magick_info)
805 p=(MagickInfo *) magick_info;
806 if (p->name != (char *) NULL)
807 p->name=DestroyString(p->name);
808 if (p->description != (char *) NULL)
809 p->description=DestroyString(p->description);
810 if (p->version != (char *) NULL)
811 p->version=DestroyString(p->version);
812 if (p->note != (char *) NULL)
813 p->note=DestroyString(p->note);
814 if (p->module != (char *) NULL)
815 p->module=DestroyString(p->module);
816 return(RelinquishMagickMemory(p));
819 static MagickBooleanType InitializeMagickList(ExceptionInfo *exception)
822 if ((magick_list == (SplayTreeInfo *) NULL) &&
823 (instantiate_magick == MagickFalse))
825 if (magick_semaphore == (SemaphoreInfo *) NULL)
826 AcquireSemaphoreInfo(&magick_semaphore);
827 LockSemaphoreInfo(magick_semaphore);
828 if ((magick_list == (SplayTreeInfo *) NULL) &&
829 (instantiate_magick == MagickFalse))
837 magick_list=NewSplayTree(CompareSplayTreeString,
838 (void *(*)(void *)) NULL,DestroyMagickNode);
839 if (magick_list == (SplayTreeInfo *) NULL)
840 ThrowFatalException(ResourceLimitFatalError,
841 "MemoryAllocationFailed");
842 magick_info=SetMagickInfo("ephemeral");
843 magick_info->stealth=MagickTrue;
844 status=AddValueToSplayTree(magick_list,magick_info->name,magick_info);
845 if (status == MagickFalse)
846 ThrowFatalException(ResourceLimitFatalError,
847 "MemoryAllocationFailed");
848 magick_info=SetMagickInfo("clipmask");
849 magick_info->stealth=MagickTrue;
850 status=AddValueToSplayTree(magick_list,magick_info->name,magick_info);
851 if (status == MagickFalse)
856 message=GetExceptionMessage(errno);
857 ThrowFatalException(ResourceLimitFatalError,
858 "MemoryAllocationFailed");
859 message=DestroyString(message);
861 #if defined(MAGICKCORE_MODULES_SUPPORT)
862 (void) GetModuleInfo((char *) NULL,exception);
864 #if !defined(MAGICKCORE_BUILD_MODULES)
865 RegisterStaticModules();
867 instantiate_magick=MagickTrue;
869 UnlockSemaphoreInfo(magick_semaphore);
871 return(magick_list != (SplayTreeInfo *) NULL ? MagickTrue : MagickFalse);
875 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
879 + I s M a g i c k C o n f l i c t %
883 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
885 % IsMagickConflict() returns MagickTrue if the image format conflicts with a
886 % logical drive (.e.g. X:).
888 % The format of the IsMagickConflict method is:
890 % MagickBooleanType IsMagickConflict(const char *magick)
892 % A description of each parameter follows:
894 % o magick: Specifies the image format.
897 MagickExport MagickBooleanType IsMagickConflict(const char *magick)
899 assert(magick != (char *) NULL);
900 #if defined(macintosh)
901 return(MACIsMagickConflict(magick));
903 return(VMSIsMagickConflict(magick));
904 #elif defined(MAGICKCORE_WINDOWS_SUPPORT)
905 return(NTIsMagickConflict(magick));
912 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
916 + L i s t M a g i c k I n f o %
920 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
922 % ListMagickInfo() lists the image formats to a file.
924 % The format of the ListMagickInfo method is:
926 % MagickBooleanType ListMagickInfo(FILE *file,ExceptionInfo *exception)
928 % A description of each parameter follows.
930 % o file: A file handle.
932 % o exception: return any errors or warnings in this structure.
935 MagickExport MagickBooleanType ListMagickInfo(FILE *file,
936 ExceptionInfo *exception)
950 if (file == (FILE *) NULL)
952 magick_info=GetMagickInfoList("*",&number_formats,exception);
953 if (magick_info == (const MagickInfo **) NULL)
955 ClearMagickException(exception);
956 #if !defined(MAGICKCORE_MODULES_SUPPORT)
957 (void) FormatLocaleFile(file," Format Mode Description\n");
959 (void) FormatLocaleFile(file," Format Module Mode Description\n");
961 (void) FormatLocaleFile(file,"--------------------------------------------------------"
962 "-----------------------\n");
963 for (i=0; i < (ssize_t) number_formats; i++)
965 if (magick_info[i]->stealth != MagickFalse)
967 (void) FormatLocaleFile(file,"%9s%c ",magick_info[i]->name != (char *) NULL ?
968 magick_info[i]->name : "",
969 magick_info[i]->blob_support != MagickFalse ? '*' : ' ');
970 #if defined(MAGICKCORE_MODULES_SUPPORT)
973 module[MaxTextExtent];
976 if (magick_info[i]->module != (char *) NULL)
977 (void) CopyMagickString(module,magick_info[i]->module,MaxTextExtent);
978 (void) ConcatenateMagickString(module," ",MaxTextExtent);
980 (void) FormatLocaleFile(file,"%9s ",module);
983 (void) FormatLocaleFile(file,"%c%c%c ",magick_info[i]->decoder ? 'r' : '-',
984 magick_info[i]->encoder ? 'w' : '-',magick_info[i]->encoder != NULL &&
985 magick_info[i]->adjoin != MagickFalse ? '+' : '-');
986 if (magick_info[i]->description != (char *) NULL)
987 (void) FormatLocaleFile(file," %s",magick_info[i]->description);
988 if (magick_info[i]->version != (char *) NULL)
989 (void) FormatLocaleFile(file," (%s)",magick_info[i]->version);
990 (void) FormatLocaleFile(file,"\n");
991 if (magick_info[i]->note != (char *) NULL)
996 text=StringToList(magick_info[i]->note);
997 if (text != (char **) NULL)
999 for (j=0; text[j] != (char *) NULL; j++)
1001 (void) FormatLocaleFile(file," %s\n",text[j]);
1002 text[j]=DestroyString(text[j]);
1004 text=(char **) RelinquishMagickMemory(text);
1008 (void) FormatLocaleFile(file,"\n* native blob support\n");
1009 (void) FormatLocaleFile(file,"r read support\n");
1010 (void) FormatLocaleFile(file,"w write support\n");
1011 (void) FormatLocaleFile(file,"+ support for multiple images\n");
1012 (void) fflush(file);
1013 magick_info=(const MagickInfo **) RelinquishMagickMemory((void *)
1019 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1023 % I s M a g i c k I n s t a n t i a t e d %
1027 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1029 % IsMagickInstantiated() returns MagickTrue if the ImageMagick environment
1030 % is currently instantiated: MagickCoreGenesis() has been called but
1031 % MagickDestroy() has not.
1033 % The format of the IsMagickInstantiated method is:
1035 % MagickBooleanType IsMagickInstantiated(void)
1038 MagickExport MagickBooleanType IsMagickInstantiated(void)
1040 return(instantiate_magick);
1044 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1048 + M a g i c k C o m p o n e n t G e n e s i s %
1052 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1054 % MagickComponentGenesis() instantiates the magick component.
1056 % The format of the MagickComponentGenesis method is:
1058 % MagickBooleanType MagickComponentGenesis(void)
1061 MagickExport MagickBooleanType MagickComponentGenesis(void)
1063 AcquireSemaphoreInfo(&magick_semaphore);
1068 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1072 + M a g i c k C o m p o n e n t T e r m i n u s %
1076 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1078 % MagickComponentTerminus() destroys the magick component.
1080 % The format of the MagickComponentTerminus method is:
1082 % void MagickComponentTerminus(void)
1085 MagickExport void MagickComponentTerminus(void)
1087 if (magick_semaphore == (SemaphoreInfo *) NULL)
1088 AcquireSemaphoreInfo(&magick_semaphore);
1089 LockSemaphoreInfo(magick_semaphore);
1090 if (magick_list != (SplayTreeInfo *) NULL)
1091 magick_list=DestroySplayTree(magick_list);
1092 instantiate_magick=MagickFalse;
1093 UnlockSemaphoreInfo(magick_semaphore);
1094 DestroySemaphoreInfo(&magick_semaphore);
1098 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1102 % M a g i c k C o r e G e n e s i s %
1106 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1108 % MagickCoreGenesis() initializes the MagickCore environment.
1110 % The format of the MagickCoreGenesis function is:
1112 % MagickCoreGenesis(const char *path,
1113 % const MagickBooleanType establish_signal_handlers)
1115 % A description of each parameter follows:
1117 % o path: the execution path of the current ImageMagick client.
1119 % o establish_signal_handlers: set to MagickTrue to use MagickCore's own
1120 % signal handlers for common signals.
1124 static SignalHandler *SetMagickSignalHandler(int signal_number,
1125 SignalHandler *handler)
1127 #if defined(MAGICKCORE_HAVE_SIGACTION) && defined(MAGICKCORE_HAVE_SIGEMPTYSET)
1139 sigaddset(&mask,signal_number);
1140 sigprocmask(SIG_BLOCK,&mask,NULL);
1141 action.sa_mask=mask;
1142 action.sa_handler=handler;
1144 #if defined(SA_INTERRUPT)
1145 action.sa_flags|=SA_INTERRUPT;
1147 status=sigaction(signal_number,&action,&previous_action);
1150 sigprocmask(SIG_UNBLOCK,&mask,NULL);
1151 return(previous_action.sa_handler);
1153 return(signal(signal_number,handler));
1157 static void MagickSignalHandler(int signal_number)
1159 #if !defined(MAGICKCORE_HAVE_SIGACTION)
1160 (void) signal(signal_number,SIG_IGN);
1162 AsynchronousResourceComponentTerminus();
1163 instantiate_magick=MagickFalse;
1164 (void) SetMagickSignalHandler(signal_number,signal_handlers[signal_number]);
1165 #if defined(MAGICKCORE_HAVE_RAISE)
1166 if (signal_handlers[signal_number] != MagickSignalHandler)
1167 raise(signal_number);
1169 #if defined(SIGQUIT)
1170 if (signal_number == SIGQUIT)
1173 #if defined(SIGABRT)
1174 if (signal_number == SIGABRT)
1178 if (signal_number == SIGFPE)
1181 #if defined(SIGXCPU)
1182 if (signal_number == SIGXCPU)
1185 #if defined(SIGXFSZ)
1186 if (signal_number == SIGXFSZ)
1189 #if defined(SIGSEGV)
1190 if (signal_number == SIGSEGV)
1193 #if !defined(MAGICKCORE_HAVE__EXIT)
1194 exit(signal_number);
1197 if (signal_number == SIGHUP)
1198 exit(signal_number);
1200 #if defined(SIGINT) && !defined(MAGICKCORE_WINDOWS_SUPPORT)
1201 if (signal_number == SIGINT)
1202 exit(signal_number);
1204 #if defined(SIGTERM)
1205 if (signal_number == SIGTERM)
1206 exit(signal_number);
1208 _exit(signal_number); /* do not invoke registered atexit() methods */
1212 static SignalHandler *RegisterMagickSignalHandler(int signal_number)
1217 handler=SetMagickSignalHandler(signal_number,MagickSignalHandler);
1218 if (handler == SIG_ERR)
1220 if (handler != SIG_DFL)
1221 handler=SetMagickSignalHandler(signal_number,handler);
1223 (void) LogMagickEvent(ConfigureEvent,GetMagickModule(),
1224 "Register handler for signal: %d",signal_number);
1228 MagickExport void MagickCoreGenesis(const char *path,
1229 const MagickBooleanType establish_signal_handlers)
1233 execution_path[MaxTextExtent],
1234 filename[MaxTextExtent];
1237 Initialize the Magick environment.
1240 if (instantiate_magickcore != MagickFalse)
1242 UnlockMagickMutex();
1245 (void) SemaphoreComponentGenesis();
1246 (void) LogComponentGenesis();
1247 (void) LocaleComponentGenesis();
1248 (void) RandomComponentGenesis();
1249 events=GetEnvironmentValue("MAGICK_DEBUG");
1250 if (events != (char *) NULL)
1252 (void) SetLogEventMask(events);
1253 events=DestroyString(events);
1255 #if defined(MAGICKCORE_WINDOWS_SUPPORT)
1256 #if defined(_DEBUG) && !defined(__BORLANDC__) && !defined(__MINGW32__)
1257 if (IsEventLogging() != MagickFalse)
1262 debug=_CrtSetDbgFlag(_CRTDBG_REPORT_FLAG);
1263 debug|=_CRTDBG_CHECK_ALWAYS_DF |_CRTDBG_DELAY_FREE_MEM_DF |
1264 _CRTDBG_LEAK_CHECK_DF;
1267 debug=_CrtSetDbgFlag(debug);
1268 _ASSERTE(_CrtCheckMemory());
1274 Set client name and execution path.
1276 (void) GetExecutionPath(execution_path,MaxTextExtent);
1277 if ((path != (const char *) NULL) && (*path != '\0'))
1278 (void) CopyMagickString(execution_path,path,MaxTextExtent);
1279 GetPathComponent(execution_path,TailPath,filename);
1280 (void) SetClientName(filename);
1281 GetPathComponent(execution_path,HeadPath,execution_path);
1282 (void) SetClientPath(execution_path);
1283 if (establish_signal_handlers != MagickFalse)
1286 Set signal handlers.
1288 #if defined(SIGABRT)
1289 if (signal_handlers[SIGABRT] == (SignalHandler *) NULL)
1290 signal_handlers[SIGABRT]=RegisterMagickSignalHandler(SIGABRT);
1292 #if defined(SIGSEGV)
1293 if (signal_handlers[SIGSEGV] == (SignalHandler *) NULL)
1294 signal_handlers[SIGSEGV]=RegisterMagickSignalHandler(SIGSEGV);
1297 if (signal_handlers[SIGFPE] == (SignalHandler *) NULL)
1298 signal_handlers[SIGFPE]=RegisterMagickSignalHandler(SIGFPE);
1301 if (signal_handlers[SIGHUP] == (SignalHandler *) NULL)
1302 signal_handlers[SIGHUP]=RegisterMagickSignalHandler(SIGHUP);
1304 #if defined(SIGINT) && !defined(MAGICKCORE_WINDOWS_SUPPORT)
1305 if (signal_handlers[SIGINT] == (SignalHandler *) NULL)
1306 signal_handlers[SIGINT]=RegisterMagickSignalHandler(SIGINT);
1308 #if defined(SIGQUIT)
1309 if (signal_handlers[SIGQUIT] == (SignalHandler *) NULL)
1310 signal_handlers[SIGQUIT]=RegisterMagickSignalHandler(SIGQUIT);
1312 #if defined(SIGTERM)
1313 if (signal_handlers[SIGTERM] == (SignalHandler *) NULL)
1314 signal_handlers[SIGTERM]=RegisterMagickSignalHandler(SIGTERM);
1316 #if defined(SIGXCPU)
1317 if (signal_handlers[SIGXCPU] == (SignalHandler *) NULL)
1318 signal_handlers[SIGXCPU]=RegisterMagickSignalHandler(SIGXCPU);
1320 #if defined(SIGXFSZ)
1321 if (signal_handlers[SIGXFSZ] == (SignalHandler *) NULL)
1322 signal_handlers[SIGXFSZ]=RegisterMagickSignalHandler(SIGXFSZ);
1326 Instantiate magick resources.
1328 (void) ConfigureComponentGenesis();
1329 (void) PolicyComponentGenesis();
1330 (void) CacheComponentGenesis();
1331 (void) RegistryComponentGenesis();
1332 (void) ResourceComponentGenesis();
1333 (void) CoderComponentGenesis();
1334 (void) MagickComponentGenesis();
1335 #if defined(MAGICKCORE_MODULES_SUPPORT)
1336 (void) ModuleComponentGenesis();
1338 (void) DelegateComponentGenesis();
1339 (void) MagicComponentGenesis();
1340 (void) ColorComponentGenesis();
1341 (void) TypeComponentGenesis();
1342 (void) MimeComponentGenesis();
1343 (void) ConstituteComponentGenesis();
1344 (void) AnnotateComponentGenesis();
1345 #if defined(MAGICKCORE_X11_DELEGATE)
1346 (void) XComponentGenesis();
1348 instantiate_magickcore=MagickTrue;
1349 UnlockMagickMutex();
1353 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1357 % M a g i c k C o r e T e r m i n u s %
1361 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1363 % MagickCoreTerminus() destroys the MagickCore environment.
1365 % The format of the MagickCoreTerminus function is:
1367 % MagickCoreTerminus(void)
1370 MagickExport void MagickCoreTerminus(void)
1373 if (instantiate_magickcore == MagickFalse)
1375 UnlockMagickMutex();
1378 #if defined(MAGICKCORE_X11_DELEGATE)
1379 XComponentTerminus();
1381 AnnotateComponentTerminus();
1382 ConstituteComponentTerminus();
1383 MimeComponentTerminus();
1384 TypeComponentTerminus();
1385 ColorComponentTerminus();
1386 #if defined(MAGICKCORE_WINDOWS_SUPPORT)
1387 NTGhostscriptUnLoadDLL();
1389 MagicComponentTerminus();
1390 DelegateComponentTerminus();
1391 MagickComponentTerminus();
1392 #if !defined(MAGICKCORE_BUILD_MODULES)
1393 UnregisterStaticModules();
1395 #if defined(MAGICKCORE_MODULES_SUPPORT)
1396 ModuleComponentTerminus();
1398 CoderComponentTerminus();
1399 ResourceComponentTerminus();
1400 RegistryComponentTerminus();
1401 CacheComponentTerminus();
1402 PolicyComponentTerminus();
1403 ConfigureComponentTerminus();
1404 RandomComponentTerminus();
1405 LocaleComponentTerminus();
1406 LogComponentTerminus();
1407 SemaphoreComponentTerminus();
1408 instantiate_magickcore=MagickFalse;
1409 UnlockMagickMutex();
1413 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1417 + R e g i s t e r M a g i c k I n f o %
1421 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1423 % RegisterMagickInfo() adds attributes for a particular image format to the
1424 % list of supported formats. The attributes include the image format name,
1425 % a method to read and/or write the format, whether the format supports the
1426 % saving of more than one frame to the same file or blob, whether the format
1427 % supports native in-memory I/O, and a brief description of the format.
1429 % The format of the RegisterMagickInfo method is:
1431 % MagickInfo *RegisterMagickInfo(MagickInfo *magick_info)
1433 % A description of each parameter follows:
1435 % o magick_info: the magick info.
1438 MagickExport MagickInfo *RegisterMagickInfo(MagickInfo *magick_info)
1444 Delete any existing name.
1446 assert(magick_info != (MagickInfo *) NULL);
1447 assert(magick_info->signature == MagickSignature);
1448 (void) LogMagickEvent(TraceEvent,GetMagickModule(),"%s",magick_info->name);
1449 if (magick_list == (SplayTreeInfo *) NULL)
1450 return((MagickInfo *) NULL);
1451 status=AddValueToSplayTree(magick_list,magick_info->name,magick_info);
1452 if (status == MagickFalse)
1453 ThrowFatalException(ResourceLimitFatalError,"MemoryAllocationFailed");
1454 return(magick_info);
1458 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1462 + S e t M a g i c k I n f o %
1466 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1468 % SetMagickInfo() allocates a MagickInfo structure and initializes the members
1469 % to default values.
1471 % The format of the SetMagickInfo method is:
1473 % MagickInfo *SetMagickInfo(const char *name)
1475 % A description of each parameter follows:
1477 % o magick_info: Method SetMagickInfo returns the allocated and initialized
1478 % MagickInfo structure.
1480 % o name: a character string that represents the image format associated
1481 % with the MagickInfo structure.
1484 MagickExport MagickInfo *SetMagickInfo(const char *name)
1489 assert(name != (const char *) NULL);
1490 (void) LogMagickEvent(TraceEvent,GetMagickModule(),"%s",name);
1491 magick_info=(MagickInfo *) AcquireMagickMemory(sizeof(*magick_info));
1492 if (magick_info == (MagickInfo *) NULL)
1493 ThrowFatalException(ResourceLimitFatalError,"MemoryAllocationFailed");
1494 (void) ResetMagickMemory(magick_info,0,sizeof(*magick_info));
1495 magick_info->name=ConstantString(name);
1496 magick_info->adjoin=MagickTrue;
1497 magick_info->blob_support=MagickTrue;
1498 magick_info->thread_support=(MagickStatusType) (DecoderThreadSupport |
1499 EncoderThreadSupport);
1500 magick_info->signature=MagickSignature;
1501 return(magick_info);
1505 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1509 % S e t M a g i c k P r e c i s i o n %
1513 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1515 % SetMagickPrecision() sets the maximum number of significant digits to be
1516 % printed and returns it.
1518 % The format of the SetMagickPrecision method is:
1520 % int SetMagickPrecision(const int precision)
1522 % A description of each parameter follows:
1524 % o precision: set the maximum number of significant digits to be printed.
1527 MagickExport int SetMagickPrecision(const int precision)
1530 magick_precision = 0;
1532 (void) LogMagickEvent(TraceEvent,GetMagickModule(),"...");
1534 magick_precision=precision;
1535 return(magick_precision);
1539 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1543 + U n r e g i s t e r M a g i c k I n f o %
1547 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1549 % UnregisterMagickInfo() removes a name from the magick info list. It returns
1550 % MagickFalse if the name does not exist in the list otherwise MagickTrue.
1552 % The format of the UnregisterMagickInfo method is:
1554 % MagickBooleanType UnregisterMagickInfo(const char *name)
1556 % A description of each parameter follows:
1558 % o name: a character string that represents the image format we are
1562 MagickExport MagickBooleanType UnregisterMagickInfo(const char *name)
1564 register const MagickInfo
1570 assert(name != (const char *) NULL);
1571 if (magick_list == (SplayTreeInfo *) NULL)
1572 return(MagickFalse);
1573 if (GetNumberOfNodesInSplayTree(magick_list) == 0)
1574 return(MagickFalse);
1575 LockSemaphoreInfo(magick_semaphore);
1576 ResetSplayTreeIterator(magick_list);
1577 p=(const MagickInfo *) GetNextValueInSplayTree(magick_list);
1578 while (p != (const MagickInfo *) NULL)
1580 if (LocaleCompare(p->name,name) == 0)
1582 p=(const MagickInfo *) GetNextValueInSplayTree(magick_list);
1584 status=DeleteNodeByValueFromSplayTree(magick_list,p);
1585 UnlockSemaphoreInfo(magick_semaphore);