I am trying to process an externally hosted image using a php command.
Here is the code:
exec('convert -resize "568x150" http://www.temp.com/temp.jpg scripts/newtemp.jpg');
If I run this command in it’s own file called for example test.php in my wordpress directory then it works fine, resizes the image and saves it into the /scripts folder as newtemp.jpg
The problem occurs when I put this command into my single.php, then the codes doesn’t seem to work and the image is not saved.
Is there an obvious reason this wont work within the single.php?
Convert is ImageMagick, right? You could just use its native
php extensionand don’t have to hassle withexec-ing it yourself.