The example of this article describes the PHP output image imagegif, imagejpeg and imagepng function usage. Share to everyone for your reference, specific as follows:
The Imagegif (), imagejpeg (), Imagepng (), and imagewbmp () functions allow
PHP output image imagegif, imagejpeg and imagepng function Usage Analysis, imagegifimagepng
This article describes how to use the imagegif, imagejpeg, and imagepng functions of PHP output images. We will share this with you for your reference. The
The Imagegif (), imagejpeg (), Imagepng (), and imagewbmp () functions allow images to be exported to a browser or file in GIF, JPEG, PNG, and WBMP formats, respectively.PHP Output ImagePHP allows images to be exported in different formats:
Only one image is displayed on the webpage.
Only one image is displayed on the webpage.
Reply content:
Only one image is displayed on the webpage.
Imagejpeg ($ im, "../images/image001.jpg"); // save it to an address
And then reference it twice
PHP imagejpeg generate thumbnails A very strange problem to encounter
Using imagejpeg to generate thumbnails
If it is:
Imagejpeg ($newimg, ' ... /.. /public/images/dish/224/1331787945.jpg '); it can be generated, but if it is:
$path = '. /.. /public/
Using PHP to create images is a fairly easy thing to do. As long as you install some Third-party library files and have some knowledge of geometry, you can use PHP to create and process images. PHP currently uses the GD library to process images.
Note: If you want to use PHP GD processing we need to open the GD library
GD Library support for PHP under Windows
Find php.ini, open content, find:
; Extension=php_gd2.dll
Put the front semicolon ";" Remove, then save, if there is no semicolon,
You can generate thumbnail images using the following classes,
The code is as follows
Copy Code
Class Resizeimage{Picture typevar $type;Actual widthvar $width;Actual heightvar $height;The width after the changevar
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.