-
AuthorPosts
-
December 9, 2013 at 3:37 pm #198030
Dear Admin,
Thank you for reading this. I was experimenting with the Masonry with my blogposts by wordpress gave me this warning :
Warning: Division by zero in /home2/nica72/public_html/brillianceresources.com/wp-content/themes/enfold/config-templatebuilder/avia-shortcodes/masonry_entries.php on line 592
My site is http://brillianceresources.com/test/
I apologise if this has been asked before. I tried searching but cannot find an answer.
Any help is appreciated!
December 9, 2013 at 3:38 pm #198032I tried it on a different browser and it also appears… so I don’t think it’s a browser issue.
December 9, 2013 at 5:06 pm #198079Hi!
I would suggest first deactivating all active plugins and then re-saving the page with the masonry item on it. I’ve not run into the error before so making sure there are not conflicts with another script would be the first thing to check for.
Best regards,
DevinDecember 9, 2013 at 5:41 pm #198096Hi Devin,
Thank you for your reply. I did what you said and discovered it’s because of JetPack. I managed to reproduce the problem by activating Jetpack and connecting to WordPress. Now this is tough. I want JetPack and I also want Masonry. What should I do?
December 9, 2013 at 5:47 pm #198101Try deactivating the individual extensions within jetpack. JetPack by itself won’t cause it as I know many users who actively use it so there is most likely a specific extension within JetPack that is causing the error.
December 9, 2013 at 6:03 pm #198121Hi Devin,
Thank you again. I slowly deactivated the individual extensions one by one. I found that it was this that caused the problem.
Photon
Give your site a boost by loading images in posts from the WordPress.com content delivery network. We cache your images and serve them from our super-fast network, reducing the burden on your Web host with the click of a button.From your experience, is Photon important? Is there a way to have both? If I choose not to have Photon, do you have any recommendations on how I can cache my images to make it faster? I have a image heavy blog :(
December 9, 2013 at 6:06 pm #198123Ah, that would make sense. There are lots of CDN services that you could try using though I don’t know of any off hand that will definitely work with the masonry layout as its still somewhat new.
I’ll tag the rest of the support crew to see if anyone has any recommendations.
December 9, 2013 at 6:15 pm #198130Thank you Devin. Really want to make this work haha. Been scratching my head all night searching through google without a clue.
I really like Masonry as a layout cause I have many more images to show. JetPack is such a common plugin that I am sure there would be many users in the same situation as me. The trouble is, they may assume it’s the fault of Enfold, cause it’s clearly stated on the error line “…themes/enfold/config-templatebuilder/avia-shortcodes/masonry_entries.php” Unless they go through the process like me, they will never know.
Hopefully, there’s a way for you all to make it work with Photon really soon. Please help to escalate this! Thank you!
I volunteer to test your masonry for you! haha.
December 10, 2013 at 8:45 am #198465Hey!
Please create me an admin account and post the login credentials as private reply – I’ll look into it.
Regards,
PeterDecember 10, 2013 at 8:51 am #198467This reply has been marked as private.December 10, 2013 at 11:37 am #198487Hey!
Ok, the issue is caused by the Photon extension and we can’t fix this issue on our end. We use a wordpress function ( http://codex.wordpress.org/Function_Reference/wp_get_attachment_image_src ) to query the image meta data (including the image width and height to calculate the aspect ratio) and the Photon extension seems to delete the width/height data when it fetches the images from the cdn. Because of the missing meta data it’s impossible for our theme code to calculate the aspect ratio and the division of the width/height of the image to calculate the aspect ratio fails (“Division by zero” error). I now added some code which deactivates the aspect ratio calculation if the meta data is missing and in theory you can use the Photon extension without getting the warning message – however I recommend to deactivate the Photon extension because without the aspect ratio calculation you may not get the best results.
Best regards,
PeterDecember 10, 2013 at 2:11 pm #198535Oh I see. Right. I am so grateful for all your effort. I think I won’t use Photon for now. Masonry is too good to give up :)
December 10, 2013 at 2:12 pm #198536Just a last note, do you think I should raise this up with the jetpack team?
December 10, 2013 at 2:17 pm #198538Hey!
Yes, this is probably a good idea because the Photon extension conflicts with a wordpress core function: http://codex.wordpress.org/Function_Reference/wp_get_attachment_image_src and it’s something they need to fix on their end.
Cheers!
PeterDecember 10, 2013 at 4:59 pm #198592I already did. Hope they solve it!
Cheers!
Edit: Replies was closed, but the Automattic people have replied me. Here’s their reply just for you guys to see :
Unfortunately, it’s a problem with how the Enfold theme is set up in that it requires width and height for every image. The Masonry plugin is compatible with Jetpack as a number of my colleagues use it on their own sites and report no problems with Photon conflicting.
With Photon, we remove the width and height arguments to prevent your images from skewing when the resized image doesn’t have the same dimensions as the original. This is particularly important when you switch from one theme to another, and the new theme is narrower than the previous theme. One of the benefits of Photon is that it will automatically resize your images so they don’t exceed the width supported by your theme. This means, though, that we don’t know what the new dimensions are.
Since the Enfold theme requires height/width settings in images, you wouldn’t be able to use Photon with that theme. Since Tiled Galleries also rely on Photon, you would not be able to use that module either. Here’s a reference that will walk you through enabling or disabling those modules:
http://jetpack.me/support/activate-and-deactivate-modules/I hope that clarifies things! Let us know if we can help with anything related to the Jetpack plugin in the future!
Cheers!
Carolyn S.
Happiness Engineer | Automattic | WordPress.com- This reply was modified 11 years ago by odac25thka.
December 10, 2013 at 5:02 pm #198595Glad Peter could help and hopefully it gets fixed based on the report :)
I’ll close this topic for now but let us know if you have any other issues or questions.
-
AuthorPosts
- The topic ‘Masonry – Warning: Division by Zero.’ is closed to new replies.