Page 1 of 1
-process
Posted: 2007-01-19T00:01:10-07:00
by rmabry
My custom modules work no more.
Not so long ago I could execute something like
Code: Select all
convert inface1.jpg -process myproc="-opt1 arg1 -opt2 arg2" outface.jpg
and my module (myproc.dll) got the call at the follow line.
Code: Select all
ModuleExport MagickBooleanType myprocImage(Image **images,const int argc, char **argv)
In those days, argc was always 1 and I processed my own args by splitting this one arg (the string after the = above). A change has occurred and nothing works. It actually seems that argc is zero no matter what I try. The doc now sauggests the args would just be placed as follows,
Code: Select all
convert inface1.jpg -process myproc -opt1 arg1 -opt2 arg2 outface.jpg
but that doesn't work, and actually makes no sense to me because it isn't clear which args would be for the process and which should be processed by convert.
What the heck has happened (and why?) and where should I look for a solution? I have months and months of work tied up in this.
Rick
Posted: 2007-01-19T08:39:26-07:00
by magick
Did you try
- convert inface1.jpg -process "myproc -opt1 arg1 -opt2 arg2" outface.jpg
Let us know if that works. We'll add a patch to ensure the old syntax works as well (.e.g myproc="..").
Posted: 2007-01-19T10:19:43-07:00
by rmabry
magick wrote:
Did you try
- convert inface1.jpg -process "myproc -opt1 arg1 -opt2 arg2" outface.jpg
Let us know if that works.
Hi, thanks for the quick reply (as always).
I see. Even though that didn't work at first (I used 6.3.1), a minor tweak of the code did get it to work. Prior, I was checking to see if argc = 1, as one crude check of syntax. So I commented it out for now.
I can live with it, needing only to make such a change in 5 programs, but since you offer...
We'll add a patch to ensure the old syntax works as well (.e.g myproc="..").
... that's even better, possibly for back-pat-ability.
Gratefully yours,
Rick
Posted: 2007-01-19T11:13:55-07:00
by magick
The patch is in ImageMagick 6.3.2-1 Beta to support backwards compatibility. If you get the time, test it and let us know.
Posted: 2007-01-19T13:21:30-07:00
by rmabry
magick wrote:
The patch is in ImageMagick 6.3.2-1 Beta to support backwards compatibility. If you get the time, test it and let us know.
I'll do that. And also, I like the newer version better, since it gives a meaningful argc.
Rick
Posted: 2007-01-20T08:18:01-07:00
by rmabry
magick wrote:
The patch is in ImageMagick 6.3.2-1 Beta to support backwards compatibility. If you get the time, test it and let us know.
I grabbed it and it seems to work fine the old way. Many thanks.
Rick
Re: -process
Posted: 2008-03-03T22:42:13-07:00
by rmabry
rmabry wrote:My custom modules work no more.
That was over a year ago, and a fix was available soon after. I am now having a new problem and I have changed nothing. The symptom is this: I run my modules and I get the error
convert: ImageFilterSignatureMismatch `separate': 0 != 63710.
(The process in this example is "separateImage()".)
I'm using ImageMagick 6.3.7 11/21/07 Q16 (on Win2K) if that matters.
Everything seems to compile ok on Visual Studio 8.
[Added in edit:] Moreover, the module's code is actually executed and the image is written. So in that sense there is no error and this is not critical. But I do hate seeing an error message after every run. Something must have changed in module.c.
Do modules need to be registered somewhere? I notice that the contributed module "AnalyzeImage" throws no error.
Rick
Re: -process
Posted: 2008-03-04T07:19:15-07:00
by magick
Previously the filter signature was
void filter(Image **images,const int argc,char **argv,ExceptionInfo *exception)
It is now
unsigned long filter(Image **images,const int argc,char **argv,ExceptionInfo *exception)
The return value must be
return(MagickImageFilterSignature);
To avoid the exception you are seeing. We'll leave it as an exercise to the reader to determine why this change is a good idea.