PDA

View Full Version : ImageMagick issue on Win32 box.


jukas
8th of October 2004 (Fri), 17:46
I'm currently hosting my site on a Windows2003 machine running IIS6. I downloaded and installed the 19mb Static Binary of ImageMagick, however I can't get the EE to view it as present.

I have posted two screen shots, the first is the errors I get when I try and run the ImageMagick test. The second is the IM Paths as I have them entered (The physical directory paths on the server).

Any ideas as to what I am doing wrong is much appreciated.

Error Message
http://www.fallenchaos.com/images/ee-error1.jpg

IM Paths
http://www.fallenchaos.com/images/im-paths.jpg

In the IM Paths I have tried leaveing it listed as convert and composite, and also specified it as convert.exe and composite.exe prior to listing the full windows path. I also tried creating a virtual directory and point it to the Imagemagick directory and then listing the path as www.fallenchaos.com/im/convert.exe which didn't work either.

steven
8th of October 2004 (Fri), 18:54
Have you tried

"C:/Program Files/ImageMagick-5.5.7-Q16/convert"

and

"C:/Program Files/ImageMagic-5.5.7-Q16/composite"

Having the quoats around the entire path are probably needed since you have spaces in the path. Also (based on what I have in my setting) need to have the name of the program (e.g. conver and composite) in this entry.

Noticed one other thing in you included example and that was after the C: you don't have a / there and with out this it would take the current working directory and add the path to that but with the / (called absolute) you should be good any where.

jukas
9th of October 2004 (Sat), 10:00
Steven,

Yup. I've tried that also. I still get


Original size: 769x513
Warning: exec(): Unable to fork [C:/Program Files/ImageMagick-5.5.7-Q16/convert -size 110x73 UPLOAD/test/source.jpg -resize 110x73! +profile '*' -unsharp .8x.7+2+.01 UPLOAD/test/ee_result_bd0bbd6f4c.jpg] in C:\wwwroot\fallenchaos.com\gallery\input\EDITOR_gr aphics_modules.php on line 780

Warning: exec(): Unable to fork [exit 0] in C:\wwwroot\fallenchaos.com\gallery\input\EDITOR_gr aphics_modules.php on line 781

steven
9th of October 2004 (Sat), 10:22
I'm guessing that it is the spaces in the path that are causing the problem.

If my guess is correct then you could try
"C:/Progra~1/ImageMagick-5.5.7-Q16/convert"

and

"C:/Progra~1/ImageMagic-5.5.7-Q16/composite"

One other check might be to open a command window and cut and past what php is outputing as the command line and see if it will execute in a command line. You would have to change to the same directory or modify the relative path it has for the image file location.

jukas
9th of October 2004 (Sat), 10:59
Steven,

Thanks for the suggestion, I entered the following from a command line


C:\>C:/Progra~1/ImageMagick-5.5.7-Q16/convert -size 110x73 UPLOAD/test/source.jpg -resize 110x73! +profile '*' unsharp .8x.7+2+.01 UPLOAD/test/ee_result_4875502806.jpg


and it spit out


C:/Progra~1/ImageMagick-5.5.7-Q16/convert: Unable to open file (UPLOAD/test/source.jpg).

steven
10th of October 2004 (Sun), 19:50
Cool, you have not got the program running.

Next you have to deal with the path going to you images.

I would take a look at your PATH SETUP page.

Not positive which path is being used here as I don't know what action is happing for you in PHP. But I would look for an entry that has the stub part of you graphic file that is having the error (i.e. UPLOAD/test or UPLOAD/test/). If by luck you do find one of these two in any of your path then you will want to pre-pend (put in front) a "../" so it would look like "../UPLOAD/test"
Is is also possible that the correct path is not a relative path (that what the ../ would give you) but an absolute path. So you might need to change the path to C:\wwwroot\fallenchaos.com\gallery\input\UPLOAD\te st

jukas
10th of October 2004 (Sun), 21:21
Steven,

I don't think it's a problem with the path, I think it's some kind of php error at this point, though I can't track it down. I logged onto the server to do some testing, and found that the Imagemagick directory was recognized in the system path, so I can call the convert program from anywhere.

I also did a test to see if the ImageMagick would properly execute the command. Running the test through PHP comes up with the fork error, but doing it as follows via a command prompt spits out the resized .jpg

[code}
C:\wwwroot\fallenchaos.com\gallery\input\UPLOAD>convert -resize 110x73! CRW_2103.jpg +profile '*' -unsharp .8x.7+2+.01 ee_result_f20fc1528a.jpg

C:\wwwroot\fallenchaos.com\gallery\input\UPLOAD>dir
Volume in drive C has no label.
Volume Serial Number is 1049-F913

Directory of C:\wwwroot\fallenchaos.com\gallery\input\UPLOAD

10/10/2004 08:22 PM <DIR> .
10/10/2004 08:22 PM <DIR> ..
10/08/2004 04:34 PM 144,524 CRW_2103.jpg
10/10/2004 08:22 PM 3,012 ee_result_f20fc1528a.jpg
10/07/2004 04:30 PM <DIR> ee_temp_upload
03/29/2004 03:10 AM 27 foo.txt
10/08/2004 04:34 PM 144,524 source.jpg
10/07/2004 04:30 PM <DIR> test
4 File(s) 292,087 bytes
4 Dir(s) 72,644,620,288 bytes free
[/code]

jukas
10th of October 2004 (Sun), 21:21
Steven,

I don't think it's a problem with the path, I think it's some kind of php error at this point, though I can't track it down. I logged onto the server to do some testing, and found that the Imagemagick directory was recognized in the system path, so I can call the convert program from anywhere.

I also did a test to see if the ImageMagick would properly execute the command. Running the test through PHP comes up with the fork error, but doing it as follows via a command prompt spits out the resized .jpg


C:\wwwroot\fallenchaos.com\gallery\input\UPLOAD>convert -resize 110x73! CRW_2103.jpg +profile '*' -unsharp .8x.7+2+.01 ee_result_f20fc1528a.jpg

C:\wwwroot\fallenchaos.com\gallery\input\UPLOAD>dir
Volume in drive C has no label.
Volume Serial Number is 1049-F913

Directory of C:\wwwroot\fallenchaos.com\gallery\input\UPLOAD

10/10/2004 08:22 PM <DIR> .
10/10/2004 08:22 PM <DIR> ..
10/08/2004 04:34 PM 144,524 CRW_2103.jpg
10/10/2004 08:22 PM 3,012 ee_result_f20fc1528a.jpg
10/07/2004 04:30 PM <DIR> ee_temp_upload
03/29/2004 03:10 AM 27 foo.txt
10/08/2004 04:34 PM 144,524 source.jpg
10/07/2004 04:30 PM <DIR> test
4 File(s) 292,087 bytes
4 Dir(s) 72,644,620,288 bytes free

jukas
15th of October 2004 (Fri), 10:22
I finally found the answer to this issue. Apparently because ImageMagik is run from a command prompt, and the way windoze is trying to process it, the userid for the webserver needs access to cmd.exe :!: :!: :!:

What I ended up doing is copying the cmd.exe to the php directory, and only giving read and execute permissions to the process. Everything works fine now, but this may be something to add to the FAQ or Manual.