Damir Buskulic on  wrote...
| Hi Anthony and Justin,
|
| Indeed, I tried to use a simple shell script and call it from php.
| Didn't work either.
| Herre is a snippet of the test code I'm using :
|
| //      $commtest = '~/util/bin/convert -size 195x152 xc: -fx \'cc=
| (i-30)*(80)-(j-50)*(-10);bb=(-9200)+(i-30)*(55)-(j-50)*(-90);(-bb-sqrt
| (bb*bb-(-12000)*cc))/2/(-3000)\' ~/im_virg/test_p.png';
|        $commtest = "deform.sh";
| //      $commtest = '~/util/bin/convert -size 195x152 xc: -fx \'i/w\'
| ~/im_virg/test_p.png';
|        exec($commtest,$output);
|
And it works fine from the command line?
I ask because the "var=" was a very recent addition to the -fx
expressions, that is only availabe in the latest IM's

It just makes the calculations that much easier.


The output image however (command line) is very interesting though ;-)

Hmm  simplifying the maths...
   convert -size 195x152 xc: \
         -fx 'cc=(i-30)*80+(j-50)*10; \
              bb=(i-30)*55+(j-50)*90-9200; \
              (bb+sqrt(bb*bb+12000*cc))/6000' \
         test_p.png

What are you using it for?  The formula looks like it is mento to be
centered on pixel 30,50  but the multipliers moves that point to another
location with weird quadratic effects.


Back to the problem at hand...

I would not use '~' in a system command.

Also I believe you should be using backquotes to execute it...
EG:   $var = `....`

In which case you don't need to escape the signgle quotes.

For system you can use one quote " and then you don't need to escape the
other quote ' inside.  (or swap them)  EG:
   "   '...'   "         OR      '   "...."  '

| Thanks anyway for your help.
|
your welcome.

let me know the results.

Especially as it looks like you are developing a gradient for a
positional distortion map.  I am very interested in what people come up
with for this.

  Anthony Thyssen ( System Programmer )    <[EMAIL PROTECTED]>
 -----------------------------------------------------------------------------
       As a computer, I find your faith in technology amusing.
 -----------------------------------------------------------------------------
     Anthony's Home is his Castle     http://www.cit.gu.edu.au/~anthony/
_______________________________________________
Magick-users mailing list
[email protected]
http://studio.imagemagick.org/mailman/listinfo/magick-users

Reply via email to