Bug in analyze.dll

Post any defects you find in the released or beta versions of the ImageMagick software here. Include the ImageMagick version, OS, and any command-line required to reproduce the problem. Got a patch for a bug? Post it here.
Post Reply
eldiener

Bug in analyze.dll

Post by eldiener »

The analyze.dll, which is a filter, exports its function with the name 'AnalyzeImage'. However the module system looks on analyze.dll for a function named 'analyzeImage' ( note the case ). This causes a mismatch and the function is never found. The exported name for analyze.dll needs to be changed to 'analyzeImage'. I am using the latest release of ImageMagick with Magick++, release 6.3.5.
User avatar
magick
Site Admin
Posts: 11064
Joined: 2003-05-31T11:32:55-07:00

Re: Bug in analyze.dll

Post by magick »

Where is AnalyzeImage being exported as analyzeImage? We checked the source distribution and cannot find any references to the lowercase analyzeImage. AnalyzeImage() works properly under Linux. We'll take a closer look to the method under Windows after we hear back from you.
eldiener

Re: Bug in analyze.dll

Post by eldiener »

magick wrote:Where is AnalyzeImage being exported as analyzeImage? We checked the source distribution and cannot find any references to the lowercase analyzeImage. AnalyzeImage() works properly under Linux. We'll take a closer look to the method under Windows after we hear back from you.
As I explained in my OP, the export is 'AnalyzeImage', not 'analyzeImage', but it should be the latter. The reason for this is that the DLL, or module, for the filter is 'analyze' and not 'Analyze' under Windows. When you call the ExecuteModuleProcess in module.c, passing 'analyze' as the module tag, the routine does a TagToFilterModuleName to get the name of the DLL to load as analyze.dll, correctly does a lt_dlopen on the DLL which no doubt does a Windows LoadLibrary under the covers, then concatenates the 'analyze' name with 'Image', as 'analyzeImage' to get the procedure to call via lt_dlsym. But this fails since the procedure is exported as 'AnalyzeImage' instead.

You might argue that 'Analyze' should be the tag passed to ExecuteModuleProcess but I think this is wrong because the tag reflects the shared library base name. In other words if the shared library base name is 'analyze', then the function to call using ExecuteModuleProcess should be 'analyzeImage', NOT 'AnalyzeImage'.

Why the wrong exported name works under Linux I do not know but it does not work under Windows when calling lt_dlsym in ExecuteModuleProcess in module.c.
User avatar
magick
Site Admin
Posts: 11064
Joined: 2003-05-31T11:32:55-07:00

Re: Bug in analyze.dll

Post by magick »

Thanks for the detailed explanation. We will have a patch in ImageMagick 6.3.5-7 for the problem within a few days.
Post Reply