<?php
ini_set('display_errors','On');

//$filename = '..\\images\\image.jpg';
$infile = '/data/websites/phpws/images/image.jpg';
$outfile = '/tmp/image_out_'.rand().'.jpg';     

if (file_exists($infile)){
        
        //use im convert
        $cmd = "convert -size 150x150 -thumbnail 150x150 '$infile' '$outfile'";
        //error_log($cmd);
        $starttime = microtime(true);
        $res = exec($cmd);
        $endtime = microtime(true);
        $etime = $endtime - $starttime;
        error_log("FileThumb in $etime seconds.");
        
        header('Content-Type: image/jpeg');
        readfile($outfile);

        
} else {

        header("Content-type: image/png");
        $im = imagecreate(100, 125);
        $background_color = imagecolorallocate($im, 255, 255, 255); //white
        $text_color = imagecolorallocate($im, 0, 0, 0); //black
        imagestringup($im, 2, 40, 120,  "Image Not Found", $text_color);
        imagepng($im);
        imagedestroy($im);                      
        
}
ini_set('display_errors','Off');

?>


--
Robert Garcia
President - BigHead Technology
VP Application Development - eventpix.com
13653 West Park Dr
Magalia, Ca 95954
ph: 530.645.4040 x222 fax: 530.645.4040
[EMAIL PROTECTED] - [EMAIL PROTECTED]
http://bighead.net/ - http://eventpix.com/

On Apr 28, 2006, at 8:54 AM, William M Conlon wrote:

Are using system() or popen()?
On Apr 28, 2006, at 8:34 AM, Robert Garcia wrote:

PHP doesn't seem to suffer from calling a external command. When I get the javabridge on that server I will see if php/bean is any better. But this shows how fast these methods can be, even in witango when using bean.


Bill

William M. Conlon, P.E., Ph.D.
To the Point
345 California Avenue Suite 2
Palo Alto, CA 94306
   vox:  650.327.2175 (direct)
   fax:  650.329.8335
mobile:  650.906.9929
e-mail:  mailto:[EMAIL PROTECTED]
   web:  http://www.tothept.com

______________________________________________________________________ __
TO UNSUBSCRIBE: Go to http://www.witango.com/developer/maillist.taf


________________________________________________________________________
TO UNSUBSCRIBE: Go to http://www.witango.com/developer/maillist.taf

Reply via email to