Re: Server Process

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, August 13, 2007 4:37 am, Nathan Wallis wrote:
> Just a follow up to my post about running an application server side
> and the
> introduction of sockets.
>
> My application is really just to modify a series of images on the
> server and
> combine them into a collage of images as a single file name.  So I
> just say
> go and wait for it to build the final file, then it is done.
>
> So in this case are sockets an advantage?  I really just want to start
> the
> application and let it go, without transferring data back and forth
> between
> PHP and the app.
>
> Any more help would be great.

Who is doing the waiting, and when, and just how long will they need
to wait?...

I suspect you are over-engineering this, and could just write a single
script to do the collaging and not even have it ever be in a file.

<img src="collage.php" />

<?php
  //collage.php
  //something not unlike this:
  $files = array('1.jpg', '2.jpg', '3.jpg', '4.jpg', '5.jpg', '6.jpg');
  $image = imagecreatetruecolor(600, 400);
  reset($files);
  for ($column = 0; $column < 3; $column++){
    for ($row = 0; $row < 2; $row++){
      $img = imagecreatefromjpg('/full/path/to/images/' . next($files));
      imagecopyresampled($image, $img, $column * 200, $row * 200, 0,
0, 200, 200, imagesx($img), imagesy($img));
    }
  }
  header("Content-type: image/jpeg");
  imagejpeg($image);
?>

We can't really tell you if you should use a daemon, a cache, or
whatever, unless you tell us more about the Big Picture of your
application.

-- 
Some people have a "gift" link here.
Know what I want?
I want you to buy a CD from some indie artist.
http://cdbaby.com/browse/from/lynch
Yeah, I get a buck. So?

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux