Not signed in (Sign In)

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

    • CommentAuthorkanjigirl
    • CommentTimeNov 3rd 2005
     
    May be a silly question - most of my photos are landscape (500 px wide x 240 px tall). I have the large thumbnails set to 500 width, so they look fine.

    A few of my photos are portrait (240 px wide and 500 px tall). These look bad, because of course they're HUGE because Plogger is fitting them to a 500-wide container.

    How can I show my vertically-oriented pictures at a reasonable size? I don't want the total size of the photo to be any bigger than the horizontally-oriented ones.
  1.  
    Hi Kanjigirl

    Did you ever find a fix for this. I'm having exactly the same problem?
    • CommentAuthorajb
    • CommentTimeApr 18th 2006
     
    I've recently implemented this myself - the changes below will cause thumbnails (both small and large) to be generated with the largest dimension of the picture set to the size conifgured in the options view. This means that portrait images will (by default) have thumbs that are 100 and 500 pixels tall, whilst landscape images will have thumbs that are 100 and 500 pixels wide.

    I haven't tested the changes with the square thumbnails option turned on, but believe they should work.

    The only downside to these changes is that the layout of screens with small thumbnails gets broken - I fixed this by adding width and height entries into the 'tag' section of gallery.css.

    Anyway, to achieve the effect, with release 2.1 beta, you need to change the code from line 63 of plog-functions.php to read as follows (modified or new lines are in green, lines to delete or comment out are in red):


    list($width, $height, $type, $attr) = @getimagesize($thumbpath);
    $max_dim = $width;
    if ($height > $max_dim) { $max_dim = $height; }


    if (!file_exists($thumbpath) ||
    ($thumb_config['filename_prefix'] == '' && !$config['square_thumbs'] && $thumb_config['size'] != $max_dim) ||
    ($thumb_config['filename_prefix'] == '' && !$config['square_thumbs'] && $width == $height) ||
    ($thumb_config['filename_prefix'] == '' && $config['square_thumbs'] && $width != $height) ||
    ($thumb_config['filename_prefix'] != '' && $thumb_config['size'] != $max_dim) ||
    ($thumb_config['filename_prefix'] == '' && $config['square_thumbs'] && $thumb_config['size'] != $height && $thumb_config['size'] != $width)) {

    $phpThumb = new phpThumb();

    // set data
    $phpThumb->setSourceFileName($source_file_name);
    // $phpThumb->w = $thumb_config['size'];
    $phpThumb->q = $config['compression'];

    // set zoom crop flag to get image squared off

    if ($thumb_config['filename_prefix'] == '' && $config['square_thumbs']) {
    $phpThumb->zc = 1;
    $phpThumb->h = $thumb_config['size'];
    $phpThumb->w = $thumb_config['size'];
    } else {
    list($w, $h, $t, $a) = @getimagesize($source_file_name);
    if ($w > $h) {
    $phpThumb->w = $thumb_config['size'];
    } else {
    $phpThumb->h = $thumb_config['size'];
    }

    }

    $phpThumb->config_use_exif_thumbnail_for_speed = false;


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

    • CommentAuthorbgn79
    • CommentTimeJul 3rd 2006
     
    The modifications you posted helped me out for the large thumbnails however I still want all my small thumbnails to be set at the same height.

    My gallery is working with some panoramic collages.

    thanks