-process

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
User avatar
rmabry
Posts: 148
Joined: 2004-04-13T11:25:27-07:00

-process

Post 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
User avatar
magick
Site Admin
Posts: 11064
Joined: 2003-05-31T11:32:55-07:00

Post 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="..").
User avatar
rmabry
Posts: 148
Joined: 2004-04-13T11:25:27-07:00

Post 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
User avatar
magick
Site Admin
Posts: 11064
Joined: 2003-05-31T11:32:55-07:00

Post 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.
User avatar
rmabry
Posts: 148
Joined: 2004-04-13T11:25:27-07:00

Post 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
User avatar
rmabry
Posts: 148
Joined: 2004-04-13T11:25:27-07:00

Post 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
User avatar
rmabry
Posts: 148
Joined: 2004-04-13T11:25:27-07:00

Re: -process

Post 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
User avatar
magick
Site Admin
Posts: 11064
Joined: 2003-05-31T11:32:55-07:00

Re: -process

Post 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.
Post Reply