Tagged: ,

Viewing 16 posts - 1 through 16 (of 16 total)
  • Author
    Posts
  • #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!

    #198032

    I tried it on a different browser and it also appears… so I don’t think it’s a browser issue.

    #198079

    Hi!

    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,
    Devin

    #198096

    Hi 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?

    #198101

    Try 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.

    #198121

    Hi 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 :(

    #198123

    Ah, 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.

    #198130

    Thank 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.

    #198465

    Hey!

    Please create me an admin account and post the login credentials as private reply – I’ll look into it.

    Regards,
    Peter

    #198467
    This reply has been marked as private.
    #198487

    Hey!

    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,
    Peter

    #198535

    Oh 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 :)

    #198536

    Just a last note, do you think I should raise this up with the jetpack team?

    #198538

    Hey!

    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!
    Peter

    #198592

    I 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 10 years, 5 months ago by odac25thka.
    #198595

    Glad 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.

Viewing 16 posts - 1 through 16 (of 16 total)
  • The topic ‘Masonry – Warning: Division by Zero.’ is closed to new replies.