Array getimagesize (string $filename [, Array & $imageinfo]) gets the image size
Resource Imagecreatetruecolor (int $x _size, int $y _size) New one true color image
Resource Imagecreatefromjpeg (string $filename) creates a new image from a JPEG file
The nonsense does not say, pastes the code:
Copy CodeThe code is as follows:
/************************************
Functions: Watermark ($bigimg, $smallimg, $coord = 1)
Role: Add watermarks
Parameters:
$bigimg must be selected. Big picture--a
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
1. Picture processing class. imagecls.php
2.get_spec_img () calls the picture class, and then saves the picture with a different specification and returns a picture connection in the following way thumb" _path, $width, $height, $gen, true, "",
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
PHP to generate thumbnail images:
To use PHP to generate thumbnail images, make sure your PHP server has the GD2 graphics library installed
Use a class to generate a thumbnail of the picture, the source of the class is shown below
Calling methods
Thumbnail image
Create thumbnails and copyright classes for pictures
Recently a few days to look at the image processing of PHP features, the previous demand in this area is relatively small, there is no way to see, recently have a look. Feel the
Thumbnail image
The classic PHP thumbnail generation program, based on the GD library, can specify the build path and build target of the wide-high detailsUsage: In a PHP environment that supports the GD library, save the following code as a
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.