Program not tested
CODE:
/******************************************************************************Parameter description:$max _file_size: Upload file size limit, unit byte$destination _folder:
First of all to determine whether the php.ini settings to open the GD extension function, the test is as follows
Print_r (Gd_info ());
If there is a printout of the contents below, then the GD function is open:
Array
(
[GD Version] =>
How to use:
$img = new Iamge;$img->resize (' dstimg.jpg ', ' srcimg.jpg ', 300, 400);Description: This is proportional scaling, dstimg.jpg is the target file, Srcimg.jpg is the source file, the following is the target file width and
In the PHP Web development process, if you set up a site involving a large number of image processing, must involve picture upload, zoom, and how to keep the picture is not distorted, is a lot of beginners PHP Web developers more headaches, today,
Using PHP to upload the image watermark program is to determine the file type to build graphics, and then copy it to the original set up the graphics, fill and build rectangle, in order to write imagestring () or the original has been fixed image
This article mainly summarizes two commonly used PHP image processing class (watermark, scaling, fixed width), very simple and practical, the need for small partners can refer to the
Common PHP Image Processing class (watermark, equal ratio scaling,
The processing method is:
1. When the original image of the width or height of any smaller than the specified size, only to carry out, such as abbreviated processing,
2. When the original image of the width and height are larger than the specified
The following is the PHP source code (resizeimage.php).
Copy CodeThe code is as follows:
$FILENAME = "Image.thumb";
Build the width of the picture
$RESIZEWIDTH = 400;
Height of the build picture
$RESIZEHEIGHT = 400;
function Resizeimage ($im,
This article mainly introduces PHP pictures, such as scaling class SimpleImage use methods and use of instance sharing, need friends can refer to the following Usage Example: Set width, proportional scaling code as follows: image = $new _image;
Program
If you are familiar with PHP's GD library, it is not difficult to read this article!/******************************************************************************Parameter description:$max _file_size: Upload file size limit, unit
Program | source code | Thumbnail processing method is:
1. When the original image of the width or height of any smaller than the specified size, only to carry out, such as abbreviated processing,
2. When the original image of the width and height
This article mainly introduces the use of the GD library in PHP to download all the pictures in the Web page, this article directly gives the implementation code, the need for friends can refer to the
In the previous PHP tutorial on the PHP GD
#*********************************************************
#文件名称:
inc_class.upload.php
#Copyright (c)
2007-2009 Youth once all rights reserved.
#最后更新: 2009-08-05
#版本: v 2.0.a
#注: Please keep this declaration information when forwarding, this
The actual application of the function of creating miniature image when PHP upload picture see Http://feifei2.bjedu.gov.cn/CGI-bin/funnymovie.PHP
For practical applications please see Http://feifei2.bjedu.gov.cn/CGI-bin/funnymovie.PHPThere's a lot
?Automatic thumbnail $srcfile original file, large image, $photo _small object file, small map, $dstW, $dstH is a small map of the wide, high.function Makethumb ($srcFile, $photo _small, $dstW, $dstH) {$data = getimagesize ($srcFile);Switch ($data [2
Upload PHP Code:--------------------------------------------------------------------------------
?
$FILENAME = "Image_name";
Build the width of the picture
$RESIZEWIDTH = 400;
Height of the build picture
$RESIZEHEIGHT = 400;
function
If you have been a friend of that kind of portal, you must know that a picture may be displayed in different places, sizes and proportions.
If only using a picture, then will certainly deformation, and in the display of small map, link large map,
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.