求读取图片 求读取图片缩略成指定的宽如 a.php 1.jpg 这个图片数300px 300px的高宽通过a.php读图片后宽50px;但没有改变1.jpg的高宽300px 300px只是显示出宽50px而已;并没有生成到服务器就是只读显示不生成。 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 <img src="a.php?img=1.jpg" />a.php(以下代码来自PHP手册拼接)=====<?php// File and new size$filename = empty($_GET['img'])?"default.jpg":trim($_GET['img']);// Content typeheader('Content-type: image/jpeg');// Get new sizeslist($width, $height) = getimagesize($filename);$newwidth = 300;$newheight = 300;// Load$thumb = imagecreatetruecolor($newwidth, $newheight);$source = imagecreatefromjpeg($filename);// Resizeimagecopyresized($thumb, $source, 0, 0, 0, 0, $newwidth, $newheight, $width, $height);// Outputimagejpeg($thumb);?> 请问怎么让这个代码传递2个参数给php后台程序?谢谢。 php 采集程序问题 php中,用正则表达式将txt文本文件中的空白行过滤掉 关于建立可排序的数据表格 哪全知道asp.net的,帮忙把php转换一下,只是一个很简单的function...诚求 copy问题,请进 超级新手求PHP最简单问题 谁帮我看看这个mysql的查询怎么做,还有一个页面翻转分页效果。 在线等,一个简单的数学问题 小弟我遇到 PHP + MYSQL 问题,想请高手大哥为我指导.................急急急 php flash 通信 初学php 遇到问题。先感谢大家不厌其烦给予指点。谢谢
=====
<?php
// File and new size
$filename = empty($_GET['img'])?"default.jpg":trim($_GET['img']);// Content type
header('Content-type: image/jpeg');// Get new sizes
list($width, $height) = getimagesize($filename);
$newwidth = 300;
$newheight = 300;// Load
$thumb = imagecreatetruecolor($newwidth, $newheight);
$source = imagecreatefromjpeg($filename);// Resize
imagecopyresized($thumb, $source, 0, 0, 0, 0, $newwidth, $newheight, $width, $height);// Output
imagejpeg($thumb);
?>