大家好,我这里搜资料的时候真的没找到,所以不要判断题。添加截图的时候飞出如下错误注意:Help中只有变量应该通过引用传递更正或者告诉我应该如何正确
这是实际的代码
这是这一行:$type = array_pop(explode('.',$src_s));
list($owidth,$oheight) = getimagesize($src_s);
if($type=='png') {
$im = imagecreatetruecolor($owidth, $oheight);
$img_src = imagecreatefrompng($src_s);
imagecopyresampled($im, $img_src, 0, 0, 0, 0, $owidth, $oheight, $owidth, $oheight);
}
if($type=='gif') {
$im = imagecreatetruecolor($owidth, $oheight);
$img_src = imagecreatefromgif($src_s);
imagecopyresampled($im, $img_src, 0, 0, 0, 0, $owidth, $oheight, $owidth, $oheight);}
if($type=='jpeg') {$im = imagecreatefromjpeg($src_s);}
if($type=='jpg') {$im = imagecreatefromjpeg($src_s);}
if($type=='PNG') {
$im = imagecreatetruecolor($owidth, $oheight);
$img_src = imagecreatefrompng($src_s);
imagecopyresampled($im, $img_src, 0, 0, 0, 0, $owidth, $oheight, $owidth, $oheight);
}
if($type=='GIF') {
$im = imagecreatetruecolor($owidth, $oheight);
$img_src = imagecreatefromgif($src_s);
imagecopyresampled($im, $img_src, 0, 0, 0, 0, $owidth, $oheight, $owidth, $oheight);}
if($type=='JPEG') {$im = imagecreatefromjpeg($src_s);}
if($type=='JPG') {$im = imagecreatefromjpeg($src_s);}
$watermark = imagecreatefrompng($image_path);
list($w_width, $w_height) = getimagesize($image_path);
$pos_x = $owidth - $w_width-5;
$pos_y = $oheight - $w_height-5;
imagecopy($im, $watermark, $pos_x, $pos_y, 0, 0, $w_width, $w_height);
if($type=='png') {unlink($src_s); imagepng($im, $src_s, 9);}
//if($type=='gif') {unlink($src_s); imagegif($im, $src_s, 60);}
if($type=='jpeg') {unlink($src_s); imagejpeg($im, $src_s, 60);}
if($type=='jpg') {unlink($src_s); imagejpeg($im, $src_s, 60);}
if($type=='PNG') {unlink($src_s); imagepng($im, $src_s, 9);}
//if($type=='GIF') {unlink($src_s); imagegif($im, $src_s, 60);}
if($type=='JPEG') {unlink($src_s); imagejpeg($im, $src_s, 60);}
if($type=='JPG') {unlink($src_s); imagejpeg($im, $src_s, 60);}
imagedestroy($im);
mysqli_query($connect_db, "INSERT INTO `".DB_PREFIX."_es_i` (m,img) VALUES ('$id','$srcs')");
mysqli_query($connect_db, "UPDATE ".DB_PREFIX."_users SET rat=rat+0.02 WHERE uid='$u_id' LIMIT 1");
exit('1');
} else {
exit('3');
}```