Not signed in (Sign In)

Vanilla 1.1.10 is a product of Lussumo. More Information: Documentation, Community Support.

  1.  
    I'd like to modify plogger so that the large thumbnails are resized so that they fit inside a rectangular area. this means there's a max width and a max height as well, and they are different from each other. can someone help me out by pointing to where in the code i should modify? do i need to modify phpThumb.class?

    Thanks
    • CommentAuthorjammindice
    • CommentTimeSep 18th 2007
     
    do it cheap and easy... use some javascript in the <img tag in the pictures.php file in the theme you're using...

    OnLoad="if(this.width > 640) {this.width=640}"

    you could also add height in as well...
  2.  
    That's a good suggestion, except resizing images just a little bit in a browser doesn't always look great. other suggestions? an anyone point to where resizing takes place in the php?
    • CommentAuthorjammindice
    • CommentTimeSep 18th 2007
     
    there is no real resizing in plogger it makes copies that are stored in the thumbs folder. The function that does this is in plog-functions.php and is called generate_thumb() and begins about line 447 in my plogger install.

    this is the function you want to modify so that the large thumbs it makes are to your specifications. then just delete all your old thumbs and let it make new ones that work right for you.
  3.  
    Posted By: mattgilbertI'd like to modify plogger so that the large thumbnails are resized so that they fit inside a rectangular area. this means there's a max width and a max height as well, and they are different from each other. can someone help me out by pointing to where in the code i should modify? do i need to modify phpThumb.class?

    Thanks


    I wanted to do the same thing, and found this worked for me:

    In plog-functions.php, on line +- 535, replace this:


    // Set image height instead of width if not using square thumbs
    if ($type == THUMB_SMALL && !$config['square_thumbs']) {
    $phpThumb->h = $thumb_config['size'];
    $phpThumb->w = '';
    }


    with this:


    // Set image height instead of width if not using square thumbs
    if ($type == THUMB_SMALL && !$config['square_thumbs']) {
    $phpThumb->h = $thumb_config['size'];
    $phpThumb->h = $thumb_config['size'];
    }


    This will create thumbnails with an equal width and height.

    You will also need to delete your thumbnails, stored in
    the directory
    /thumbs/

    before you'll notice the changes.

    Hope this works for you as well.