you cannot embed "%[fx:w]" in functions as you have. you have to create a variable and use the variable in those functions.
for example to resize an image to half (dumb way)
halfwidth=`convert imagefile -format "%[fx:w/2]" info:`
halfheight=`convert imagefile -format "%[fx:h/2]" info:`
convert imagefile -resize ${halfwidth}x${halfheight} halfimagefile
Note:
exec("/Full/Path/to/script/texteffect.sh fred.png 2>&1", $array);
If you are using my texteffect script as above, the correct command is:
exec("/Full/Path/to/script/texteffect.sh fred.png", $array);
The 2>&1 is only used when you are doing
exec("/Full/Path/to/script/texteffect.sh -h 2>&1", $array);
to get the help information printed out. When you create an output, you don't want that 2>&1 as far as I understand it.