outputing image part 2
| From: | Ross | Date: | Fri, 15 Jun 2007 20:25:21 +0000 |
| Subject: | outputing image part 2 | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-257121@lists.php.net to get a copy of this message | ||
I have manually put in the url my display_image.php page to debug as
sugested and all I get is the URL of the display_image.php page output on
the screen.
This is what I see
http://xxxxxxxxxxxxxxx.co.uk/common/display_image.php
this is the display_image.php file:
$img_url="http://www.xxxxxxxxxxxxx.co.uk/images/ENapt63377/4.jpg";
$image = imagecreatefromjpeg($img_url);
if ($image === false) { exit; }
// Get original width and height
echo $width = imagesx($image);
echo $height = imagesy($image);
// New width and height
$new_width = 200;
$new_height = 150;
// Resample
$image_resized = imagecreatetruecolor($new_width, $new_height);
imagecopyresampled($image_resized, $image, 0, 0, 0, 0, $new_width,
$new_height, $width, $height);
// Display resized image
header('Content-type: image/jpeg');
imagejpeg($image_resized);
exit();