ExceptionInfo *exception)
{
register const MagickInfo
- *p;
+ *magick_info;
+ /*
+ Find named module attributes.
+ */
assert(exception != (ExceptionInfo *) NULL);
if (IsMagickTreeInstantiated(exception) == MagickFalse)
return((const MagickInfo *) NULL);
+ magick_info=(const MagickInfo *) NULL;
#if defined(MAGICKCORE_MODULES_SUPPORT)
- if ((name != (const char *) NULL) && (LocaleCompare(name,"*") == 0))
- (void) OpenModules(exception);
-#endif
- /*
- Find name in list.
- */
- LockSemaphoreInfo(magick_semaphore);
- ResetSplayTreeIterator(magick_list);
- p=(const MagickInfo *) GetNextValueInSplayTree(magick_list);
- if ((name == (const char *) NULL) || (LocaleCompare(name,"*") == 0))
+ if ((name != (const char *) NULL) && (*name != '\0'))
{
- ResetSplayTreeIterator(magick_list);
- p=(const MagickInfo *) GetNextValueInSplayTree(magick_list);
+ LockSemaphoreInfo(magick_semaphore);
+ if (LocaleCompare(name,"*") == 0)
+ (void) OpenModules(exception);
+ else
+ {
+ magick_info=(const MagickInfo *) GetValueFromSplayTree(magick_list,
+ name);
+ if (magick_info == (const MagickInfo *) NULL)
+ (void) OpenModule(name,exception);
+ }
UnlockSemaphoreInfo(magick_semaphore);
- return(p);
}
- while (p != (const MagickInfo *) NULL)
- {
- if (LocaleCompare(p->name,name) == 0)
- break;
- p=(const MagickInfo *) GetNextValueInSplayTree(magick_list);
- }
-#if defined(MAGICKCORE_MODULES_SUPPORT)
- if (p == (const MagickInfo *) NULL)
+#endif
+ if ((name == (const char *) NULL) || (LocaleCompare(name,"*") == 0))
{
- if (*name != '\0')
- (void) OpenModule(name,exception);
+ LockSemaphoreInfo(magick_semaphore);
ResetSplayTreeIterator(magick_list);
- p=(const MagickInfo *) GetNextValueInSplayTree(magick_list);
- while (p != (const MagickInfo *) NULL)
- {
- if (LocaleCompare(p->name,name) == 0)
- break;
- p=(const MagickInfo *) GetNextValueInSplayTree(magick_list);
- }
+ magick_info=(const MagickInfo *) GetNextValueInSplayTree(magick_list);
+ UnlockSemaphoreInfo(magick_semaphore);
+ return(magick_info);
}
-#endif
- UnlockSemaphoreInfo(magick_semaphore);
- return(p);
+ if (magick_info == (const MagickInfo *) NULL)
+ magick_info=(const MagickInfo *) GetValueFromSplayTree(magick_list,name);
+ return(magick_info);
}
\f
/*
"-extract geometry extract area from image",
"-format \"string\" output formatted image characteristics",
"-fuzz distance colors within this distance are considered equal",
+ "-gravity type horizontal and vertical text placement",
"-highlight-color color",
" empasize pixel differences with this color",
"-identify identify the format and characteristics of the image",
}
ThrowCompareException(OptionError,"UnrecognizedOption",option)
}
+ case 'g':
+ {
+ if (LocaleCompare("gravity",option+1) == 0)
+ {
+ ssize_t
+ gravity;
+
+ if (*option == '+')
+ break;
+ i++;
+ if (i == (ssize_t) argc)
+ ThrowCompareException(OptionError,"MissingArgument",option);
+ gravity=ParseCommandOption(MagickGravityOptions,MagickFalse,
+ argv[i]);
+ if (gravity < 0)
+ ThrowCompareException(OptionError,"UnrecognizedGravityType",
+ argv[i]);
+ break;
+ }
+ ThrowCompareException(OptionError,"UnrecognizedOption",option)
+ }
case 'h':
{
if ((LocaleCompare("help",option+1) == 0) ||