Page 1 of 1

InvokeDynamicImageFilter return value in ImageMagick-6.4.0-4

Posted: 2008-04-19T05:37:19-07:00
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);

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

Re: InvokeDynamicImageFilter return value in ImageMagick-6.4.0-4

Posted: 2008-04-20T17:06:05-07:00
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.

Re: InvokeDynamicImageFilter return value in ImageMagick-6.4.0-4

Posted: 2008-04-21T09:31:24-07:00
by jimxoch
Great! :)