TimThumb is a simple, flexible, PHP script that resizes images. You give it a bunch of parameters, and it spits out a thumbnail image that you can display on your site.
TimThumb has seen a massive amount of use across the WordPress world, and a few months after we released it, I took over development from Tim, a friend of Darren Hoyts, who created the original script. Since I took over there have been a whole host of changes, bug fixes, and additions.
I set up this page to act as an archive/ resource, showing the best documentation and demos available for TimThumb. If you have any TimThumb related articles then please feel free to send them over to me so that I can add them to the list.
How to use TimThumb
- Timthumb 101: Parameters listing
- Getting Started with TimThumb - basic examples
- Resizing External Images - external images demo
- Image Filters and Editing - filters sample
- Changing the Image Cropping Location - crop location demo
- Image Scaling
- TimThumb Hints and Tips
|stands for||values||What it does|
|src||source||url to image||Tells TimThumb which image to resize › tutorial|
|w||width||the width to resize to||Remove the width to scale proportionally (will then need the height) › tutorial|
|h||height||the height to resize to||Remove the height to scale proportionally (will then need the width) › tutorial|
|q||quality||0 - 100||Compression quality. The higher the number the nicer the image will look. I wouldn't recommend going any higher than about 95 else the image will get too large › tutorial|
|a||alignment||c, t, l, r, b, tl, tr, bl, br||Crop alignment. c = center, t = top, b = bottom, r = right, l = left. The positions can be joined to create diagonal positions › tutorial|
|zc||zoom / crop||0, 1, 2, 3||Change the cropping and scaling settings › tutorial|
|f||filters||too many to mention||Let's you apply image filters to change the resized picture. For instance you can change brightness/ contrast or even blur the image › tutorial|
|s||sharpen||Apply a sharpen filter to the image, makes scaled down images look a little crisper › tutorial|
|cc||canvas colour||hexadecimal colour value (#ffffff)||Change background colour. Most used when changing the zoom and crop settings, which in turn can add borders to the image.|
|ct||canvas transparency||true (1)||Use transparency and ignore background colour|
本站采用创作共享版权协议, 要求署名、非商业和保持一致. 本站欢迎任何非商业应用的转载, 但须注明出自"膘叔", 保留原始链接, 此外还必须标注原文标题和链接.