如题,最好能顺带显示缩略文字
解决方案 »
- 谁有php_memcache.dll 的相关资源
- 关于phpexcelreader日期导入的问题
- PHPCMS网站HTML首页被挂码,请求高人帮助。
- 新手提问,关于limesurvey 的邮件设定
- 用php插入数据只可以插入数字和字母插入不了文字
- 关于字符串初始化的问题
- 求一简单的正则表达式
- php怎么直接读取word文档
- 关于Iframe实现局部刷新问题:当提交注册表单后,我想把注册成功的信息显示在页面中,现在结果时不能显示在本页面,而是显示在了那个iframe中了,怎么办
- 开源 vtiger CRM与微信集成登陆开发
- 有关Can't connect to local MySQL server through socket '/tmp/mysql.sock' (13)
- 这个功能如何实现?PHP/Javascript
if ( is_numeric( $src_file ) ) // Handle int as attachment ID
$src_file = get_attached_file( $src_file ); $src = wp_load_image( $src_file ); if ( !is_resource( $src ))
return $src; $dst = imagecreatetruecolor( $dst_w, $dst_h ); if ( $src_abs ) {
$src_w -= $src_x;
$src_h -= $src_y;
} if (function_exists('imageantialias'))
imageantialias( $dst, true ); imagecopyresampled( $dst, $src, 0, 0, $src_x, $src_y, $dst_w, $dst_h, $src_w, $src_h ); imagedestroy( $src ); // Free up memory if ( ! $dst_file )
$dst_file = str_replace( basename( $src_file ), 'cropped-' . basename( $src_file ), $src_file ); $dst_file = preg_replace( '/\\.[^\\.]+$/', '.jpg', $dst_file ); if ( imagejpeg( $dst, $dst_file ) )
return $dst_file;
else
return false;
}