|
Posted by yawnmoth on 11/20/07 01:51
I'm trying to resize an image with the gd library and am having some
difficulty. Here's my code:
<?php
$img = 'http://upload.wikimedia.org/wikipedia/commons/e/e3/Kheops-
Pyramid.jpg';
list($width, $height) = getimagesize($img);
$img = imagecreatefromjpeg($img);
$temp = imagecreate(500, 500);
imagecopyresized($img, $temp, 0, 0, 0, 0, 500, 500, $width, $height);
header('Content-type: image/jpeg');
imagejpeg($temp);
?>
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?
[Back to original message]
|