PHPThumb image processing instance code _ PHP Tutorial

Source: Internet
Author: User
PHPThumb image processing instance code. (Github. commasterexploderPHPThumb ). Note that this class library is named phpThumb with the same name as it is case-sensitive, so pay attention to it when searching documents. In the network

(Github.com/masterexploder/PHPThumb ).
Note that this class library is named phpThumb with the same name as it is case-sensitive, so pay attention to it when searching documents.
In the process of website construction, there are a huge number of images to be processed. it is very tedious to use the PHP image function to process images.

It is very difficult for new users to master. Now we can use the PHPThumb class library to process images, including image size adjustment, image capturing, Image watermarking, and image rotation.

Example:

 resize(100, 100->resizePercent(50->adaptiveResize(175, 175->cropFromCenter(200, 100->crop(100, 100, 300, 200->rotateImageNDegrees(180->save( 'NewPath/Of/image.jpg ' );

Another powerful PHP image thumbnail class: phpThumb
In addition to scaling images, this class can also convert images into different formats for output (for example, exporting GIF images to PNG formats). its special features include colors and special effects.
Official website: http://phpthumb.sourceforge.net/
Generally, you only need the following files:

     

Src: Address of the target image
W: width of the output image
H: height of the output image (if not specified, the image will be scaled by the equal ratio of w parameter)
Q: If the output is in JPG format, you can specify the output quality.
Bg: Background of the output (if needed)
Sw, sh, sx, sy: local output, width and height, starting position
F: output format, which can be jpeg, png, gif, or ico.
Sfn: outputs a frame in the GIF animation.
Fltr []: filters can have many effects, including sharpening, Blur, rotation, watermark, border, masking, and color adjustment.
Address: http://www.jbxue.com/article/php/20250.html

Http://www.bkjia.com/PHPjc/764244.htmlwww.bkjia.comtruehttp://www.bkjia.com/PHPjc/764244.htmlTechArticle (github.com/masterexploder/PHPThumb ). Note that this class library is named phpThumb with the same name as it is case-sensitive, so pay attention to it when searching documents. In the network...

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.