PHP Save Image After imagecopyresampled

后端 未结 6 2282
执笔经年
执笔经年 2021-02-19 16:14
$image_p = imagecreatetruecolor($new_width, $new_height);
$image = imagecreatefromjpeg($filename);
imagecopyresampled($image_p, $image, 0, 0, 0, 0, $new_width, $new_heig         


        
6条回答
  •  既然无缘
    2021-02-19 16:32

    to save image as jpg see imagejpeg function

    http://nz.php.net/manual/en/function.imagejpeg.php

    to get image extension use

    $path_parts = pathinfo($filename);
    echo $path_parts['extension'];
    

提交回复
热议问题