Creating Image v2... storing thumblains...
| From: | mp | Date: | Thu, 01 Aug 2002 06:09:40 +0000 |
| Subject: | Creating Image v2... storing thumblains... | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-110631@lists.php.net to get a copy of this message | ||
Thanks to those who helped me last time about creating image, but now there
is another problem...
I'm making a thumblain like this:
$base_size = 300;
$size = GetImageSize($image1);
$kof = ($size[0] > $size[1]) ? $size[0] : $size[1];
$koef = ($base_size / $kof);
$new_w = (int) $size[0] * $koef;
$new_h = (int) $size[1] * $koef;
$dst_img = ImageCreate($new_w, $new_h);
$src_img = ImageCreateFromJpeg($image1);
ImageCopyResized($dst_img, $src_img, 0, 0, 0, 0, $new_w, $new_h,
ImageSX($src_img), ImageSY($src_img));
imageJPEG($dst_img, $image2);
Andf I get $image2 with 0 bytes...
If i write
imageJPEG($src_img, $image2);
I get good image, so there is some problems with ImageCopyResized...
Does anybody have any ideas about this?