Page 1 of 1

convert function stopped working on new server

Posted: 2011-03-24T01:23:16-07:00
by finalwebsites
Hi,

I'm using the following function to convert my image to a smaller one:

Code: Select all

convert /home/user/domains/remote.com/public_html/img/www.image.jpg -resize 120x\> -size 120x90 xc:white +swap -gravity north -composite -quality 90 /home/user/domains/remote.com/public_html/img/www.image_thumb.jpg
This code works since more than year on my current my and not on the new one.

Both systems are ubuntu 10.04 and even the convert function is from the same version. On the new system I'm able to use the convert function for simple tasks.
Maybe there is an problem with the multi-line? A workaround would be to split the code into two functions but that is not really nice...

Thanks for helping.

Re: convert function stopped working on new server

Posted: 2011-03-24T09:47:52-07:00
by fmw42
I don't see anything wrong with your code if it is all in one command line. If you have a line continuation to break this into two lines, then you need \ at the end of the first line to indicate the command is continued to the next line. The only possible problem might be 120x\> Try 120x120\>

convert /home/user/domains/remote.com/public_html/img/www.image.jpg -resize 120x120\> -size 120x90 xc:white +swap \
-gravity north -composite -quality 90 /home/user/domains/remote.com/public_html/img/www.image_thumb.jpg

or

convert /home/user/domains/remote.com/public_html/img/www.image.jpg -resize "120x120>" \
\( -size 120x90 xc:white \)
+swap -gravity north -compose over -composite -quality 90 \ /home/user/domains/remote.com/public_html/img/www.image_thumb.jpg


Make sure your directories have the correct permissions and you don't have multiple versions of IM installed that might conflict and you have jpg in your delegates.

Re: convert function stopped working on new server

Posted: 2011-03-24T11:28:45-07:00
by finalwebsites
Thanks for your response!
I think the problem is somewhere else :) I run the IM function using exec in PHP and the problem only exists in the browser. Using CLI the script works. You're right I need to check the permissions

Olaf