Why does it work differently from different locations? C++

Questions and postings pertaining to the usage of ImageMagick regardless of the interface. This includes the command-line utilities, as well as the C and C++ APIs. Usage questions are like "How do I use ImageMagick to create drop shadows?".
Post Reply
mczarnek
Posts: 5
Joined: 2013-04-30T11:01:59-07:00
Authentication code: 6789

Why does it work differently from different locations? C++

Post by mczarnek »

When I install ImageMagick and run my code which calls InitializeMagick(NULL), it works fine. However when I copy and paste the contents of the program files folder somewhere else and call InitializeMagick(as well as uninstall it from the normal directory), it crashes. Specifically when trying to draw.

Any idea why? Way to fix it without spending a lot of time messing with ImageMagick source code?

Somehow it finds that directory even if I remove it from the system PATH variable.
mczarnek
Posts: 5
Joined: 2013-04-30T11:01:59-07:00
Authentication code: 6789

Re: Why does it work differently from different locations? C

Post by mczarnek »

Actually after a couple very frustrating days, I fixed this one on my own. Turns out they store the path to the working library is stored in the registry.

So in case someone comes across this a year from now, here's what I did:
Go into Windows Registry and edit the 'HKEY_LOCAL_MACHINE/SOFTWARE/Wow6432Node/ImageMagick' registry keys so they point to the correct location.

There may be a better solution involving recompiling code or something... it seems like a bug since it is supposed to be able to work from a local directory but this does the trick for my purposes.
Post Reply