PHP Thumbnail Class

倾然丶 夕夏残阳落幕 提交于 2019-12-03 07:57:20

Use phpThumb(). Its a script that internally uses GD library and/or ImageMagick (whichever is available and whichever it thinks is best for the job) to perform basic image manipulation tasks, including thumbnail generation and square thumbnail generation.

You can use it like this:

<!-- best fit -->
<img src="/phpThumb/phpThumb.php?src=/path/to/image.jpg&w=64&h=64">
<!-- crop fit (square thumbnails) -->
<img src="/phpThumb/phpThumb.php?src=/path/to/image.jpg&w=64&h=64&zc=1">

It has built in caching engine so second time a browser requests the above image it is served from its own cache instead of re-generating the thumbnail every time. Though, you may want to spend an hour or so configuring it.

use class.upload.php

see this link for details may be its help you more

http://www.verot.net/php_class_upload_samples.htm

Generating a thumbnail requires so little code that it is a "simple example" of the GD library's resizing functions in the manual:

http://php.net/manual/en/function.imagecopyresampled.php

Just copy and paste.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!