开发者

GD-PHP: trying to resize an image

I'm trying to generate a resized image, this is my code:

$image = imagecreatefromjpeg($file);
$tnImage = imagecreatetruecolor(100, 100);开发者_如何学C
imagecopyresampled($tnImage, $image, 0, 0, 0, 0, 100, 100, null, null);

imagejpeg($tnImage, 'thumb', 100) ;

I'm getting the image but it's just black.


http://www.php.net/manual/en/function.imagecopyresampled.php

You need to specify the width and height of the part of the original image you want to copy.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜