how to re size a image with php before showing it to the browser?
===

i have some images that have a certain size and i want to scale them down.

i don't want to save them to scaled, i want to re size them each time the image load in the browser

i've took a look as the `WideImage` library and `imagecopyresampled`

 if i use `WideImage::load($_GET['img'])->resize(500, 300)->output('jpg', 90);` and i echo this out i get the source code from the image and not the actual image. 

i also fount this method

    public function resizeImage($originalImage,$toWidth,$toHeight)
        {
        
        	list($width, $height) = getimagesize($originalImage);
        	$xscale=$width/$toWidth;
        	$yscale=$height/$toHeight;
        
        	if ($yscale>$xscale){
        		$new_width = round($width * (1/$yscale));
        		$new_height = round($height * (1/$yscale));
        	}
        	else {
        		$new_width = round($width * (1/$xscale));
        		$new_height = round($height * (1/$xscale));
        	}
        
        
        	$imageResized = imagecreatetruecolor($new_width, $new_height);
        	$imageTmp     = imagecreatefromjpeg ($originalImage);
        	imagecopyresampled($imageResized, $imageTmp, 0, 0, 0, 0, $new_width, $new_height, $width, $height);
        
        	return $imageResized;
        }

and if i pass a image to it and echo the result i get `resource(192) of type (gd)` and not the image.

also im not sure what image path to pass to this methods, the `http://.....jpg` or `/var/www/images/....jpg`


can anyone shade some light on this? it looks like i don't really understand how this process works

thanks