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