• Resolved all_good_things

    (@all_good_things)


    Hi!

    I have tried the thumbnail function described here:
    http://mattbrett.com/2010/01/bulletproof-post-thumbnails-in-wordpress-2-9/

    But my thumbnails doesn’t seem to crop, even though I use the ‘true’-function. Any ideas?

    This is what I use in functions.php:

    <?php
    if (function_exists('add_theme_support')) {
    	add_theme_support('post-thumbnails');
    	set_post_thumbnail_size(225, 150, true);
    }
    ?>

    This is what I have in index.php:
    <?php the_post_thumbnail(); ?>

    The thumbnails just seem to re-size propositional. The image URL is just as the same as the original one.

    I’ve read the tutorial in many different versions, but I just can’t seem to see what I’m doing wrong … The thumbnail just doesn’t seem to crop in the exact dimensions I have specified (225×150).

    Any ideas?

    Thanks!

Viewing 6 replies - 1 through 6 (of 6 total)
  • Thread Starter all_good_things

    (@all_good_things)

    Anyone?

    the code looks good…. are you sure you are not getting the crop?

    I’d test by using a photo that is really tall and not very wide and see what results you get.

    I believe the image gets cropped until its to the correct aspect ratio, and then is resized to your dimensions. So the pic is only somewhat cropped, then resized….so your pic would not look squished.

    Whereas if you were not using the crop, it would just get resized, and therefore a very tall pic would look really squished.

    I don’t think the cropping in the thumbnail JUST crops to your desired size…. (I may be wrong here)

    Thread Starter all_good_things

    (@all_good_things)

    Thanks for your reply, RVoodoo.

    If you look at this theme the thumbnails is cropped in the exact desired size »»» http://themeforest.net/item/wave-a-video-centric-theme-for-wordpress/full_screen_preview/45855

    Any idea how this is done, anyone?

    You can see it when you right-click and look at the image info — the image dimensions is specified in the image url, while in my case the image url is just the same as the original image and the dimensions is just proportional scaled.

    A lot of themes use timthumb for resizing….take a peek around the google

    http://www.wprecipes.com/automatically-resize-pictures-on-your-wordpress-blog

    Thread Starter all_good_things

    (@all_good_things)

    TimThumb seemed a bit more complicated. Isn’t is?

    Anyway, after peeking a lot around the google I finally found something that solved the problem:

    http://justintadlock.com/archives/2009/11/16/everything-you-need-to-know-about-wordpress-2-9s-post-image-feature

    Now this is my code in functions.php:

    add_theme_support( 'post-thumbnails' );
    set_post_thumbnail_size( 225, 150, true );

    index.php:

    <?php the_post_thumbnail( 'thumbnail' ); ?>
    Don’t know why, but it works great! 🙂

    Maybe it can help anyone else.
    Thanks anyway!

    It´s still not working for me. I´ve tryed a lot of php tricks but nothing. I´m using the new release of WordPress 3.0.1 but nothing happens. It only resixe the image but don´t crops it!

    Could anyone help me?

Viewing 6 replies - 1 through 6 (of 6 total)

The topic ‘How to crop Thumbnails automatically?’ is closed to new replies.