linux command issue
-
- Posts: 180
- Joined: 2010-11-27T01:42:06-07:00
- Authentication code: 8675308
linux command issue
hi my friends
i keep going through commands that used to work in windows and dont in linux now,
i have solved most of them, cant make this one, this one adds a shadow to the text, works in windows great, its failing in linux, any ideas why?
all this is from php
$command ='convert -background none -fill "'.$thecolor.'" -font '.$font_selection.' -pointsize '.$thesize.' -gravity '.$thealign.' label:"'.$thetext.'" ( -clone 0 -background black -shadow '.$valsh.' ) -compose DstOver -composite -compose Over -rotate '.$theangle.' '.$target_image.'';
thank u very much
jav
i keep going through commands that used to work in windows and dont in linux now,
i have solved most of them, cant make this one, this one adds a shadow to the text, works in windows great, its failing in linux, any ideas why?
all this is from php
$command ='convert -background none -fill "'.$thecolor.'" -font '.$font_selection.' -pointsize '.$thesize.' -gravity '.$thealign.' label:"'.$thetext.'" ( -clone 0 -background black -shadow '.$valsh.' ) -compose DstOver -composite -compose Over -rotate '.$theangle.' '.$target_image.'';
thank u very much
jav
-
- Posts: 180
- Joined: 2010-11-27T01:42:06-07:00
- Authentication code: 8675308
Re: linux command issue
this is a clearer example of the command from php in linux
convert -background none -fill "#457654" -font type/arial.ttf -pointsize 20 -gravity West label:"hola" ( -clone 0 -background black -shadow "100x1+2+2)") -compose DstOver -composite -compose Over -rotate 0 e2.png
this works perfect in windows, but not in linux from php
any ideas?
thank u
jav
convert -background none -fill "#457654" -font type/arial.ttf -pointsize 20 -gravity West label:"hola" ( -clone 0 -background black -shadow "100x1+2+2)") -compose DstOver -composite -compose Over -rotate 0 e2.png
this works perfect in windows, but not in linux from php
any ideas?
thank u
jav
-
- Posts: 180
- Joined: 2010-11-27T01:42:06-07:00
- Authentication code: 8675308
Re: linux command issue
if i try it in the bash
[root@mediaserver site]# convert -background none -fill "#457654" -font type/arial/arial_normal.ttf -pointsize 20 -gravity West label:"hola" ( -clone 0 -background black -shadow "100x1+2+2") -compose DstOver -composite -compose Over -rotate 0 e2.png
-bash: syntax error near unexpected token `('
[root@mediaserver site]# convert -background none -fill "#457654" -font type/arial/arial_normal.ttf -pointsize 20 -gravity West label:"hola" ( -clone 0 -background black -shadow "100x1+2+2") -compose DstOver -composite -compose Over -rotate 0 e2.png
-bash: syntax error near unexpected token `('
- fmw42
- Posts: 25562
- Joined: 2007-07-02T17:14:51-07:00
- Authentication code: 1152
- Location: Sunnyvale, California, USA
Re: linux command issue
In unix, you need to use \ to escape the parens \( .... \)
Also there must a space after the ( and before the )
Also there must a space after the ( and before the )
-
- Posts: 180
- Joined: 2010-11-27T01:42:06-07:00
- Authentication code: 8675308
Re: linux command issue
if i take the parenthesis away like this
convert -background none -fill "#457654" -font type/arial/arial_normal.ttf -pointsize 20 -gravity West label:"hola" -clone 0 -background black -shadow "100x1+2+2" -compose DstOver -composite -compose Over -rotate 0 e2555.png
then it executes and works but the result of course is wrong as it applies the shadow to the entire word and not to the edge
so the parenthesis are the problem, how do we keep the parenthesis in linux without the bash complaining?
convert -background none -fill "#457654" -font type/arial/arial_normal.ttf -pointsize 20 -gravity West label:"hola" -clone 0 -background black -shadow "100x1+2+2" -compose DstOver -composite -compose Over -rotate 0 e2555.png
then it executes and works but the result of course is wrong as it applies the shadow to the entire word and not to the edge
so the parenthesis are the problem, how do we keep the parenthesis in linux without the bash complaining?
-
- Posts: 180
- Joined: 2010-11-27T01:42:06-07:00
- Authentication code: 8675308
Re: linux command issue
yes it works
putting the \ before the (
thank u! )
putting the \ before the (
thank u! )
-
- Posts: 180
- Joined: 2010-11-27T01:42:06-07:00
- Authentication code: 8675308
Re: linux command issue
having similar problem with this one, i put \ in front of the ( but still not working,
i suspect the % signs maybe? what do u think
$command = 'convert '.$source_image.' -fill green -colorize 15% -alpha opaque -sigmoidal-contrast 4x15% -blur 1,0.5 \( +clone -fill white -colorize 100 -background "#cccccc" -vignette 0x35-30-30 \) -compose multiply -composite -quality 70 '.$target_image ;
i suspect the % signs maybe? what do u think
$command = 'convert '.$source_image.' -fill green -colorize 15% -alpha opaque -sigmoidal-contrast 4x15% -blur 1,0.5 \( +clone -fill white -colorize 100 -background "#cccccc" -vignette 0x35-30-30 \) -compose multiply -composite -quality 70 '.$target_image ;
-
- Posts: 180
- Joined: 2010-11-27T01:42:06-07:00
- Authentication code: 8675308
Re: linux command issue
another one that fails and is very simple
$command = "convert ".$source_image." ".$clutimage." -clut ".$target_image ;
this works from the bash
but not from php
any ideas?
$command = "convert ".$source_image." ".$clutimage." -clut ".$target_image ;
this works from the bash
but not from php
any ideas?
-
- Posts: 180
- Joined: 2010-11-27T01:42:06-07:00
- Authentication code: 8675308
Re: linux command issue
ok in the first one i showed that doesnt work we have found out that it works if we remove
-alpha opaque
any ideas why?
it works from the bash with -alpha opaque
but from php we need to remove that to make it work, the -alpha opaque
any ideas?
-alpha opaque
any ideas why?
it works from the bash with -alpha opaque
but from php we need to remove that to make it work, the -alpha opaque
any ideas?
-
- Posts: 180
- Joined: 2010-11-27T01:42:06-07:00
- Authentication code: 8675308
Re: linux command issue
so in two of our commands
it seems that it doesnt like from php using
-alpha opaque
and also
-clut
any ideas?
it seems that it doesnt like from php using
-alpha opaque
and also
-clut
any ideas?
-
- Posts: 180
- Joined: 2010-11-27T01:42:06-07:00
- Authentication code: 8675308
Re: linux command issue
apart from
-alpha opaque
and
-clut
giving problems in linux
the other problem i have is this that im using to produce black and white image, in windows works great
-channel R -evaluate multiply .8 -channel G -evaluate multiply .1 -channel B -evaluate multiply .1 +channel -separate -compose add -flatten
but in linux it produces a red image very strange
-alpha opaque
and
-clut
giving problems in linux
the other problem i have is this that im using to produce black and white image, in windows works great
-channel R -evaluate multiply .8 -channel G -evaluate multiply .1 -channel B -evaluate multiply .1 +channel -separate -compose add -flatten
but in linux it produces a red image very strange
-
- Posts: 180
- Joined: 2010-11-27T01:42:06-07:00
- Authentication code: 8675308
Re: linux command issue
oki another problem
in another of the commands, it only works when we remove -auto-level
any ideas?
so all these commands worked in windows perfect, but in linux they only work if we remove
in one of them removing
-alpha opaque
in another removing
-auto-level
in another removing
-clut
why is this, is this because a library is missing, i dont think so because most of this execute in the bash, not in php, so is it a syntax problem but its so simple
what could it be?
in another of the commands, it only works when we remove -auto-level
any ideas?
so all these commands worked in windows perfect, but in linux they only work if we remove
in one of them removing
-alpha opaque
in another removing
-auto-level
in another removing
-clut
why is this, is this because a library is missing, i dont think so because most of this execute in the bash, not in php, so is it a syntax problem but its so simple
what could it be?
- anthony
- Posts: 8883
- Joined: 2004-05-31T19:27:03-07:00
- Authentication code: 8675308
- Location: Brisbane, Australia
Re: linux command issue
javismiles wrote:having similar problem with this one, i put \ in front of the ( but still not working,
i suspect the % signs maybe? what do u think
$command = 'convert '.$source_image.' -fill green -colorize 15% -alpha opaque -sigmoidal-contrast 4x15% -blur 1,0.5 \( +clone -fill white -colorize 100 -background "#cccccc" -vignette 0x35-30-30 \) -compose multiply -composite -quality 70 '.$target_image ;
NOTE -colorize only takes a percent value, so the '%' flag is not used.
However % has no special meaning to either PHP or linux. so you do not have to double or escape them.
It is # < > ( ) [ ] { } ; & * and all quotes that have a special meaning for shells.
Anthony Thyssen -- Webmaster for ImageMagick Example Pages
https://imagemagick.org/Usage/
https://imagemagick.org/Usage/
- anthony
- Posts: 8883
- Joined: 2004-05-31T19:27:03-07:00
- Authentication code: 8675308
- Location: Brisbane, Australia
Re: linux command issue
Actually you have removed all spaces between arguments in the command, so the shell sees...javismiles wrote:another one that fails and is very simple
$command = "convert ".$source_image." ".$clutimage." -clut ".$target_image ;
this works from the bash
but not from php
any ideas?
convert sourceclut-cluttarget
Assuming $source_image = "source" etc...
The shell would pass that to the convert and convert would see only one long argument that does not make sense!
I really suggest you try to get a log of your PHP error returns!!!
See some rough notes I made about this, for another project
http://www.ict.griffith.edu.au/~anthony ... /php.hints
Anthony Thyssen -- Webmaster for ImageMagick Example Pages
https://imagemagick.org/Usage/
https://imagemagick.org/Usage/
- anthony
- Posts: 8883
- Joined: 2004-05-31T19:27:03-07:00
- Authentication code: 8675308
- Location: Brisbane, Australia
Re: linux command issue
Sounds like your version of IM is older than the addition of these operators.javismiles wrote:in another of the commands, it only works when we remove -auto-level
any ideas?
What does convert -version say
Look at convert -list command
and convert -list alpha
etc...
To see what you can list using
convert -list list
Anthony Thyssen -- Webmaster for ImageMagick Example Pages
https://imagemagick.org/Usage/
https://imagemagick.org/Usage/