PHP batch generate image thumbnails (1/5)

Source: Internet
Author: User

PHP batch generation of image thumbnails this batch generation of thumbnail code can generate a small image of a specified size, and supports batch file upload.

Php tutorial batch generate image thumbnails
This batch-generated thumbnail code can generate small images of the specified size, and supports batch file upload.

This tutorial uses the PHP File
View. php
Config. php
Funs. php
Index. php


Function:
-----------------------
1. Generate a specified size thumbnail for the images in the folder
2. List subfolders. You can specify a folder to generate
3. To generate images of different sizes, save the images to a new directory, while the directory structure remains unchanged.

Implementation:
-----------------------
1. Original image folder $ image
2. Save the processed data to $ newimage
Keep the directory structure and file name unchanged (easy to call)
3. skip this step if the image already exists in the new folder.

Operation interface:
-----------------------
1. $ image input box
2. $ newimage input box (if it is not specified, the directory with the thumbnail size as the file name is just at the level of the current directory)
3. Click "Search" to list all folders, generate cache, and write to files.
4. Generate. Generate sub-Directories

*/
?>
// Index. php code

<! Doctype html public "-// w3c // dtd html 4.0 transitional // en">
<Html>
<Head>
<Meta http-equiv = "content-type" content = "text/html; charset = gb2312">
<Title> Generate a thumbnail </title>
</Head>
<Body>
<? Php
/* + ------------------------------------------------------------- +
* | Copyright (c) 2008-2009 yese. in all rights reserved.
* + ------------------------------------------------------------- +
* | Author: wbsifan <wbsifan@163.com> <qq: 29500196>
* + ------------------------------------------------------------- +
* | Filename: index. php v0.1
* | Update: 2008-07-01
* | Content: generate a thumbnail.
* + ------------------------------------------------------------- +
*/1 2 3 4 5

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.