php生成缩略图代码

作者:袖梨 2022-07-02

ob_start();
$start = microtime(true);
$src = imagecreatefromjpeg($_GET["imageurl"]);
$width = imagesx($src);
$height = imagesy($src);
$dst = imagecreatetruecolor(160, 120);
imagecopyresampled($dst,$src,0,0,0,0,160,120,$width,$height);
header('Content-Type: image/jpeg');
imagejpeg($dst,'',100);
ob_end_clean();
echo microtime(true) - $start;

相关文章

精彩推荐