• Resolved adamheine

    (@adamheine)


    I recently upgraded to WP 2.5 and from NextGEN 0.62 to 0.93. Before the upgrade, I had manually been using the function call to display random thumbnails on my static front page and it worked fine.

    After the upgrade, I had to change the function call to use nggDisplayRandomImages. The thumbnails were fuzzy, but I fixed this by re-creating all the thumbnails at a larger size (though there should really be a bulk way to do this rather than going through each gallery).

    But now my problem is that that the function will not allow for thumbnails of different sizes (e.g. portrait vs. landscape), so some of the pictures appear stretched. The old function allowed for this, or at least I don’t remember having this problem. Any ideas?

Viewing 11 replies - 1 through 11 (of 11 total)
  • I have a similar problem with nggSlideshowWidget. Depending on the height/width ratio determined in calling the function, the slideshow shows cropped images. I checked if altering the ratio in the default size property for the slideshow widget (Gallery… Options… Slideshow) would make a difference, but it doesn’t.
    (…Otherwise a fantastic plugin!)

    Hm… I overlooked the option settings of the Slideshow for ‘stretching’. There do not seem be to such settings for the other functions, though.

    @adam,
    what for a code do you use in 0.62 ? I wonder that I have reduced the amount of features…

    It’s a problem to uses portrait and landscape, maybe with a CSS modification it could be uses, but I’m not aware of it … (I’m a lame CSS hacker ??

    Thread Starter adamheine

    (@adamheine)

    @alexrabe,

    I believe I used to use this function: nggDisplayImagesWidget($thumb,$number,$sizeX,$sizeY,$mode,$imgtype)

    In the galleries, it looks like the thumbnails are being created properly. It’s just that the nggDisplayRandomImages function (or rather the ngg_widget_output function) forces all thumbnails to a certain size. I would think it would be as easy as allowing each thumbnail to just be the size it is, rather than forcing an artificial height/width on it.

    – Adam

    I have quite the same problem. May I ask, if there is already a way to get the pictures sized properly?

    Can some one give me a example link ? Did someone tried to used fixed width/height for the widget ?

    I tried to resize the widget window to show you the problem, but somehow the picture get its properly size after I overcrossed a certain value for the width. The display mode changed when I switched from 150×188 to 170×188.

    Mode at 150×180 -> Stretch:true
    Mode at 170×188 -> Stretch:false

    I just wanted to get Stretch:false mode and I didn’t know that it changes automatically. ??

    So I think therere is no problem, if the display mode is addicted to the resolution.

    Thread Starter adamheine

    (@adamheine)

    You can see the problem here (scroll down to the bottom, “Selections from the Photo Gallery”): https://faithfulheartministry.com/. If you don’t see any stretched pictures, try hitting refresh (you shouldn’t have to do it more than once or at most twice before a portrait-sized picture shows up).

    I’m not using the widget, because I need the pictures on the front page of the site. Instead, I’m calling the function directly like this:

    <div class="ngg-widget">
    		<?php nggDisplayRandomImages('3','192','144'); ?>
    	</div>

    Ok, you need to update the code and remove the style=”width: xxx px; height: xxx px;” setting in nggWidget.php It’s as I said a problem for a mixture from portrait and landscape and you need to use here only the height setting (i.e. 150px)

    Thread Starter adamheine

    (@adamheine)

    That worked. I removed that part of the code in nggWidget.php. In the ngg_widget_output fuction, I changed this:

    $out .= '<img src="'.nggallery::get_thumbnail_url($image->pid).'" style="width:'.$options[$number]['width'].'px;height:'.$options[$number]['height'].'px;" title="'.$image->alttext.'" alt="'.$image->alttext.'" />';

    to this:

    $out .= '<img src="'.nggallery::get_thumbnail_url($image->pid).'" style="height:'.$options[$number]['height'].'px;" title="'.$image->alttext.'" alt="'.$image->alttext.'" />';

    Thank you for your help.

    Thanks a lot! This looks much better. I have made one alteration.
    This code still uses the width style property but when set to zero it does not.

    Change this:
    $out .= '<img src="'.nggallery::get_thumbnail_url($image->pid).'" style="width:'.$options[$number]['width'].'px;height:'.$options[$number]['height'].'px;" title="'.$image->alttext.'" alt="'.$image->alttext.'" />';

    to this:

    $zerowidth = ($options[$number]['width']=='0') ? '' : 'width:'.$options[$number]['width'].'px;';
    $out .= '<img src="'.nggallery::get_thumbnail_url($image->pid).'" style="'.$zerowidth.'height:'.$options[$number]['height'].'px;" title="'.$image->alttext.'" alt="'.$image->alttext.'" />';

Viewing 11 replies - 1 through 11 (of 11 total)
  • The topic ‘[Plugin: NextGEN Gallery] thumbnails in widget not sized properly after upgrade’ is closed to new replies.