InvokeDynamicImageFilter return value in ImageMagick-6.4.0-4

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
jimxoch

InvokeDynamicImageFilter return value in ImageMagick-6.4.0-4

Post by jimxoch »

Hi all,

I have noticed that the InvokeDynamicImageFilter() return value seems always to be MagickFalse, even if the Filter plug-in has actually reported success. After reading the InvokeDynamicImageFilter() implementation in module.c file, I have the impression that, this happens due to incomplete handling of the value (signature) returned from the filter-plugin. The snippet bellow demonstrates in code what I have already said in words. (See the //*** comment)

This is not a big problem for me, just a little confusing, but I am reporting it, since it seems an easy fix to do...

Best Regards
Jim Xochellis

Code: Select all

//---------------------------------

status = MagickFalse;

/* ... code that does not affect the <status> value ... */

/*
   Execute the module.
 */
image_filter=(ImageFilterHandler *) lt_dlsym(handle,name);
if (image_filter == (ImageFilterHandler *) NULL)
	(void) ThrowMagickException(exception,GetMagickModule(),ModuleError,
			"UnableToLoadModule","`%s': %s",name,lt_dlerror());
else
{
	unsigned long
		signature;

	if ((*images)->debug != MagickFalse)
		(void) LogMagickEvent(ModuleEvent,GetMagickModule(),
				"Invoking \"%s\" dynamic image filter",tag);
	signature=image_filter(images,argc,argv,exception);
	if ((*images)->debug != MagickFalse)
		(void) LogMagickEvent(ModuleEvent,GetMagickModule(),"\"%s\" completes",
				tag);
	if (signature != MagickImageFilterSignature)
	{
		(void) ThrowMagickException(exception,GetMagickModule(),ModuleError,
				"ImageFilterSignatureMismatch","`%s': %8lx != %8lx",tag,signature,
				MagickImageFilterSignature);
		return(MagickFalse);
	}
	//*** ELSE IS MISSING HERE (success case)
}
/*
   Close the module.
 */
(void) lt_dlclose(handle);
return(status);

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

Re: InvokeDynamicImageFilter return value in ImageMagick-6.4.0-4

Post by magick »

Thanks for the problem report. ImageMagick 6.4.0-8 beta has a patch to return MagickTrue if the dynamic filter does not throw an exception. 6.4.0-8 will be available sometime tomorrow.
Post Reply