PHP uses Timthumb to generate thumbnails, timthumb thumbnail images
This example describes how PHP uses Timthumb to generate thumbnails. Share to everyone for your reference, as follows:
There are two ways to generate a indented graph:
First, the early generation of good, for the call
The general practice is to start based on the image specifications in the site, how many kinds of indented graph to generate, the image upload process will generate indentation, for different needs to call. A little bit like this method is, if you add the image specifications, the previously uploaded pictures do not have the specifications, but also to regenerate.
second, when the call is generated in the indented graph . That's why I'm writing this article.
Recommend a timthumb, personally feel that in the case of performance, efficiency, this thing, is absolutely easy to use.
1, download Address: http://timthumb.googlecode.com/svn/trunk/timthumb.php
2, how to use
After downloading, put in your web environment, in a directory parallel to the timthumb.php to build a cache folder, give 755 permissions, Windows, it is not. The test code is as follows:
<?php$image = "Http://localhost/test/pen_pic03.png";? >Timthumb&w=58&h=46&zc=1 "alt=" "/>
Parameter description:
W=58 indicates a picture width of 58
H=46 indicates a picture height of 46
Can be set casually as needed.
Timthumb The biggest advantage is the convenience, has not encountered such a tool, the shortcomings are equally obvious, each time the request, will call php-cgi or PHP-CLI, the cached data in the cache directory, call data to find the directory, the performance will be relatively low.
I hope this article is helpful to you in PHP programming.
Articles you may be interested in:
- PHP upload images generated thumbnails (GD library)
- PHP generate High Definition thumbnail instance detailed
- How to generate thumbnails of pictures using PHP
- PHP simple way to generate thumbnail albums
- How to generate thumbnail images in bulk in PHP
- How PHP uses the GD library to create picture thumbnails
- PHP dynamically generates thumbnails and outputs the displayed method
- thinkphp How to call the image class to generate thumbnails
- PHP generated image thumbnail class code sharing based on GD2 graphics library
- thinkphp3.2.2 implementation method for generating multiple thumbnail images
http://www.bkjia.com/PHPjc/1094745.html www.bkjia.com true http://www.bkjia.com/PHPjc/1094745.html techarticle PHP uses Timthumb to generate thumbnails, timthumb thumbnails This article explains how PHP uses Timthumb to generate thumbnails. Share to everyone for your reference, as follows: Generate ...