Title: nggScrollGallery Error Message
Last modified: August 21, 2016

---

# nggScrollGallery Error Message

 *  [emiglio](https://wordpress.org/support/users/emiglio/)
 * (@emiglio)
 * [12 years, 2 months ago](https://wordpress.org/support/topic/nggscrollgallery-error-message/)
 * On one of my Galleries the following Message appears:
 * `Warning: Division by zero in /home/galerie3/public_html/wp-content/plugins/nextgen-
   scrollgallery/nggScrollGallery.php on line 296`
 * To see [here](http://www.galerie-mera.ch/erwin-gloor/)
 * All other Galleries work fine.
 * [http://wordpress.org/plugins/nextgen-scrollgallery/](http://wordpress.org/plugins/nextgen-scrollgallery/)

Viewing 15 replies - 1 through 15 (of 22 total)

1 [2](https://wordpress.org/support/topic/nggscrollgallery-error-message/page/2/?output_format=md)
[→](https://wordpress.org/support/topic/nggscrollgallery-error-message/page/2/?output_format=md)

 *  [CliffDillard](https://wordpress.org/support/users/cliffdillard/)
 * (@cliffdillard)
 * [12 years, 2 months ago](https://wordpress.org/support/topic/nggscrollgallery-error-message/#post-4558601)
 * I got the same error and resolved it by going to Manage Galleries and under Bulk
   Options select Import Metadata. Once it was updated, the error message went away.
   Not sure if that is the exact solution but it worked for me.
 *  Thread Starter [emiglio](https://wordpress.org/support/users/emiglio/)
 * (@emiglio)
 * [12 years, 2 months ago](https://wordpress.org/support/topic/nggscrollgallery-error-message/#post-4558602)
 * Thank you so much, thats the Solution.
 *  [redcolorcreative.com](https://wordpress.org/support/users/redcolorcreativecom/)
 * (@redcolorcreativecom)
 * [11 years, 11 months ago](https://wordpress.org/support/topic/nggscrollgallery-error-message/#post-4558703)
 * Hello, I have an angry client and I’m hoping you can help me.
 * Here is his site:
    [http://jeffgreenphoto.com](http://jeffgreenphoto.com)
 * Basically, three of the galleries keep breaking (residential architecture, commercial
   architecture, and food & beverage). I fix them, but whenever he changes images
   in his gallery (adding, deleting, and changing tags) the gallery breaks and we
   get Warning: Division by zero error.
 * I think we may have it narrowed down to something within the tags. The galleries
   work after I fix them if I don’t put any tags in. Client adds images and tags
   and the galleries break.
 * The current problem gallery page:
    [http://jeffgreenphoto.com/portfolios/commercial-architecture/?preview=true&preview_id=25&preview_nonce=90d46d9635](http://jeffgreenphoto.com/portfolios/commercial-architecture/?preview=true&preview_id=25&preview_nonce=90d46d9635)
 * Thanks so much for any help you can offer!! I am at the end of my rope here. -
   Ann
 *  [daveandjen](https://wordpress.org/support/users/daveandjen/)
 * (@daveandjen)
 * [11 years, 9 months ago](https://wordpress.org/support/topic/nggscrollgallery-error-message/#post-4558706)
 * I have the same message
    Warning: Division by zero in /home/content/20/9755120/
   html/laketahoe/wp-content/plugins/nextgen-scrollgallery/nggScrollGallery.php 
   on line 296
 * I have version 1.8.2 have checked all my photo sizes and settings.
 * Here’s the link [http://daveandjen-sept12.com/add-your-photos/](http://daveandjen-sept12.com/add-your-photos/)
 *  [daveandjen](https://wordpress.org/support/users/daveandjen/)
 * (@daveandjen)
 * [11 years, 9 months ago](https://wordpress.org/support/topic/nggscrollgallery-error-message/#post-4558707)
 * I have the same message
    Warning: Division by zero in /home/content/20/9755120/
   html/laketahoe/wp-content/plugins/nextgen-scrollgallery/nggScrollGallery.php 
   on line 296
 * I have version 1.8.2 have checked all my photo sizes and settings.
 * I tried the import meta data and instead of one warning, I recieved a warning
   for all images
 * Here’s the link [http://daveandjen-sept12.com/add-your-photos/](http://daveandjen-sept12.com/add-your-photos/)
 *  Thread Starter [emiglio](https://wordpress.org/support/users/emiglio/)
 * (@emiglio)
 * [11 years, 8 months ago](https://wordpress.org/support/topic/nggscrollgallery-error-message/#post-4558708)
 * ’til now it works with “import metadata”, but since yesterday the Warning appears
   by creating a new Gallery.
    Has anybody find a Solution about this Problem?
 * ScrollGallery 1.8.2 / WP 3.9.2
 *  Thread Starter [emiglio](https://wordpress.org/support/users/emiglio/)
 * (@emiglio)
 * [11 years, 8 months ago](https://wordpress.org/support/topic/nggscrollgallery-error-message/#post-4558709)
 * The Warning appears only on new created Galleries, the older ones are not affected.
   
   Should i maybe return to a older Version of this Plugin?
 * [@daveandjen](https://wordpress.org/support/users/daveandjen/): It seems you 
   solved this Problem. How you get clear with that?
 *  Thread Starter [emiglio](https://wordpress.org/support/users/emiglio/)
 * (@emiglio)
 * [11 years, 8 months ago](https://wordpress.org/support/topic/nggscrollgallery-error-message/#post-4558710)
 * And now, by and by the Error appears on other Sites. It’s a bit frustrating, 
   because it’s a running Galery-Site with many Visitors.
    Questions: Is this Problem
   maybe because of a newer WordPress Installation? Or a newer NextGen Gallery Plugin-
   Version? Has anybody any Idea?
 *  [shlampe](https://wordpress.org/support/users/shlampe/)
 * (@shlampe)
 * [11 years, 8 months ago](https://wordpress.org/support/topic/nggscrollgallery-error-message/#post-4558711)
 * Having the same issue here. Tried importing meta data, all data seems to be correct.
 *  Thread Starter [emiglio](https://wordpress.org/support/users/emiglio/)
 * (@emiglio)
 * [11 years, 8 months ago](https://wordpress.org/support/topic/nggscrollgallery-error-message/#post-4558712)
 * Now it works after this Workaround:
 * [Link](http://pastebin.com/QWZ5e1aR)
 * First i replaced the hole Code, but then i get an Error in the Backend.
    So be
   sure to Backup the nggScrollGallery.php File before starting this. After i only
   replaced Lines 288 – 297 it works!
 * Hope it helps on other Sites too. Thanks to PASTEBIN anyway.
 *  [Lord Acuña](https://wordpress.org/support/users/lordxtina/)
 * (@lordxtina)
 * [11 years, 7 months ago](https://wordpress.org/support/topic/nggscrollgallery-error-message/#post-4558713)
 * ^ Thank you emiglio! That worked for me.
 * The error was kinda annoying. Even tho there were new updates, it still wouldn’t
   go away. The “import metadata” would work before, now it doesn’t anymore. But
   again, thanks to emiglio for finding that solution.
 *  [CompassWest](https://wordpress.org/support/users/compasswest/)
 * (@compasswest)
 * [11 years, 7 months ago](https://wordpress.org/support/topic/nggscrollgallery-error-message/#post-4558714)
 * Thank-you Emiglio! I was tearing my hair out yesterday trying to figure this 
   out. Works perfectly now!
 *  [frednat](https://wordpress.org/support/users/frednat/)
 * (@frednat)
 * [11 years, 7 months ago](https://wordpress.org/support/topic/nggscrollgallery-error-message/#post-4558715)
 * Thank you thank you thank you
 * Thanks again that worked for me. Had the same problem. However a word of warning,
   I used the PASTEBIN site and copied all the lines into my nggScrollGallery.php
   file, but with it it copied a PASTEBIN banner that hacked my wordpress website!
   
   Had to reinstall nggallery…
 * So best to copy over carefully the differences in lines 288-297.
 * Still this works now!
 *  Anonymous User 8953667
 * (@anonymized-8953667)
 * [11 years, 6 months ago](https://wordpress.org/support/topic/nggscrollgallery-error-message/#post-4558717)
 * Don’t know if above is the best solution to this.
 * What happend is that meta_data isn’t stored as serialized data anymore, but as
   json encoded as base_64 in the meta_data DB field.
 * I found this solution to work:
 * open up nggScrollGallery.php
 * Go the part where the $pictures array is filled (from line 198).
 * Replace
 *     ```
       $serialized_data = unserialize($picture->meta_data);
       			  $aux["width"]  = $serialized_data["width"];
       			  $aux["height"]  = $serialized_data["height"];
       ```
   
 * with:
 *     ```
       $base64_data = json_decode(base64_decode($picture->meta_data), TRUE);
       			  $aux["width"]  = $base64_data["width"];
       			  $aux["height"]  = $base64_data["height"];
       ```
   
 * I have taken this code from an original function included with the next gallery
   plugin. So should be ok.
 * Don’t forget to rewrite all your metadata of the images (to make sure it is stored
   as json and decoded as base64).
 * good luck 😉
 *  [urbanscout](https://wordpress.org/support/users/urbanscout/)
 * (@urbanscout)
 * [11 years, 5 months ago](https://wordpress.org/support/topic/nggscrollgallery-error-message/#post-4558719)
 * [@erik](https://wordpress.org/support/users/erik/),
 * I was having this problem too, and tried your code and it worked. Thank you!

Viewing 15 replies - 1 through 15 (of 22 total)

1 [2](https://wordpress.org/support/topic/nggscrollgallery-error-message/page/2/?output_format=md)
[→](https://wordpress.org/support/topic/nggscrollgallery-error-message/page/2/?output_format=md)

The topic ‘nggScrollGallery Error Message’ is closed to new replies.

 * ![](https://s.w.org/plugins/geopattern-icon/nextgen-scrollgallery_2c1d0b.svg)
 * [NextGEN Scroll Gallery](https://wordpress.org/plugins/nextgen-scrollgallery/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/nextgen-scrollgallery/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/nextgen-scrollgallery/)
 * [Active Topics](https://wordpress.org/support/plugin/nextgen-scrollgallery/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/nextgen-scrollgallery/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/nextgen-scrollgallery/reviews/)

 * 22 replies
 * 12 participants
 * Last reply from: [John Craig](https://wordpress.org/support/users/john_m_craig/)
 * Last activity: [11 years, 3 months ago](https://wordpress.org/support/topic/nggscrollgallery-error-message/page/2/#post-4558726)
 * Status: not resolved