Php uses timthumb to generate a thumbnail. Php uses timthumb to generate a thumbnail. This document describes how to generate a thumbnail using timthumb in php. For your reference, refer to: how to generate a thumbnail using timthumb in php, and how to generate a thumbnail using timthumb.
This example describes how to use timthumb to generate thumbnails in php. We will share this with you for your reference. The details are as follows:
There are two ways to generate a column chart:
1. generate the information in advance for calling
The common practice of column chart shrinking is to start generating the number of types of column charts based on the image types on the website. during The Image uploading process, the column shrinking is generated for different requests. If the image type is not added, the previously uploaded image must be regenerated.
II. generating a column chart during the call. This is why I wrote this article.
I recommend a timthumb. I personally think this is definitely useful without considering performance and efficiency.
1,: http://timthumb.googlecode.com/svn/trunk/timthumb.php
2. usage
After downloading the file, place it in your web environment and create a cache folder in the directory parallel to timthumb. php. Grant the 755 permission. if it is windows, you will not need to use it. 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 that the image width is 58.
H = 46 indicates that the image height is 46.
You can set it as needed.
The greatest advantage of timthumb is its convenience. At present, we have never encountered such a tool. The disadvantage is also obvious. every time a request is made, we call php-cgi or php-cli, the cached data is stored in the cache directory, and the called data needs to be searched for the directory, which results in low performance.
I hope this article will help you with PHP programming.
Articles you may be interested in:
- Php uploads images to generate thumbnails (GD Library)
- Detailed description of php-generated high-definition thumbnail instances
- How to use PHP to generate image thumbnails
- PHP simple method of generating thumbnail album
- PHP batch generation of image thumbnails
- How to create image thumbnails using the GD Library in php
- Php dynamically generates thumbnails and outputs the display method
- Thinkphp calls the Image class to generate thumbnails.
- Code sharing for generating image thumbnails in PHP based on GD2 graphics library
- Thinkphp3.2.2 how to generate multiple thumbnails
Examples in this article describes how to use timthumb to generate thumbnails in php. Share it with you for your reference. The details are as follows: generate...