猿问

想联系一下php缩略图,代码及错因如下,求大神指点

<?php

$image=imagecreatefromjpeg("E:tp/city.jpg");

$height=imagesy($image);

$width=imagesx($image);

$after_height=$height*0.5;

$after_width=$width*0.5;

$after=imagecreatetruecolor($after_width, $after_height);

imagecopyresampled($after, $image, 0,0,0,0, $after_width, $after_height, $width, $height);

imagejpeg($after,"E:tp/after.jpg",100);

imagedestroy($after);

?>

<b>使用php创建缩略图</b>

<table>

<tr>

<td>原图:</td>

<td>缩图:</td>

</tr>

<tr>

<td><img src="E:tp/city.jpg"/ ></td>

<td><img src="E:tp/after.jpg"/></td>

</tr>

</table>

错因:

[Web浏览器] "Not allowed to load local resource: file:///E:/tp/city.jpg" /phptext1/gd.php (8)

[Web浏览器] "Not allowed to load local resource: file:///E:/tp/after.jpg" /phptext1/gd.php (9)


慕盖茨2165817
浏览 1239回答 1
1回答
随时随地看视频慕课网APP
我要回答