4

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).

6
  • 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.
    – Rarst
    Commented Jun 30, 2011 at 16:29
  • I'd go with the WP way. I don't see any advantages in using TimThumb Commented 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.
    – Milo
    Commented 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. Commented 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 Commented Jun 30, 2011 at 17:42

4 Answers 4

4

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).

11
  • I didn't even realize that function existed!
    – Lucas
    Commented Jun 30, 2011 at 21:55
  • 1
    yes 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
  • 1
    Oh 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.
    – Yoav Aner
    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
    – Damien
    Commented Aug 29, 2012 at 19:47
6

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:

  1. Familiar UI (Media Manager, "Featured Image" metabox), rather than custom fields
  2. Implement in template using core WordPress functions
  3. Less overhead
  4. Cross-Theme support
  5. Thumbnail image handling remains extensible via Plugin
  6. Thumbnail image handling maintains forward-compatibility with WordPress core
4
  • 3
    Actually you can hook custom crop on top of core functionality, it's just more messy than usual. I have answered question about such recently.
    – Rarst
    Commented Jun 30, 2011 at 21:21
  • @Rarst can that do zoom-crop? If so: checkmate. Commented Jun 30, 2011 at 21:28
  • yep, dimensions for source and target areas do not need to match.
    – Rarst
    Commented 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 :(
    – Damien
    Commented Aug 29, 2012 at 19:48
5

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....

4

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.

2
  • The thing I like about this: ease of use. The thing I hate: it's not hard-coded into the theme.
    – Lucas
    Commented Jul 1, 2011 at 15:18
  • I'm sure you could safely bundle it in a theme, with a little thought.
    – scribu
    Commented Jul 1, 2011 at 16:36

Not the answer you're looking for? Browse other questions tagged or ask your own question.