Do you have a question? Post it now! No Registration Necessary. Now with pictures!
- Posted on
- resizing an image with the gd library
November 20, 2007, 1:51 am
rate this thread
difficulty. Here's my code:
$img = 'http://upload.wikimedia.org/wikipedia/commons/e/e3/Kheops-
list($width, $height) = getimagesize($img);
$img = imagecreatefromjpeg($img);
$temp = imagecreate(500, 500);
imagecopyresized($img, $temp, 0, 0, 0, 0, 500, 500, $width, $height);
All I get is a 500x500 black picture. What I don't get is a resized
wikimedia.org picture. Any ideas as to what I'm doing wrong?