Timthumb - How can i crop from top left?

Discussion in 'Programming' started by WD03DKN, Sep 21, 2009.

  1. #1
    Hey Guys,

    I am currently using the TimThumb script with my WP Popular Post Plugin, but id like to have the script crop the image from the top left, rather than the center. At the moment, its cutting the heads off of people in my pics.

    This is the code which comes with WP Popular Post

    $thumb = "<a href=\"".get_permalink($wppost->ID)."\" title=\"". htmlspecialchars(stripslashes($tit)) ."\"><img src=\"". get_bloginfo('url') . "/" . PLUGINDIR . "/wordpress-popular-posts/scripts/timthumb.php?src=". $img[1] ."&amp;h=".$this->options_holder[$summoner]['thumbnail']['height']."&amp;w=".$this->options_holder[$summoner]['thumbnail']['width']."&amp;zc=1\" alt=\"".$wppost->post_title."\" border=\"0\" class=\"wpp-thumbnail\" "."/></a>";
    Code (markup):
    I know that adding this

    &cropfrom=topleft
    Code (markup):
    is the correct piece of code to achieve the top left cropping, but what i dont know, is where / how i place the "&cropfrom=topleft" in the large piece of code at the top of this post.

    Id really appreciate it if somebody could tell me where i place "&cropfrom=topleft" in the large code above.

    With Regards,
    Andrew
     
    WD03DKN, Sep 21, 2009 IP
  2. WD03DKN

    WD03DKN Peon

    Messages:
    98
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    0
    #2
    Can anybody help me please?
     
    WD03DKN, Sep 22, 2009 IP
  3. ccoonen

    ccoonen Well-Known Member

    Messages:
    1,606
    Likes Received:
    71
    Best Answers:
    0
    Trophy Points:
    160
    #3
    ccoonen, Sep 22, 2009 IP
  4. WD03DKN

    WD03DKN Peon

    Messages:
    98
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    0
    #4
    Hey Ccoonen,

    Thank you very much for that sir. Followed the instructions on that web page, and that gave me the desired result. Thanks for taking time out of your day to help me. Its very much appreciated. :)

    Andrew
     
    WD03DKN, Sep 22, 2009 IP
  5. ccoonen

    ccoonen Well-Known Member

    Messages:
    1,606
    Likes Received:
    71
    Best Answers:
    0
    Trophy Points:
    160
    #5
    np Andrew, glad it helped :)
     
    ccoonen, Sep 22, 2009 IP