Php uses timthumb to generate thumbnails. timthumb thumbnails _ PHP Tutorial

Source: Internet
Author: User
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...

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.