|
Posted by ljb on 11/20/07 02:06
terra1024@yahoo.com wrote:
> 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?
Check usage on imagecopyresized. I think you switched source and
destination, i.e. you copied your fresh blank image over onto the pyramid
image.
[Back to original message]
|