param=600y400
在不动原图的任何信息和位置的情况下对图片做处理。
源码如下:
伪静态规则:
RewriteRule ^(.*\.(png|jpg))/(.*)$ image.php?...url=$1¶m=$3 [L]
image.php放到根目录:
php
define('EMLOG_ROOT', dirname(__FILE__));
$imgurl = EMLOG_ROOT...., $cropped_image, 0, 0, 0, 0, $target_width, $target_height, $cropped_width, $cropped_height);
//保存图片到本地...$fileName);
//imagedestroy($target_image);
//直接在浏览器输出图片(两者选一)
header('Content-Type: image/jpeg');