php上传base64图片并生成缩略图

2018-09-02
4592 read
$base64img1 = split(\';\', $this_img);
$base64img = split(\'/\',$base64img1[0]);
$imgname = date(\'ymdHis\') . time() . \'.\' . array_pop($base64img);
print_r($imgname);
$save_src = \'..\\\\update\\\\Blog\\\\\' . $imgname;
$width = 270;
$height = 167;
$image = ImageCreateFromJPEG($this_img);
$imagewidth = ImageSX($image);
$imageheight = ImageSY($image);
$newimg = ImageCreateTrueColor($width, $height);
ImageCopyResized($newimg, $image, 0, 0, 0, 0, $width, $height, $imagewidth, $imageheight);
ImageJpeg($newimg, $save_src);//savesrc为你的略缩图储存路径
return;
【2018-10-03】pycharm,webstorm,phpstorm 破解激活
Linux 下设置路由

Comments

暂无评论,还不快来坐沙发...

Leave a Reply