NextGEN Gallery
[resolved] Bug report - NextGen Widget Not Working (19 posts)

  1. RoxyJo
    Posted 3 years ago #

    It seems that the NextGen widget is not working properly.

    I had chosen for the widget to display the original image at a custom size. The widget is still pulling the image from the thumbnails, rather than the original size.

    Also i've also specified that i would like the photo randomly pulled from the category i've specified, but it seems to be pulling them from all categories.


  2. ronenb75
    Posted 3 years ago #

    Same here.
    Version 2.0.7.

    Would love to find a fix.

  3. surocharg
    Posted 3 years ago #

    The same thing happened to me.

    I reported it here: http://www.nextgen-gallery.com/report-bug/

    (And then I replace NextGen widget with another picture).

  4. photocrati
    Plugin Author

    Posted 3 years ago #

    Hi all - we've tested widgets a lot, and I just tested this again on multiple sites to confirm it's working. I tested both slideshow and thumbnail widgets, and tested sized adjustments and limiting by gallery. So we need to understand either exactly what you're trying to get or what maybe happening specific to your instances.

    First, just to confirm: you are all talking about the NextGEN slideshow widget, correct? (not the NextGEN thumbnail widget)

    Second, if you adjust the size to say, 180X270, does the size of the display on your sidebar change to that size?

    Third, @RoxyJo, you mentioned that "chosen for the widget to display the original image" but there's no option we offer for selection to display the original image vs some other source. Also you mentioned "photo randomly pulled from the category" but you'd only be able to choose to display from specific galleries, so I'm wondering if you can clarify on that?

    Any other details you can provide on exactly what's not working would be helpful.

  5. ronenb75
    Posted 3 years ago #

    Hi photocrati,

    I'm using the Nextgen Widget, not the gallery.
    Here's the widget settings: http://pbrd.co/16izJQ8

    If you look at the source of the front page, you see that even though the widget is set to show the original picture, it pulls the thumbnail:


    Hope that helps.

  6. surocharg
    Posted 3 years ago #


    I had a widget called "NextGEN Widget"

    The settings I used:
    Title: Chefstomaten aka Kristina Svensson
    Show: 1 original images
    Enable IE8 Web Sices
    Width x Height: 180 x 400
    Select: only which are listed
    Gallery ID: 112

    It looked great with NGG 1.9.13 but with NGG 2.0 the original picture was replaces with the thumbnail image (100 x 100). And if you blow up a thumbnail 100 x 100 to 180 x 400 it looks rather horrible.

    I replaced it with bracket a href="http://www.kristinasvensson.se/om-kristina-svensson/">
    <img src="http://www.tomatsallad.nu/nextgen-image/2255/180x0x100/8654279101074f1e8577c1767be14442 </a bracket.

  7. RoxyJo
    Posted 3 years ago #

    Yes, those are the exact problems I'm having. In addition, when I specify which gallery I would like the widget to get the photos from, the widget seems to get the photos from all of the Galleries.

    like this:

  8. astrumporta
    Posted 3 years ago #

    I'm having exactly the same problem -- distorted thumbnails are showing instead of the resized original images that used to show. I've tried re-creating the widget, toggling the settings, etc. I went into the database settings for NextGen variables, but it's not easy to see how the widget UI maps to the database.

    I'm using the Mystique theme, but I've done a preview with twentythirteen and the same problem is there. We aren't using any NG plug-ins.

    Site: http://stargate-sg1-solutions.com/blog/

    Settings: http://stargate-sg1-solutions.com/blog/NGWidgetSettings.png

    This is a bit of the html source that's rendered -- note the source is from thumbs/.

    <li class="block"><div class="block-ngg_images clearfix" id="instance-ngg-images-4"><div class="hslice" id="ngg-webslice"><h3 class="entry-title title"><span>Gallery</span></h3><div class="block-div"></div><div class="block-div-arrow"></div><div class="ngg-widget entry-content">
                <a href="http://stargate-sg1-solutions.com/blog/wp-content/gallery/paul-mcgillion/the-killing.jpg" title="<br /><div align="center"><strong>Andrew Clarke in multiple S3 Starting June 30, 2013</div>"
               class="shutterset_96675af4225c20b99435ecd58277eb2f"><img title="The Killing" alt="The Killing"
  9. astrumporta
    Posted 3 years ago #

    I found the bug in the widget. Down in the template code, it is hard-coded to use the 'thumb' selection instead of the user choice, 'thumb' or 'original'.

    Here is the current code, in wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/widget/templates/display_gallery.php:

    <img title="<?php echo esc_attr($image->alttext)?>"
                     alt="<?php echo esc_attr($image->alttext)?>"
                     src="<?php echo esc_attr($storage->get_image_url($image, 'thumb')); ?>"
                     width="<?php echo esc_attr($settings['image_width']); ?>"
                     height="<?php echo esc_attr($settings['image_height']); ?>"

    Note the hard-coded 'thumb'. I changed 'thumb' to $settings['show'], and now my widget looks correct again -- it follows my settings. This seems like a bug that would affect all gallery widgets, so I'm not sure how some folks aren't seeing it!

  10. ronenb75
    Posted 3 years ago #

    @astrumporta, works as charm!

    I was looking at that code, but I didn't look hard enough to fins that.

    Now the next improvement will be to show a dynamic on the fly thumbnail at a specific size from the original picture (different from the default thumbnails size) so it will look good but still as small as possible in download size.

    I might create an external php code to select randomly the gallery directory and create on-the-fly picture.

  11. mihai.todor85
    Posted 3 years ago #

    @photocrati I confirm that @astrumporta's fix did the trick. Please check your code again and integrate this fix in the next version.

  12. photocrati
    Plugin Author

    Posted 3 years ago #

    @astrumporta: Thanks for taking the time to look at this and for posting the fix. Much appreciated. I'll forward it to the developers for review and as long as they don't see any issues, we'll get it into the next official release. .

  13. Keo19
    Posted 3 years ago #

    Thanks @astrumporta for the fix, it works!

  14. ronenb75
    Posted 3 years ago #


    I've made a very nasty workaround to create a right sized picture for the widget.
    What I did, since I have no knowledge of how to create a module for wordpress, I wrote a php snippet which I call from your widget.

    As I said, it's a nasty hack but if you could make something similar - that would be great. It saves the need to download a full size image and scale it within the browser.

    The code:

    /* Ugly workaround to display the front small picture better then intended */
    header("Cache-Control: no-cache, must-revalidate"); // HTTP/1.1
    header("Expires: Sat, 26 Jul 1997 05:00:00 GMT"); // Date in the past
    header("Content-Type: image/jpeg");
    $baseDir = '/var/www/html/';					// Base wordpress dirctory
    $cleanDir = '/wp-content/gallery/';				// Make sure no-one is trying to hack us
    $targetWidth = 250;
    $targetHeight = 250;
    $path = parse_url($_GET['url'], PHP_URL_PATH);	// Get the path out of the full image location
    $path = str_replace('..', '', $path);			// Remove any .. from the path, to eliminate use of parent dir
    if (strstr($path, $cleanDir)) {					// Making sure path include our hard coded value
    	$filename = $baseDir . $path;
    	if (is_file($filename)) {					// Last check - is it a file?
    		$size = GetImageSize($filename);		// Get the original picture dimentions
    		$originalWidth = $size[0];
    		$originalHeight = $size[1];
    		$ratioW = $targetWidth / $originalWidth;	// Check the best way to resize
    		$ratioH = $targetHeight / $originalHeight;
    		if ($ratioW < $ratioH)
    			$ratio = $ratioW;
    			$ratio = $ratioH;
    			$newWidth = $originalWidth * $ratio;	// New dimentions
    			$newHeight = $originalHeight * $ratio;
    			$source = ImageCreateFromJPEG($filename);
    			$target = imagecreatetruecolor($newWidth, $newHeight);
    			ImageCopyResized($target, $source, 0, 0, 0, 0, $newWidth, $newHeight, $originalWidth, $originalHeight);
    			imageinterlace($target, true);
    			ImageJpeg($target, NULL, 75);

    The call from the original widget, from:
    src="<?php echo esc_attr($storage->get_image_url($image, $settings['show'])); ?>"


    src="/wp-content/additions/createthumb.php?url=<?php echo esc_attr($storage->get_image_url($image, $settings['show'])); ?>"

  15. otechwebmaster
    Posted 3 years ago #

    I have a similar problem...
    I cannot add more them 363 Images. If I exceed that number I get a white page, without any error messages.
    It does not matter what I change in the settings of the widget, I still get the same result.
    With the previous versions of NG every thing workt, I could have more than 2000 images showing basically unlimited... This function is critical for those of us who want to show the flow of latest images uploaded to a site.
    A little suggestion; Ad a RSS feed to that widget. Every widgets will have a unique RSS feed. Example; Easier for people following a site to follow different categories of images uploaded.

    On to the next problem...
    For now I have to settle with the limitations of the widget.
    With the previous versions of using the widget the result was a nice layouts with proper spacing between the images and white borders and now it is gone... I had to look in the CSS of NG.
    But could not find any CSS for this function I had to fiddle around with some of the other CSS files but without any luck.

    I really hope the NG crew I will fix this as soon as humanly possible

    PS I did not seem to have any problems with image resizing.

  16. photocrati
    Plugin Author

    Posted 3 years ago #

    Hey all - just and update that one of our developers has resolved this. We'll aim to push out an informal release with this fix (and others) tomorrow (Thursday) on our latest beta page. It should be in any version 2.0.13 or later.


  17. DarkDot
    Posted 3 years ago #

    I just installed the beta and am still having a similar issue. My slideshow widget will rotate through pictures no problem while I am logged in to the admin. Once I visit the site as a guest and am not logged in it will show 1 to 3 pictures before it just goes black and stops showing any pictures.

    I'm not sure if this is related to the above but it is a widget bug and I didn't want to create anther thread for it.

  18. photocrati
    Plugin Author

    Posted 3 years ago #

    @DarkDot - Our latest beta is v2.0.12, as Erick mentioned earlier, v2.0.13 including a fix won't be available until Thursday. I am going to mark this issue resolved as we should have a fix available in v2.0.13 Beta and our next update scheduled for Monday.


  19. jesse11
    Posted 3 years ago #

    I'm having a similar problem with the Next Gen widget which I just upgraded to 2.0.14.

    http://theoriginalzmusic.com/ Bottom right of the page, the path to the URLs is showing up as: http://theoriginalzmusic.com/wp-content/galleriesflyers/thumbs/thumbs_77225d_e00198f1ccd3443231c6079854f08ea5.png_srz_650_775_75_22_0-50_1-20_0-00_png_srz.png

    I'm pretty sure the there should be a slash in between galleries and flyers.

    Any ideas?

Topic Closed

This topic has been closed to new replies.

About this Plugin

  • NextGEN Gallery
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic