Reply to Re: resizing an image with the gd library

Your name:

Reply:


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]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация