首頁 >後端開發 >php教程 >php缩略图的有关问题

php缩略图的有关问题

WBOY
WBOY原創
2016-06-13 10:10:431324瀏覽

php缩略图的问题
以下是我的代码:

1.2.$ef='index\images\m_1307414811439.jpg';
3.$bs="php缩略图的有关问题";
4.$rr=getimagesize($ef);
5.$new=imagecreatetruecolor(300,300);
6.imagecopyresized($new,$bs,0,0,0,0,300,300,$rr[0],$rr[1]);
7.header("content-type:image/jpeg");
8.imagejpeg($new);
9.?>

出现的问题是6,7行报错,还有乱码

Warning: imagecopyresized(): supplied argument is not a valid Image resource in D:\PHP\r.php on line 6

Warning: Cannot modify header information - headers already sent by (output started at D:\PHP\r.php:6) in D:\PHP\r.php on line 7
????JFIF??>CREATOR: gd-jpeg v1.0 (using IJG JPEG v62), default quality ??C $.' ",#(7),01444'9=82<.342>

陳述:
本文內容由網友自願投稿,版權歸原作者所有。本站不承擔相應的法律責任。如發現涉嫌抄襲或侵權的內容,請聯絡admin@php.cn