TimThumb Demo: Part 4 – Moving Image Crop Location
This page showcases the demos for part 4 of the TimThumb primer. Moving Image Crop Locations.
WordPress and Web Development › home of Ben Gillbanks
This page showcases the demos for part 4 of the TimThumb primer. Moving Image Crop Locations.
1. |
timthumb.php?src=lighthouse.jpg Default (for comparisson). Notice the top and bottom have been cropped off |
|
2. |
timthumb.php?src=lighthouse.jpg&a=t&w=130&h=90 Alignment is changed to top (a=1) and the cropping region moves upwards to show the top of the lighthouse. Awesomeness! |
|
3. |
timthumb.php?src=lighthouse.jpg&a=b&h=70&w=100 Alignment set to bottom and we can show the lower part of the lighthouse |
|
4. |
timthumb.php?src=lighthouse.jpg&a=r Align to the right. Because the image is tall and thin, and the crop size is square, it's already touching the right edge and so stays in the center vertically. |
|
5. |
timthumb.php?src=lighthouse.jpg&a=r&w=60&h=130 If we make the crop size tall and thin then we can set the alignment right and get the right hand side of the image |