Home >Backend Development >PHP Tutorial >PHPThumb image processing example analysis
Download address (github.com/masterexploder/PHPThumb). Note that this class library has the same name called phpThumb, the only difference is in upper and lower case, so be careful when searching for documentation. There are countless places to process images, and it is very cumbersome to use PHP's image functions to process images. And it is very difficult for novices to master. You can use the PHPThumb class library to process images, including image resizing, image interception, image watermarking, image rotation and other functions. Example:
This class library has more functions, which I won’t introduce in detail. If you also need to process images when developing a PHP website, you may wish to read the documentation of this class library to ensure that it is easy for you to process images, and you no longer have to deal with those dozen annoying PHP image processing functions! Another powerful PHP image thumbnail class: phpThumb In addition to scaling pictures, this class can also convert pictures into different formats for output (such as outputting pictures in GIF format to PNG format). Its special functions also include color, special effects, etc. Official website: http://phpthumb.sourceforge.net/ Generally, you only need the following files:
In fact, phpThumb has more functions than me I originally thought it would be more powerful. Let’s list some of its other useful parameters: src: the address of the target image w: width of the output image h: the height of the output image (if not specified, it will be scaled according to the w parameter) q: If the output is in JPG format, you can specify its output quality. bg: background when output (if needed) sw, sh, sx, sy: local output, width, height, starting position f: Output format, which can be jpeg, png, gif, ico sfn: Output a certain frame in the gif animation fltr[]: Filter, which can have many effects, including sharpening, blurring, rotation, watermark, border, masking, color adjustment, etc. |