Exemple #1
0
void
imageproc::init()
{
    unsigned int i;
    
    RegisterStaticModules();
    InitializeMagick(NULL);

    // let's output a startup banner with available image type support
    ExceptionInfo exception;
    MagickInfo ** arr = GetMagickInfoArray( &exception );
    std::stringstream ss;
    
    ss << "GraphicsMagick engine initialized with support for: [ ";

    bool first = true;
    while (arr && *arr) {
        if (!first) ss << ", ";
        first = false;
        ss << (*arr)->name;
        char * mt = MagickToMime( (*arr)->name );
        if (mt) {
            s_imgFormats[(*arr)->name] = std::string(mt);
            ss << " (" << mt << ")";
            free(mt);
        }
        arr++;
    }
    ss << " ]";
    g_bpCoreFunctions->log(BP_INFO, ss.str().c_str());

    ss.str("");
    ss << "Supported transformations: [ ";
    first = true;
    for (i = 0; i < trans::num(); i++)
    {
        if (!first) ss << ", ";
        first = false;
        ss << trans::get(i)->name;
    }
    ss << " ]";
    g_bpCoreFunctions->log(BP_INFO, ss.str().c_str());
}
Exemple #2
0
/*
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%                                                                             %
%                                                                             %
%                                                                             %
+   I n i t i a l i z e M a g i c k I n f o L i s t                           %
%                                                                             %
%                                                                             %
%                                                                             %
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
%  Method InitializeMagickInfoList initializes the magick info facility
%
%  The format of the InitializeMagickInfoList method is:
%
%      MagickPassFail InitializeMagickInfoList(void)
%
%
*/
MagickPassFail
InitializeMagickInfoList(void)
{
  assert(magick_semaphore == (SemaphoreInfo *) NULL);
  magick_semaphore=AllocateSemaphoreInfo();

#if defined(SupportMagickModules)
  assert(module_semaphore == (SemaphoreInfo *) NULL);
  module_semaphore=AllocateSemaphoreInfo();
#endif /* #if defined(SupportMagickModules) */

#if !defined(BuildMagickModules)
  RegisterStaticModules();          /* Register all static modules */
#endif /* !defined(BuildMagickModules) */

#if defined(SupportMagickModules)
  InitializeMagickModules();        /* Module loader */
#endif /* defined(SupportMagickModules) */

  return MagickPass;
}