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.
精彩评论