Page 1 of 1

nt-bast.c problems

Posted: 2008-02-20T11:01:51-07:00
by rk6125
i am trying to compile a single threaded static version and i get 11 errors in nt-base.c

i am on XP using Visual C++ 6.0 EE

here is the build output

C:\Documents and Settings\KaltreR\Desktop\ImageMagick-6.3.8\magick\nt-base.c(510) : error C2065: 'HCRYPTPROV' : undeclared identifier
C:\Documents and Settings\KaltreR\Desktop\ImageMagick-6.3.8\magick\nt-base.c(510) : error C2146: syntax error : missing ';' before identifier 'handle'
C:\Documents and Settings\KaltreR\Desktop\ImageMagick-6.3.8\magick\nt-base.c(510) : error C2065: 'handle' : undeclared identifier
C:\Documents and Settings\KaltreR\Desktop\ImageMagick-6.3.8\magick\nt-base.c(513) : error C2143: syntax error : missing ';' before 'type'
C:\Documents and Settings\KaltreR\Desktop\ImageMagick-6.3.8\magick\nt-base.c(515) : error C2064: term does not evaluate to a function
C:\Documents and Settings\KaltreR\Desktop\ImageMagick-6.3.8\magick\nt-base.c(516) : error C2065: 'status' : undeclared identifier
C:\Documents and Settings\KaltreR\Desktop\ImageMagick-6.3.8\magick\nt-base.c(516) : error C2065: 'MS_DEF_PROV' : undeclared identifier
C:\Documents and Settings\KaltreR\Desktop\ImageMagick-6.3.8\magick\nt-base.c(516) : error C2065: 'PROV_RSA_FULL' : undeclared identifier
C:\Documents and Settings\KaltreR\Desktop\ImageMagick-6.3.8\magick\nt-base.c(517) : error C2065: 'CRYPT_VERIFYCONTEXT' : undeclared identifier
C:\Documents and Settings\KaltreR\Desktop\ImageMagick-6.3.8\magick\nt-base.c(517) : error C2065: 'CRYPT_MACHINE_KEYSET' : undeclared identifier
C:\Documents and Settings\KaltreR\Desktop\ImageMagick-6.3.8\magick\nt-base.c(520) : error C2065: 'CRYPT_NEWKEYSET' : undeclared identifier

Please help

Re: nt-bast.c problems

Posted: 2008-02-20T11:09:43-07:00
by magick
HCRYPTPROV should be defined in the system header, NTSecAPI.h. Make sure the crypto API is downloaded from Microsoft or comment out the internals of the NTGatherRandomData() method in magick/nt-base.c. We use the crypto API to produce true-random numbers but ImageMagick is fine without it unless you intend on using the -encipher option.

Re: nt-bast.c problems

Posted: 2008-02-20T11:26:29-07:00
by rk6125
how do i install the crypto api. i want to make sure i can use all the functions of imagemagick. Thanks for your quick responce by the way!

Re: nt-bast.c problems

Posted: 2008-02-20T11:50:17-07:00
by magick
Not sure, we're Linux developers. All we know is that it was available on our system when we built ImageMagick and that it seems to be a commonly used Microsoft API.

Re: nt-bast.c problems

Posted: 2008-02-20T11:58:36-07:00
by rk6125
well everything compiled when i commented out the functions inerds. I was expecting the single threaded version to only allow 1 instance of ...say convert.exe to run at a time. when i check current processes....if i call convert.exe 2 times i see 2 instances in my processes. is there a way i can get this to occur?

Re: nt-bast.c problems

Posted: 2008-02-20T12:01:22-07:00
by magick
If you only want one instance of convert running at a time you need to synchronize that yourself, perhaps with a lock file. We, for example, check the system load average and if it exceeds a threshold we block until the load average returns to normal.

Re: nt-bast.c problems

Posted: 2008-02-20T12:14:51-07:00
by rk6125
well we are currently using this tool in are document management system. Recently the convert.exe has been taxing our quad core processors. At the time of full load, there were 5 instances of convert.exe running. the spikes last 15-30 seconds...which is huge in web app terms. we are calling convert from the shell and passing arguments

-quiet -resize 960x1280! file1.ext -quality 50 +profile * file2.ext

I just compiled to single threaded which should help a little, but is there any way to further increase efficency by decreasing cpu load. Our web servers are coldfusion mx 7. Would one of the api's increase efficency? Thanks for being so helpful!

Re: nt-bast.c problems

Posted: 2008-02-20T13:14:48-07:00
by magick
Interfacing with an API in most cases is significantly more efficient that running from a shell. Somewhere out there is a Cold Fusion interface to ImageMagick or use the ImageMagickObject.