Upgrading from 5.3.0 to 6.3.6, need help setting MagickPath

Questions and postings pertaining to the development of ImageMagick, feature enhancements, and ImageMagick internals. ImageMagick source code and algorithms are discussed here. Usage questions which are too arcane for the normal user list should also be posted here.
Post Reply
jla

Upgrading from 5.3.0 to 6.3.6, need help setting MagickPath

Post by jla »

We use ImageMagick in a limited way to convert images from one format to another, but only between TIF, GIF, JPG, and BMP. At 5.3.0 we were able to transport with our XP Windows application a sub-set of IM in separate bin, lib, and include directories within our application directory structure. At application startup time we would set MagickPath within our application and call "MagickIncarnate( MagickPath );" to initialize ImageMagick and everything seemed to work just fine.

Unfortunately this same approach does not work in 6.3.6. I have tried various ways to communicate the path to IM and have not been successful. I have read about using the "--disable-install" option on unix type installs, what is the Windows equivalent to that? IM seems to ignore anything I put in MAGICK_HOME. Is there some other way for me to set MagickPath programatically? This would be the preferred way since we deploy our application and it gives us better control over setting up what IM needs to know at run time.

Thanks in advance.
jla
User avatar
magick
Site Admin
Posts: 11064
Joined: 2003-05-31T11:32:55-07:00

Re: Upgrading from 5.3.0 to 6.3.6, need help setting MagickPath

Post by magick »

The ImageMagick Windows binaries we build are "installed" versions. You most likely need to build a static version of ImageMagick yourself and put all the executables and configurations files in the same folder. If you build ImageMagick from source under Windows it defaults to the "uninstalled" version and will look for its configuration files in the same folder it finds the executables and DLL's. If you have any further problems let us know.
jla

Re: Upgrading from 5.3.0 to 6.3.6, need help setting MagickPath

Post by jla »

I have been building and moving the libs and dlls. We never use the exe's, but I made them also. We only use the API and then only a small portion, something like this,
CloneImageInfo
ReadImage
WriteImage
DestroyImageInfo
DestroyImage
We store images in blobs within our database and may later retreive them, display them on screen, extract them to disk or whatever. The problem remains that I cannot get IM to recognize the location of the relocated dlls at startup time. Message reads "Application has faild to start because CORE_DB_magick_.dll was not found..." but it is in the location that I specified in MAGICK_HOME and set with _putenv prior to calling InitializeMagick.

jla
jla

Re: Upgrading from 5.3.0 to 6.3.6, need help setting MagickPath

Post by jla »

I have rebuilt again and IM now seems to be getting a little further, but still not starting up properly. My startup code is:
If (Not IsMagickInstantiated()) Then
AC_Get_Name( charC Magick_Path, "$SRCDIR+\\imagemagick", sizeof( Magick_Path ) ) ; // this resolves the $SRCDIR variable
Set Magick_Home to "MAGICK_HOME=" + Magick_Path ;
_putenv( charC Magick_Home ) ;
getenv( charC Magick_Test ) ;
If Magick_Test NE Magick_Path Then
printf ("Setting of MAGICK_HOME failed") ;
exit(0) ;
Endif
MagickCoreGenesis( charC Magick_Path, False ) ;
Endif
==I know this is not PURE C code, we have an in house pre-processor. The IsMagickInstantiated is found and processes fine, but the MagickCoreGenesis (or InitializeMagick when I try that) give me this message at start up)
"The procedure entry point MagickCoreGenesis could not be located in the dynamic link library CORE_RL_magick_.dll."

jla
User avatar
magick
Site Admin
Posts: 11064
Joined: 2003-05-31T11:32:55-07:00

Re: Upgrading from 5.3.0 to 6.3.6, need help setting MagickPath

Post by magick »

Do you have an older version of ImageMagick on your system? MagickCoreGenesis() is defined in magick/magick.c and should be a resolvable symbol in the MagickCore DLL. Also define the environment variable MAGICK_DEBUG to "configure". That will spit out a trace so you can track where ImageMagick is looking for its configuration files.
jla

Re: Upgrading from 5.3.0 to 6.3.6, need help setting MagickPath

Post by jla »

Good Morning

I don't seem to be able to get past this. I deleted my IM 6.3.6. downloaded a fresh Windows source, unzipped, did a full build without changing any options. Moved the entire resulting VisualMagick\lib and VisualMagick\bin into my Application directory structure along with the "magick" .h files. Rebuilt my own application. Which Links clean, so it knows about "IsMagickInstantiated" and "MagickCoreGenesis", and yet when I execute I get the message that "The procedure entry point "MagickCoreGenesis could not be located in the dynamic link library CORE_RL_magick_.dll". I get the same thing if I try to use InitializeMagick.
jla

Re: Upgrading from 5.3.0 to 6.3.6, need help setting MagickPath

Post by jla »

Yesterdays problem was old copy of CORE_RL_magick_.dll sitting in same directory as our application EXE. I had forgotten that there is no other way to get the initial load of the DLLs except to put them in the directory with our EXE, sorry about that.

However, I still need to know this -- How can I set MAGICK_HOME or MagickPath or whatever, at the time I am ready to InitializeMagick or MagickCoreGenesis? I stepped thru InitializeMagick in Debug and even though I have the MAGICK_HOME variable set and even though I have MAGICK_DEBUG set to "configure", I get no tracing information. When I begin to call IM procedures I get Delegate exceptions, which makes sense because IM doesn't yet know where its stuff is located.

jla
Post Reply