What is this?
Easy WP Thumbs is a PHP script created with the purpose to make thumbnails creation process as easy and smooth as possible.
Inspired by TimThumb, is deeply integrated into WordPress.
Requires at least WordPress 3.5 and PHP 5.2
Supports WP_Image_Editor class, using Imagick where available.
How to use
- include the script in main plugin/theme file
- place the "ewpt_wpf_form()" function in an admin page to let users check script status and, eventually, insert FTP/SSH credentials
- create thumbnail URL using "easy_wp_thumb()" function or calling the script directly
<?php echo easy_wp_thumb($img_src, $width, $height, $quality, $alignment, $resize, $canvas_col, $fx); ?>
SCRIPT-URL/easy_wp_thumbs.php?src= &w= &h= &q= &a= &rs= &cc= &fx=
|$img_src / src||//||Image source. Could be the WP image ID or the image path/url|
|$width / w||Image's width||Thumbnail's width|
|$height / h||Image's height||Thumbnail's height|
|$quality / q||80||Thumbnail's quality in a scale of 0-100|
|$alignment / a||c||Crop alignment. Possible values: tl, t, tr, l, c, r, bl, b, br|
c = center, t = top, b = bottom, r = right, l = left
|$resize / rs||1||Resize method|
1 = Resize and crop
2 = Resize and add borders
3 = Only resize
|$canvas_col / cc||FFFFFF||Background / borders color - use hexadecimal values|
|$fx / fx||none|
Effects applied to the image
Must be used with commas. Ex: $fx = 1,2,2,2
- If both width and height are not specified, image will have original sizes and recreated with different quality and/or effects
- If only one of them is missing, other will be auto-calculated maintaining image proportions