convert function stopped working on new server

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
finalwebsites
Posts: 2
Joined: 2011-03-24T01:16:13-07:00
Authentication code: 8675308

convert function stopped working on new server

Post 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.
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: convert function stopped working on new server

Post 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.
finalwebsites
Posts: 2
Joined: 2011-03-24T01:16:13-07:00
Authentication code: 8675308

Re: convert function stopped working on new server

Post 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
Post Reply