Page 1 of 1

Bugs finding coders relative to executable

Posted: 2011-11-09T09:04:36-07:00
by aberent
Tested on ImageMagick 6.7.1, built on and for Intel 32-bit Ubuntu 10.04, but the code appears still to be incorrect on the SVN head.

The ImageMagick resources page states that ImageMagick will search "<client path>/../lib/ImageMagick-6.7.3/modules-Q16/coders/" for coders, however ImageMagick (specifically convert) wasn't finding coders in this location. Investigating the source code I found two reasons for this:
1. magick.c line 1277 (in version 6.7.1) correctly calls GetExecutionPath, but then, unless path is blank or null, ignores the result and uses path. path will normally be arg0 (the command used to start the application) when this is called. If arg0 isn't a full path name then line 1282 won't get a useful directory location. Proposed fix, reverse the logic of lines 1278 and 1279 so that is prefers the result of GetExecutionPath:

Code: Select all

  if ((execution_path == (const char *) NULL) || (execution_path == '\0'))
    (void) CopyMagickString(execution_path,path,MaxTextExtent);
2. Modules.c line 753 is looking in a directory called "modules". It should be looking in a directory called "coders".

Re: Bugs finding coders relative to executable

Posted: 2011-11-09T10:56:54-07:00
by magick
We can reproduce the problem you posted and will have a patch in ImageMagick 6.7.3-5 Beta within a day or two. Thanks.