PHP Save Image After imagecopyresampled

后端 未结 6 2255
执笔经年
执笔经年 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:51

    You can define any type image:

     // Save the image as 'simpletext.jpg'
     imagejpeg($im, 'path/to/your/image.jpg');
     // or another image
     imagepng($im, 'path/to/your/image.png');
    

    See examples here http://php.net/manual/en/function.imagecopyresampled.php

提交回复
热议问题