Conversation
supportOn 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 All other Galleries work fine. http://wordpress.org/plugins/nextgen-scrollgallery/
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.
Thank you so much, thats the Solution.
Hello, I have an angry client and I’m hoping you can help me. Here is his site: 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 Thanks so much for any help you can offer!! I am at the end of my rope here. -Ann
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/
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/
’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
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 : It seems you solved this Problem. How you get clear with that?
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?
Having the same issue here. Tried importing meta data, all data seems to be correct.
Now it works after this Workaround: Link 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.
^ 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.
Thank-you Emiglio! I was tearing my hair out yesterday trying to figure this out. Works perfectly now!
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!
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 😉
@erik , I was having this problem too, and tried your code and it worked. Thank you!
Hm. Actually changing it fixed the new galleries, but broke the old ones. 🙁
Hi there urbanscout, did you rewrite the metadata of the old gallery? You can do so by selecting the images in the gallery and choose ‘get metadata’.
Thank you @erik ! Replacing the code and then importing the metadata worked!
Thanks to everyone for your solutions and help. I have 2 Galleries; one works and the other has the “Division by zero” error on all images. This is actually the other way round from before I made any changes. Interestingly when I went to edit the code the panel was empty so I copied the code from the link provided by emiglio. I’m sure this shouldn’t be required but I have no choice. I did delete the plug-in and reinstalled it and I still had an empty code panel. I’ve replaced the code that Erik suggested and Imported Metadata for all the images on both Galleries. Any help gratefully received.
Hi John, It’s strange that you get an empty panel. You should be seeing the code, if the plugin was installed correctly. I have just checked it myself, and I also have a blank page (while using plugin>editor from the wordpress menu). My advice is to deactivate and delete the plugin. Then reinstall the plugin. This is just to make sure any prior edits are gone. Then, you have 2 options: 1) edit the file with a program like dreamweaver that connects to the site, so you can make the changes online. 2) download the file “nggScrollGallery.php” from the server and edit it locally with notepad (do not use word or any other program that will convert from plain text). After edit: upload again. good luck.
Sorry, Ignore me – user error. I hadn’t realised I have so many images in one Gallery that I had to forward to the second page and Imported the Metadata for them too. Everything worked perfectly after that. I now have 2 galleries behaving as they used to. Thanks again everyone.
Hi Erik, Thanks for such a rapid response. I just worked it out and it was my mistake (see above) – more images in one gallery than fit on a page so I had to reimport the Metadata on the second page worth of images and it all worked. Interestingly I did deactivate, delete and reinstall the plug in a couple of times and each time ended up with a blank panel of code even though it was there on the website. So I copied the code from there and applied your fix. I wonder why the plug-in authors are not releasing an update based on your fix? Regards, …/John
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.
Thank you so much, thats the Solution.
Hello, I have an angry client and I’m hoping you can help me. Here is his site: 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 Thanks so much for any help you can offer!! I am at the end of my rope here. -Ann
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/
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/
’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
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 : It seems you solved this Problem. How you get clear with that?
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?
Having the same issue here. Tried importing meta data, all data seems to be correct.
Now it works after this Workaround: Link 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.
^ 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.
Thank-you Emiglio! I was tearing my hair out yesterday trying to figure this out. Works perfectly now!
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!
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 😉
@erik , I was having this problem too, and tried your code and it worked. Thank you!
Hm. Actually changing it fixed the new galleries, but broke the old ones. 🙁
Hi there urbanscout, did you rewrite the metadata of the old gallery? You can do so by selecting the images in the gallery and choose ‘get metadata’.
Thank you @erik ! Replacing the code and then importing the metadata worked!
Thanks to everyone for your solutions and help. I have 2 Galleries; one works and the other has the “Division by zero” error on all images. This is actually the other way round from before I made any changes. Interestingly when I went to edit the code the panel was empty so I copied the code from the link provided by emiglio. I’m sure this shouldn’t be required but I have no choice. I did delete the plug-in and reinstalled it and I still had an empty code panel. I’ve replaced the code that Erik suggested and Imported Metadata for all the images on both Galleries. Any help gratefully received.
Hi John, It’s strange that you get an empty panel. You should be seeing the code, if the plugin was installed correctly. I have just checked it myself, and I also have a blank page (while using plugin>editor from the wordpress menu). My advice is to deactivate and delete the plugin. Then reinstall the plugin. This is just to make sure any prior edits are gone. Then, you have 2 options: 1) edit the file with a program like dreamweaver that connects to the site, so you can make the changes online. 2) download the file “nggScrollGallery.php” from the server and edit it locally with notepad (do not use word or any other program that will convert from plain text). After edit: upload again. good luck.
Sorry, Ignore me – user error. I hadn’t realised I have so many images in one Gallery that I had to forward to the second page and Imported the Metadata for them too. Everything worked perfectly after that. I now have 2 galleries behaving as they used to. Thanks again everyone.
Hi Erik, Thanks for such a rapid response. I just worked it out and it was my mistake (see above) – more images in one gallery than fit on a page so I had to reimport the Metadata on the second page worth of images and it all worked. Interestingly I did deactivate, delete and reinstall the plug in a couple of times and each time ended up with a blank panel of code even though it was there on the website. So I copied the code from there and applied your fix. I wonder why the plug-in authors are not releasing an update based on your fix? Regards, …/John