note 15255 rejected and deleted from function.imagecopyresampled by philip
| From: | philip@php.net | Date: | Mon, 03 Sep 2001 21:09:58 +0000 |
| Subject: | note 15255 rejected and deleted from function.imagecopyresampled by philip | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-17578@lists.php.net to get a copy of this message | ||
Hi, I'm struggling with trying to create a thumbnail from a large image. Everytime I try this
code, all I get is a black box in the size I specified. Any help would be appreciated.
<?
$src_img = imagecreatefromjpeg("test.jpg");
$dest_width = "640";
$dest_height = "480";
$quality = "100";
$dst_img = imagecreatetruecolor($dest_width,$dest_height);
imagecopyresized($dst_img, $src_img, 0, 0, 0, 0, $dest_width, $dest_height, $src_width,
$src_height);
imagejpeg($dst_img, "test3.jpg", $quality);
imagedestroy($src_img);
imagedestroy($dst_img);
header("Location: test3.jpg");
?>
I'm running Apache/1.3.20, PHP/4.0.6, gd 2.0.1 on windows 98.