Super simple php big image generation thumbnail implementation code. How can I generate a thumbnail in a large image in a simple php Tutorial? Php *** generate a thumbnail ** @ paramstring $ imagepath Image path * @ paramstring $ thumb generate a thumbnail name * @ paraminte super simple php Tutorial to generate a thumbnail implementation code
/**
* Generating thumbnails
*
* @ Param string $ imagepath Image path
* @ Param string $ thumb generate a thumbnail name
* @ Param integer $ width: generate the maximum width of the thumbnail.
* @ Param integer $ height: generate the maximum height of the thumbnail.
*
*/
Function resizeimage ($ imagepath, $ thumb, $ width = 200, $ height = 200)
{
List ($ imagewidth, $ imageheight) = getimagesize ($ imagepath );
$ Imagepath = imagecreatefromjpeg ($ imagepath );
If ($ width & ($ imagewidth <$ imageheight ))
{
$ Width = ($ height/$ imageheight) * $ imagewidth;
}
Else
{
$ Height = ($ width/$ imagewidth) * $ imageheight;
}
$ Image = imagecreatetruecolor ($ width, $ height );
Imagecopyresampled ($ image, $ imagepath, 0, 0, 0, 0, $ width, $ height, $ imagewidth, $ imageheight );
Imagepng ($ image, $ thumb );
Imagedestroy ($ image );
}
Resizeimage('test.jpg ', 'test_thumb.jpg ');
?>
How can I generate a thumbnail for a larger image? Php/*** generate a thumbnail ** @ param string $ imagepath Image path * @ param string $ thumb generate a thumbnail name * @ param inte...