Page 1 of 2

texteffect.sh not working in my server

Posted: 2012-04-03T21:44:38-07:00
by chanchelkumar
Hi all,

Am running a site with texteffect.sh successfully for last two years.But something went wrong when server people upgraded their server on last feb , my images are not creating.. i asked then to install imagemagick and magicwand.. but still now the images not creating...

They moved me to another server, and now the image is working but the texteffect ie squeezed,arched etc are not working.. in that server imagemagick not installed they only installed magicwand..

Please help me to find a suitable solution?

What should i do next.. i will post the server details if required...


Thanks in advance...

Re: texteffect.sh not working in my server

Posted: 2012-04-03T21:57:46-07:00
by fmw42
It seems to be working fine for me on IM 6.7.6.3 Q16 Mac OSX Snow Leopard.


What version of IM are you using and on what platform (windows or unix)?

It does not make any sense for it to work on a server where there is no Imagemagick (only magicwand). The script does not use any API, only the command line?

Can you run the program from a shell terminal and if so does it work correctly. Are you running it from PHP exec?

What is your exact command?

Have you tried any of the examples from my web site for texteffect? See the link below. Do they work correctly?

Are you getting any error messages?

More information is needed to find out why it does not work!

Re: texteffect.sh not working in my server

Posted: 2012-04-03T22:21:21-07:00
by chanchelkumar
Thanks fmw42...

this is my old server details..
http://www.ijerseys.com/info.php
am using ImageMagick 6.3.2 06/04/09 Q16 linux


this is my new server testing page..
http://ijerseys.com.temppublish.com/ck_ ... e/test.php

My new server details..
http://ijerseys.com.temppublish.com/info.php
my code

Code: Select all

exec("texteffect_2.sh -t \"$value\" -s outline -e arch-bottom -d 1.0 -f \"$font\" -p 48 -c skyblue -b white -o black -l 1 -u lightpink image.png");
http://ijerseys.com.temppublish.com/ck_ ... e/test.php

I tried the same code from your site.. two years back.. and it was working perfectly till this feb2012..

Thanks for the help..

Re: texteffect.sh not working in my server

Posted: 2012-04-04T11:04:19-07:00
by fmw42
Did you note the requirements regarding IM versions in the script?

# NOTE: Some effects require the use of -fx and thus will be slower than the others.
# These include: the variations on bulge, concave, convex and pinch for IM versions
# prior to 6.4.3-7. The arc effect requires IM 6.3.5-5. The innerbevel and
# roundbevel require IM 6.5.9-1.



When using your link to your online demo, I get an error message that implies you have PHP code errors.

Varsity.ttf Notice: Undefined variable: col_fun in /vservers/ijersey1/htdocs/ck_testimage/circulararc.php on line 5

I don't know enough about your PHP info to tell you anything, but I don't see Imagemagick installed (or missed it).

Run this to find out where IM is installed:

<?php
echo "<pre>";
system("type -a convert");
echo "</pre>";
?>

Then run this to get its version.

<?php
echo "<pre>";
system("convert -version");
echo "</pre>";
?>

If the above fails, put in the full path to convert as found in the type -a convert result.

exec("texteffect_2.sh -t \"$value\" -s outline -e arch-bottom -d 1.0 -f \"$font\" -p 48 -c skyblue -b white -o black -l 1 -u lightpink image.png");
This does not help me as I need your exact values used, so that I can repeat your test.

You may need to add the full path to where you put texteffect_2.sh.

By the way, why have you appended _2 to the script name. If you modified my script, then all bets are off. Try using the original script. Get the latest download.

My tests of arch-bottom, seem to work fine.

So I assume it is either your Imagemagick install or your PHP linking to IM or your PHP script, or your modification of my script.

Re: texteffect.sh not working in my server

Posted: 2012-04-04T20:29:18-07:00
by chanchelkumar
Thanks for your support...

This is my full page.

Code: Select all

<?php

echo "<pre>";
system("type -a convert"); 
system("convert -version"); 
echo "</pre>";

$value=$_POST['text'];
 $font="Varsity.ttf";

$fontsize = 48;

exec("texteffect.sh -t \"$value\" -s outline -e arch-bottom -d 1.0 -f \"$font\" -p 48 -c skyblue -b white -o black -l 1 -u lightpink image.png"); 
?>
<img src="image.png" width="100%" height="100%" >
<?php // }?>

I made texteffect.sh to texteffect_2.sh just to keep the original file as the backup..

Can u please check this and tell em where i went wrong?

Re: texteffect.sh not working in my server

Posted: 2012-04-04T21:43:45-07:00
by fmw42
Please run these scripts and telll me what you get.

Run this to find out where IM is installed:

<?php
echo "<pre>";
system("type -a convert");
echo "</pre>";
?>

Then run this to get its version.

<?php
echo "<pre>";
system("convert -version");
echo "</pre>";
?>

Then give me an exact set of values you have tried with your script for value and font. And post a link to your resulting image.

Until I can rule out IM, I am assuming it your system environment or your script.


I am not a PHP expert, but again when I ran your demo, it produces a PHP error. So I think it might be your PHP code.

Have you tried hardcoding in the font, with the full path to the font?

Have you tried hardcoding as well the text?

Make your script as simple as possible with just the exec statement and fixed arguments. Remove all other code not needed to display your image. See what happens. For example something like,

Code: Select all

<?php
exec("texteffect.sh -t "THIS IS A TEST" -s outline -e arch-bottom -d 1.0 -f Varsity.ttf -p 48 -c skyblue -b white -o black -l 1 -u lightpink image.png"); 
?>
<img src="image.png" width="100%" height="100%" >
<?php // }?>
But I am not enough an expert on this to say if it is correct with regard to how you are displaying your image.

Perhaps user Bonzo can review your script.

Re: texteffect.sh not working in my server

Posted: 2012-04-04T21:57:56-07:00
by chanchelkumar
hi.. this what i get when i run

<?php
echo "<pre>";
system("type -a convert");
echo "</pre>";
?>
and
<?php
echo "<pre>";
system("convert -version");
echo "</pre>";
?>

convert is /usr/bin/convert
Version: ImageMagick 6.2.8 12/13/11 Q16 file:/usr/share/ImageMagick-6.2.8/doc/index.html
Copyright: Copyright (C) 1999-2006 ImageMagick Studio LLC

Please check here is the link...

http://ijerseys.com.temppublish.com/ck_ ... e/test.php

hope i corrected the error?

$value is the text value and $font is the font which is in the same folder..

Re: texteffect.sh not working in my server

Posted: 2012-04-04T22:09:23-07:00
by fmw42
IM 6.2.8 may be too old for -wave, which is used by my arch parameter. But I thought you said you had upgraded your system and that was when it failed.

Note that my script is limited for many functions, perhaps I missed the IM version limitation for -wave. Did you see the Requirements:

# NOTE: Some effects require the use of -fx and thus will be slower than the others.
# These include: the variations on bulge, concave, convex and pinch for IM versions
# prior to 6.4.3-7. The arc effect requires IM 6.3.5-5. The innerbevel and
# roundbevel require IM 6.5.9-1.


Try one of these examples in your PHP code. see http://www.imagemagick.org/Usage/warping/#wave

Or choose some other texteffect effect that is simpler for your version of IM.

You might also change your exec() function to print out any text output including errors.

An example is

<?php
exec("-t "THIS IS A TEST" -s outline -e arch-bottom -d 1.0 -f Varsity.ttf -p 48 -c skyblue -b white -o black -l 1 -u lightpink image.png 2>&1",$out,$returnval);
foreach($out as $text)
{echo "$text<br>";}
?>

Re: texteffect.sh not working in my server

Posted: 2012-04-04T22:18:54-07:00
by chanchelkumar
yes your code was working fine ..
but on feb 2012 some server changes done by hosting people.. after that moment this function is not working..

can u check my current info here..
http://ijerseys.com.temppublish.com/info.php

and tell me if i need any upgrades from server side?
Sever people said that this is latest version IM they can install.. Ie. they can install only stable version..

What i do to get my text bridged arch, vertical arch , circular arch,
Image
Image
Image
Image

Re: texteffect.sh not working in my server

Posted: 2012-04-04T22:27:22-07:00
by fmw42
chanchelkumar wrote:yes your code was working fine ..
but on feb 2012 some server changes done by hosting people.. after that moment this function is not working..

can u check my current info here..
http://ijerseys.com.temppublish.com/info.php

and tell me if i need any upgrades from server side?
Sever people said that this is latest version IM they can install.. Ie. they can install only stable version..

What i do to get my text bridged arch, vertical arch , circular arch,
Image
Image
Image
Image

How did you create these images? They seem to be correct?

I am not a PHP expert and so cannot say whether your PHP environment is correct.

Surely, there are other stable versions of IM that are more current. Note that IM 6.2.8 is 480 versions old. Your ISP is just lazy. They could install from source if they wanted to.

Please do the suggestions in the previous post of mine to see if there are any errors coming from IM.

Re: texteffect.sh not working in my server

Posted: 2012-04-04T22:32:34-07:00
by fmw42
Your PHP info says you have ImageMagick 6.6.5-10 2010-11-26 Q16 http://www.imagemagick.org at least for Magickwand.
So I would be concerned that there are multiple versions of IM installed on your server and they are competing with each other.

Did you run

<?php
echo "<pre>";
system("type -a convert");
echo "</pre>";
?>

by itself and if so what version or versions did you get.

I would question that the IM version that you are using is really 6.2.8 and that is too old. And that you are not using the version of IM above, e.g. 6.6.5-10, which should be more than adequately current.

Ask you ISP why the PHP says you have version 6.6.5-10, but your code says you have 6.2.8. Ask them how you can use 6.6.5-10 with your PHP code.

Re: texteffect.sh not working in my server

Posted: 2012-04-04T22:43:52-07:00
by chanchelkumar
Thanks fmw42!!

That images are we created use photoshop... but by using your code i created these type images... now i can't..

this is what i get when i run

<?php
echo "<pre>";
system("type -a convert");
echo "</pre>";
?>
convert is /usr/bin/convert
and version am getting..
Version: ImageMagick 6.2.8 12/13/11 Q16 file:/usr/share/ImageMagick-6.2.8/doc/index.html
Copyright: Copyright (C) 1999-2006 ImageMagick Studio LLC
Is this an old version for run our code?
Shall i ask my ISP to upgrade to newer version?
can u suggest which latest version is compact able for this script!!!!

Re: texteffect.sh not working in my server

Posted: 2012-04-04T22:53:20-07:00
by fmw42
Read my last post above. You seem to have a newer version connected to your PHP. Ask you ISP why that is newer than you are using and how you can run that version rather than the 6.2.8 version you are running.

I think when they changed things, they might have changed the version you were using from a newer one to the 6.2.8 version and that what was working before was the newer version.

Again, the only thing that I can check is for you to run your script with the errors printed out as I mentioned above. Then if there is some error, we can see if it is the script or the version of IM.

Other than these things, I am confident it is not the texteffect script, but your IM version that they have you using or some other environment problem.

Can they put you on another server with a more current version of IM?

Sorry, I am offline now until tomorrow. But I am not sure I can help much further. I think it is your server environment or the version of IM that they have you using is too old.

Again, do any other effects work besides arch. Can you test that? Also test the -wave examples that I referenced earlier to see if they even work on your IM 6.2.8. You have not done all the tests that I suggested to see if it is my script, IM or your server environment. I am trying to eliminate the first two, if possible by these tests.

Re: texteffect.sh not working in my server

Posted: 2012-04-04T23:06:26-07:00
by chanchelkumar
Thanks fmw42

The wave examples are working perfectly....

I will ask my server people to correct it...

can u suggest any ISP that will provide a very good support in IM...

Thanks once again for your help..

See u later..

Re: texteffect.sh not working in my server

Posted: 2012-04-05T10:44:56-07:00
by fmw42
The wave examples are working perfectly....
Can you show me the code you used for the wave example?

Something is very strange here if your wave example works and the script does not.

Perhaps the script is not seeing the IM convert commands. Did you follow the instructions on my home page about how to use/modify the script for use with PHP. (Also described at viewtopic.php?f=4&t=9631#p53156)

Please follow these directions and let me know what happens.

1 ) Download the script
2 ) Change the name to add or remove the .sh as desired when running
3 ) Set the script to executable (chmod u+x)
4 ) Edit the script to add the full path to convert, identify and any other IM command
5 ) Edit the script to change the default directory (found after the defaults section) from dir="." to dir="/tmp"
6 ) In the exec command use bash /fullpathto/scriptname(.sh) arguments /fullpathto/inputimage /fullpathto/outputimage.
Note that "bash" may or may not be necessary

An easy way to do step 4 ) (especially for texteffect as it calls lots of convert and other IM commands) is to add the following below the default parameters and tmp directory (but above the first IM command) and change imdir as needed for your location of IM commands:

# set directory for location of IM commands -- no trailing /
imdir="" # suggestions imdir="/usr/local/bin" or imdir="/usr/bin"

# set up aliases to IM functions
if [ "$imdir" != "" ]; then
alias animate="$imdir/animate"
alias compare="$imdir/compare"
alias composite="$imdir/composite"
alias conjure="$imdir/conjure"
alias convert="$imdir/convert"
alias display="$imdir/display"
alias identify="$imdir/identify"
alias import="$imdir/import"
alias mogrify="$imdir/mogrify"
alias montage="$imdir/montage"
alias stream="$imdir/stream"
fi