Re: imagecopyresized
| From: | Morgan Hughes | Date: | Thu, 01 Jan 1970 00:00:00 +0000 |
| Subject: | Re: imagecopyresized | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-125974@lists.php.net to get a copy of this message | ||
On Mon, 25 Nov 2002, adrian murphy@2020tourism.com wrote:
> hi
> i'm having problems resizing jpegs.
> here's an e.g. using manual example.
> code used :
> <?
> $new_w=395;
> $new_h=297;
> header("Content-type: image/jpeg");
> $dst_img=ImageCreate($new_w,$new_h);
> $src_img=ImageCreateFromJpeg($name);
> ImageCopyResized($dst_img,$src_img,0,0,0,0,$new_w,$new_h,ImageSX($src_img),ImageSY($src_img));
> ImageJpeg($dst_img);
> ?>
>
> and the result can be seen here.
> http://www.sitestogo.biz/temp/test.php
> i'm wondering if it's to do with the gd library installed.
Try it with ImageCreateTruecolor(), since ImageCreate() produces 8-bit
indexed-color images... If that function doesn't exist, you're using a
pre-2.x GD, and those can't do 24-bit images at all...
Good luck!
--
Morgan Hughes
C programmer and highly caffeinated mammal.
kyhm@kyhm.com
ICQ: 79293356