PHP uses timthumb to generate thumbnails

Recently, I need an interface for online screenshots, but I haven’t found it suitable for a long time, and then It is a little troublesome to write it by myself. Suddenly, I remember that I encountered a slightly thumbnail class when I was using wordpress. Don’t use it too easily. I recommend it here.
Anyone who has used the Timthumb class should be familiar with it. This class can be used to generate and process thumbnails of images, or to take screenshots of websites if you have optipng or pngCrush installed in a Linux environment.
File download address:
Wordpress comes every time to upload the features of the thumbnails of all images by cutting according to set the image size, and cut the original image and the image stored in the web space, image cut only once, change the Settings of the size will not regenerate, so not only occupy the host space, after revision sites use the same images, even when otherwise image distortion or deformation. Timthumb. PHP is a thumbnail application project integrated in wordpress theme specially developed for wordpress. It will only crop the called images, and only generate a configuration file temporarily when there is an access request.
Parameter description:
SRC: the need for image zooming source address, or the need for screenshots operation web address webshot: if this value is true, for screenshots operation w: generate the width of the image, if the width or height only set up a value, according to one of the values for geometric scaling of h: the height of the generated images, if the height and width is not specified, the default is 100 * 100 zc: generate picture zoom mode, optional value of 0, 1, 2, 3, the default is 1, the difference between each value annotation line 100 q can see the following documents: Generated images quality, the default 90 a: beyond the cutting location of parts, and zooming pattern, optional value t, b, l, r, the default is cut from the top to f: need to generate images after use some filters, here are the different code and the value of the filter, the specific operation method is the line 821 annotations file below s: whether to sharpen the production pictures of cc: generating background canvas picture color ct: generate PNG image background is transparent
Warm tips:
Timthumb requires host support for GD libraries; The processing of Timthumb requires certain server resources. Timthumb does not support external linked images; There have been holes in Timthumb; The author indicates that Timthumb is no longer updated.
Patch the bugs in Timthumb. PHP:
Whitelists are removed using the latest version of timthumb. PHP (but the author says no more updates) server directory permissions Settings
Find the following code in the file, delete or comment it out

// external domains that are allowed to be displayed on your website
$allowedSites = array (

Read More: