When it comes to excerpts, do you believe TimThumb or WordPress thumbnails is the way to go? And why? Answers will not be graded (but may be criticized).
-
Way to go for what? This question makes no sense to me without specific scope to measure against. I am considering closing it as "not constructive" or turning into community wiki.– RarstCommented Jun 30, 2011 at 16:29
-
I'd go with the WP way. I don't see any advantages in using TimThumb– onetrickponyCommented Jun 30, 2011 at 16:30
-
1@One Trick Pony - IMO the only thing TimThumb has that WP thumbs need is on-the-fly generation. I've had many situations where a new layout required new thumbnail sizes, having to re-generate WP thumbs is no fun. TimThumb doesn't play well with cache plugins though without significant hackery, so no go for me.– MiloCommented Jun 30, 2011 at 16:39
-
I'm all about the WP way. Anything WP can do, I stick with. I don't like bringing in external dependencies. The WP thumbnail feature may be a little weak right now.... but IMO it's not hard to add image sizes, and regenerate thumbnails if needed.– Rev. VoodooCommented Jun 30, 2011 at 16:53
-
1@Milo: that's not a feature, that's a bug :) If a thumbnail size is missing in WP you can regenerate it before it gets displayed on the screen– onetrickponyCommented Jun 30, 2011 at 17:42
4 Answers
In my opinion the built in <?php add_image_size( $name, $width, $height, $crop ); ?>
function is much more flexible, easy and with less overhead. It does resize-crop, so I don't see a reason to go back to TimThumb (which I used extensively in the past).
-
-
1yes it's very nice I use it all the time. For instance: if you have a frontpage slider with some weird image dimensions jut add
<?php add_image_size( 'weird-slider-main-image', 634, 74, true ); ?>
and then all you need is to call it<?php if ( has_post_thumbnail() ) { the_post_thumbnail( 'weird-slider-main-image' ); } ?>
Commented Jun 30, 2011 at 22:00 -
1Oh and one last note. If you add this function to an existing site your thumbnails will not be regenerated for past images, but you can use Ajax Thumbnail Rebuild plugin to rebuild the thumbnails for all the uploaded images Commented Jun 30, 2011 at 22:07
-
1@DanielSachs dynamic regeneration is one of the primary reasons I prefer timthumb. Also, I don't necessarily want to use the wordpress media uploader, and rather use FTP/SCP/Git. Timthumb also supports zc=2 option which I find very useful, and different level of compression. I find the way wordpress statically stores all thumbnail sizes inefficient, whereas timthumb just caches what's actually accessed with only one source version. Commented Feb 7, 2012 at 13:21
-
1@Daniel there is one limitation on this function ... which is the crops are all from the centre. This is really bad if you have a headshot (like in Lucas's picture). However i agree this should be the best approach– DamienCommented Aug 29, 2012 at 19:47
WordPress image handling, without question.
The only thing that TimThumb has that is currently not possible with core image handling is zoom crop. Everything else can be accomplished using core image handling, including on-the-fly resizing.
I see absolutely no advantage to using TimThumb, and only disadvantages. It was a great tool prior to WordPress 2.9, but has been essentially unnecessary since then.
EDIT
Advantages to using core system:
- Familiar UI (Media Manager, "Featured Image" metabox), rather than custom fields
- Implement in template using core WordPress functions
- Less overhead
- Cross-Theme support
- Thumbnail image handling remains extensible via Plugin
- Thumbnail image handling maintains forward-compatibility with WordPress core
-
3Actually you can hook custom crop on top of core functionality, it's just more messy than usual. I have answered question about such recently.– RarstCommented Jun 30, 2011 at 21:21
-
-
yep, dimensions for source and target areas do not need to match.– RarstCommented Jun 30, 2011 at 21:34
-
I know all WooThemes still use timthumb for dynamic image requests. But one downside is that some CDN's don't support origin-pull so timthumb never sends the image :(– DamienCommented Aug 29, 2012 at 19:48
Timthumb's ONLY advantage is in reducing the quantity of files stored on the server. By default Wordpress creates 3 images from each upload. If you add additional sizes it will create a new image file for each of those as well.
Basic Usage: 1000 Posts with an average of 5 images per post will produce a minimum of 15,000 images.
Using 5 custom sizes for the crop value used in post listings, etc... 1000 Posts with an average of 5 images per post will produce a minimum of 40,000 images.
Shared hosting environments can limit the number of files on a server to 50,000 or less... thus the helpful use of timthumb which would keep the files stored lower.
That's my 2 cents....
I choose the third option:
http://wordpress.org/extend/plugins/custom-image-sizes/
It generates custom thumbnail sizes on the fly, while still being integrated into WordPress.
Really, with that plugin around, you should never need to use TimThumb again.