I'm working with a Wordpress theme that is using the PHP TimThumb script to generate auto-thumbnails. The script is great, but it requires changes to the web server (folder permissions, etc) and it ends up being a bit of a hassle for the end users.
I am looking for an alternative to the TimThumb script for generating thumbnail images.
I started playing around using Wordpress' built in post thumbnails + custom image sizes, and this works really well, but the problem is that not all the images that need to get re-sized are post thumbnails.
The theme contains some custom shortcodes that allow users to insert an image anywhere in the site. The shortcode resizes the image and adds a stylish border around it. The user is required to input the URL of the image, ie: http://www.mysite.com/wp-content/uploads/image.jpg
Ideally I would love to use the Wordpress built in image resizing.
Is it possible to use the built in resizing script on regular images that aren't post thumbnails? (ie in the custom shortcodes outlined above). If not possible, are there any solid alternatives to the TimThumb Script? I'm looking for a "bullet proof" method that works just as well, and won't require the user to make any changes on the server.
Thank you in advance for your help.
You can always use get the image plugin by Justin tadlock.
If you need me to setup an example for you, just drop me an email.
Just tell me where and how you want to use it.
This looks very promising.
I'm just curious, does this work with Post-Thumbnails? I see that it searches for images within the post, or searched for custom fields, but I was confused if it works with post thumbnails as well? Currently my theme requires users to set a Post Thumbnail (or featured image its called now) on blog posts. Will this script resize those as well?
For example you want to use the Feature Image, but for another location with a different image size.
add the following, this will generate a image size home-thumbnail with size 180 x 240.
If you want it to crop, just set the last variable to true.
/*set image sizes*/
add_image_size( 'home-thumbnail', 180, 240,true); //crop
Usage on template.
$home_thumbnail = get_the_image( array('image_class'=>'attachment-home-thumbnail', 'size' => 'home-thumbnail','echo'=>false,'link_to_post'=>false) );
<?php echo $home_thumbnail; ?>
Is this something you want?
Sorry, I am in a rush so didn't fully read your message but here's a great alternative to TimThumb:
This looks very promising.
Just curious how this gets implemented? I mean I know I would add the functionality to the theme via functions.php, but where do you specify image sizes for output?
For example, this is what a piece of code currently looks like using TimThumb. How would this translate using that plugin?
<img src="'.FUNCTIONS.'/thumbs.php?src='.$image_path.'&h=241&w=443&zc=1" alt="'.$description.'" />
Just noticed the server needs PHP 5.2+
This could potentially be an issue for some end users. Hmm...not sure though.
Use this plugin developed by me
Looks great. I just have the same question as above. Just curious what the string would look like in place of TimThumb.
(please refer to my comment above)
Just curious, what are the server requirements for this script? IE PHP version?
Why You just not use it on Windows hosting, or write PHP script that will give additional permission while installing?
Can help with PHP permission writing.
Well it's not only permissions. Sometimes certain hosts, such as HostGator, require mod_security rules be added to the server in order for TimThumb to work.