Phpthumb Picture Processing Instance Code _php tutorial

Source: Internet
Author: User

Download address (GITHUB.COM/MASTEREXPLODER/PHPTHUMB).
Note that this class library has a name called Phpthumb, only the difference in capitalization, so be careful when looking for documents.
In the site construction process, the need to deal with the picture of the place many, with the PHP picture function processing pictures, very cumbersome.

And very difficult for beginners to master. Now we can use the Phpthumb class library to deal with the picture, including, image resizing, image interception, image plus watermark, image rotation and so on.

Example:

  < span>' Path/to/thumblib.inc.php '< span>= Phpthumbfactory::create (' http://www.jbxue.com/'< span>->resize (100  < Span $thumb span>->resizepercent (50  ->adaptiveresize (175, 175  ->cropfromcenter (100   ->crop (180, 200  ->rotateimagendegrees (180  < Span $thumb span>->save (' newpath/of/image.jpg ');            

< span="">

Another powerful PHP image thumbnail class: Phpthumb
In addition to scaling the picture, the class can also convert the picture to different format output (such as the GIF format of the image output to PNG format), its features include color, effects, etc.
Official website: http://phpthumb.sourceforge.net/
Generally, only the following files are required:

<< span>< span="">< span="">< span="">< span="">< span="">< span="">< span="">< span="">< span="">< span="">< span=""> < < span="">   /c26>< span="">     < span="">  < span="">  < span=""> < span="">< span=""> < span="">< span=""> < c48> < span="">  < span=""> 

< span="">

SRC: Address of the target image
W: the width of the output picture
H: The height of the output image (if not specified he will be scaled by the W parameter, etc.)
Q: If the output is in JPG format, you can specify its output quality
BG: Background When output (if required)
SW, SH, SX, SY: Local output, wide height, starting position
F: Output format, can be JPEG, PNG, GIF, ICO
SFN: Output A frame in an animated GIF
Fltr[]: Filters, can have a lot of effects, including sharpening, Blur, spin flip, watermark, border, matte, color adjustment, etc.
Original address: http://www.jbxue.com/article/php/20250.html

http://www.bkjia.com/PHPjc/764244.html www.bkjia.com true http://www.bkjia.com/PHPjc/764244.html techarticle Download Address (github.com/masterexploder/phpthumb). Note that this class library has a name called Phpthumb, only the difference in capitalization, so be careful when looking for documents. In the net ...

  • 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.