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