Chung Leong wrote:
[color=blue]
>"Chuck Anderson" <websiteaddress@seemy.sig> wrote in message
>news:jLOdnc7uXt4DpPHfRVn-oQ@comcast.com...
>
>[color=green]
>>I am trying to use ImageMagick from a Php script running under Windows XP.
>>
>>I have installed the latest version of ImageMagick - 6.2.1-7 and even
>>tried backing up to version 5.5.7 (based on a recommendation I found
>>during a Google search), but I can not get ImageMagick to work in Php
>>(using exec or system).
>>
>>ImageMagick works from a Windows Command prompt -
>>
>>e.g., convert C:\apache\htdocs\testing\temp_.jpg
>>C:\apache\htdocs\testing\temp_.png
>>
>>but that same command using the system function -
>>
>>i.e., system("convert C:\apache\htdocs\testing\temp_.jpg
>>C:\apache\htdocs\testing\temp_.png", $retval);
>>
>>[/color]
>
>You know you need to escape backslashes in strings, right?
>
>[/color]
Thanks for the replies. I must admit that I was being a little ignorant
on that count ... but, I had already tried reversing the slashes:
system("convert.exe C:/apache/htdocs/testing/temp_.jpg
C:/apache/htdocs/testing/temp_.png", $retval);
and after these two replies, I tried escaping the backslashes:
system("convert.exe C:\\apache\\htdocs\\testing\\temp_.jpg
C:\\apache\\htdocs\\testing\\temp_.png", $retval);
But both methods still gave me a retval of 1.
However, I then tried using a relative path - or no path (leave off the c:):
system("convert.exe temp_.jpg temp_.png", $retval);
or (placing the images in a sub folder)
system("convert.exe photos/temp_.jpg photos/temp_.png", $retval);
and then it it works.
It seems that I can not use an absolute path
(c:\apache\htdocs\testing\temp_.png). I'm not sure why the c: part is a
problem, but using relative paths is all I really need to do. I was only
using full paths to be sure I was pointing to the right location of the
files while testing.
Thanks for the help.
--
*****************************
Chuck Anderson • Boulder, CO
http://www.CycleTourist.com
Integrity is obvious.
The lack of it is common.
*****************************