Convert function not working

Questions and postings pertaining to the usage of ImageMagick regardless of the interface. This includes the command-line utilities, as well as the C and C++ APIs. Usage questions are like "How do I use ImageMagick to create drop shadows?".
Post Reply
inthesky

Convert function not working

Post by inthesky »

Hi

I'm using ImageMagick-6.5.4-Q16 on XP with Apache (Ghostscript is also installed) to try and convert a pdf to png. Using the full path to the convert.exe works fine
e.g.

Code: Select all

exec("C:\progra~1\ImageMagick-6.5.4-Q16\convert.exe -colorspace rgb -geometry 460x460 ... etc")
but using just the convert keyword fails to work, with the errors of invalid parameters.
e.g.

Code: Select all

exec("convert -colorspace rgb -geometry 460x460 ...")
Any idea how to fix this?

Thanks
Bonzo
Posts: 2971
Joined: 2006-05-20T08:08:19-07:00
Location: Cambridge, England

Re: Convert function not working

Post by Bonzo »

I would say there is something wrong with the path; try installing again ?
inthesky

Re: Convert function not working

Post by inthesky »

Yeah I've reinstalled a couple of times now and added gs to the delegates file, but it's still doing the same thing.
el_supremo
Posts: 1015
Joined: 2005-03-21T21:16:57-07:00

Re: Convert function not working

Post by el_supremo »

That may be the usual problem with the conflict of names between IM's convert and the Windows "convert" program (which complains about invalid parameters).
Changing the Imagemagick program's name to imconvert and using that instead will avoid the conflict.

Pete
Sorry, my ISP shutdown all personal webspace so my MagickWand Examples in C is offline.
See my message in this topic for a link to a zip of all the files.
Bonzo
Posts: 2971
Joined: 2006-05-20T08:08:19-07:00
Location: Cambridge, England

Re: Convert function not working

Post by Bonzo »

I wonder why some people have problems with IM convert and Windows convert ?

I have installed IM 3 times on my old XP PC and once on my new Vista PC without any problems.
el_supremo
Posts: 1015
Joined: 2005-03-21T21:16:57-07:00

Re: Convert function not working

Post by el_supremo »

Bonzo wrote:I wonder why some people have problems with IM convert and Windows convert ?
That's a good point Bonzo, so I first checked to see if using "convert" in a DOS window caused a problem on my system and it didn't.
I had a look at the PATH environment variables on my system and the ImageMagick path is set near the front of the PATH variable for the System Variables (not the user). If I change that PATH by just removing the reference to the ImageMagick directory and then open a new DOS window, the convert fails.
So, it looks like what is really needed is to ensure that the path to the directory containing the ImageMagick convert.exe program is in the system PATH variable.

Pete
Sorry, my ISP shutdown all personal webspace so my MagickWand Examples in C is offline.
See my message in this topic for a link to a zip of all the files.
inthesky

Re: Convert function not working

Post by inthesky »

Renaming the convert exe doesn't seem to help either. Checked the PATH and that all seems to be correct, so I'm not really sure what's up with it. I had managed to get it working on a previous old machine, so this is all quite baffling.
Post Reply