从后端抓取图片(到内存),按给定长宽条件输出图片即可,过程不期望读写文件,求example。
*.不用担心内存瓶颈,内存充裕且在PHP前面的前端有缓存机制。
*.不用担心内存瓶颈,内存充裕且在PHP前面的前端有缓存机制。
|
1
以前用开源的一个库:PHPThumb
|
|
kingwkbSep 15, 2012
2
php本身是没有缓存机制的,用文件或者memcache,自己写吧,求不来
|
|
holystrikeSep 15, 2012
3
有个叫x-gen什么的,github上搜一下
|
|
yibin001Sep 15, 2012
4
Imagick,可以不生成文件,直接输出到浏览器的。
|
|
5
@kingwkb 你没看懂我的的内容,我说的是在PHP前面的前端,有缓存机制。具体方案属于机密。我是来求缩略图方案的,不是求cache方案。
另外MEMCACHE是跨进程、跨协议的,不适用于高并发。 |
|
6
gd库的...扔块砖头下面的你自己想
<?php $source = imagecreatefromstring($image); $thumb =imagecreatetruecolor(800 ,600); list($width, $height) = getimagesizefromstring($image); imagecopyresized($thumb, $source, 0, 0, 0, 0, 800, 600, $width, $height); ob_clean(); imagepng($thumb); $thumb_data = ob_get_contents(); ob_clean(); imagedestroy($thumb); imagedestroy($source); |
|
7
我在OSC上分享过相关的代码,http://www.oschina.net/code/snippet_590893_13105, 希望对你有用^_^
|
|
10
@Tom21joy hackes#outlook.com
|
|
regentSep 17, 2012
11
|