Support » Plugin: Jetpack by WordPress.com » Jetpack Tiled Mosaic Gallery not loading all images

  • Resolved Mvd

    (@micx51)


    Hi everyone,

    I have been struggling with this for a while now and finally posted it here: My site runs with Jetpack plugin enabled and I have the gallery’s display as Tiled Mosaic. Sadly enough nearly every gallery fails to load all images. There’s always some image missing and instead there is an empty space.

    I thought this had something to do with my theme using some Lightbox on the images but even when I activate the latest Twentyfourteen theme the problem persists. I re saved every post, it just doesn’t help.

    When I look in firebug there is an url to the image src element like this:

    src="http://i1.wp.com/www.mydomain.com/wp-content/uploads/..../../little-round-sidetable.jpg?resize=461%2C346

    When I manipulate some of the last digits on that url I finally get the image to show but often in wrong aspect ratio.

    Does anyone know an answer to this? It’s very annoying!

    Thanks, Mvd

    http://wordpress.org/plugins/jetpack/

Viewing 15 replies - 1 through 15 (of 40 total)
  • update:
    when I look up the image url of the missing images directly I get this message from the wp cdn:

    ‘We cannot complete this request, remote data could not be fetched’

    This is strange cause the image is in that location on my site so there must be a network problem or something..

    Thing is that it’s not a temporary thing, it happens for quite some time now.

    Could this have to do with my hosting company seeing this as hotlinking or something?

    Removed hotlinking rules in htaccess, still the problem persists!

    I tried nearly everything; wrote a plugin to rewrite the image url’s in the_content without the jetpack CDN prefix (i2.wp.com/).
    Tried javascript to rewrite the image urls on page load (body onload="" and window.onload=function...).

    Nothing helps.

    Does anyone know where the src elements for the gallery images gets prefixed with this CDN bit? And secondly where the style element of the image tag (style="") gets set? (cause that’s part of the problem, it gets set to width=0px height=0px.

    Ok, I did actually get some help on stackexchange and wrote a javascript workaround to:
    1) loose the wordpress CDN prefix i2.wp.com/ or i1.wp.com/
    2) fix the cases where the image does not apear cause it’s style is set to width:0px; height:0px;

    It’s not jQuery cause that snippet didn’t work somehow.
    Here’s the javascript, place it as the VERY LAST code in the <head> section, just before the </head> tag.
    Here’s the code:

    <script type="text/javascript">
    	function ChangeImageSrc() {
    		//tiled-gallery is the class of the container div
            var div = document.getElementsByClassName("tiled-gallery")[0];
    		// get the images inside that tiled-gallery div
            var images = div.getElementsByTagName("img");
            //loop trough the images and change the src and possibly style attribute
            for (var i = 0; i < images.length; i++) {
    			//data-orig-file is where the url of the original image is in the html
                images[i].setAttribute("src", images[i].getAttribute("data-orig-file"));
    			// set the image style if it's width is smaller than 50 (px)
    			// you can change the number
    			if (images[i].width < 50){
                images[i].setAttribute("style", "width:100%;height:100%;");
    			}
            }
        }
    
        window.onload = ChangeImageSrc;
    </script>

    note that when the style is rewritten to 100% width/height the white margins of the tiles disapears, I still have to find out how to fix that. (possibly by doing some ingenious math with the container div’s style attribute)

    Hope this helps others!

    even that code didn’t work flawlessly so I finally resorted to this codecanyon script:

    http://codecanyon.net/item/jquery-tiles-gallery/2281417

    Witch finally works as a tiled gallery should!

    Plugin Author Jeremy Herve

    (@jeherve)

    *.wp.com are WordPress.com subdomains. They’re used to serve images from our Content Delivery Network (CDN) when the Photon module or Tiled Galleries are active. Since the CDN servers are all over the world, loading time from these servers should actually be good, if not better than your own server.

    If the i2.wp.com/ or i1.wp.com/ image URLs return an error on your site, it’s most likely because there is an issue with the original image; Photon tried to download and cache it, but failed. It could be because it took more than 10 seconds to download it, or it could be because it doesn’t exist anymore.

    Could you provide me with some examples of the broken images so we can take a closer look together? You won’t need to use another Tiled Gallery plugin if we manage to solve the issue 🙂

    Hi Jeremy Herve,

    Thanks for taking interest in my problem, I appreciate it!
    Here’s a link to my site link, second page(excerpt galleries are showing with another plugin). When you go back in time (older posts) there’s pretty much on every post a gallery with one or two images missing. The problem is that I can get the images straight away with the regular url but the CDN url doesn’t work. The second problem is that the style=”width:0px;height:0px;” is written to the image inline.

    It’s a shame cause I really thought this was the coolest gallery plugin around!

    I think there must be some conflict somewhere, my theme (timeline) used some gallery function but I’ve ripped that code out.

    Hope you can find something!

    Plugin Author Jeremy Herve

    (@jeherve)

    I went back a few pages, but all images seem to be displayed properly on my end.

    Could you copy a few of the image URLs that seem broken, and paste them here so I can take a look?

    Thanks!

    Hi Jeremy, here the whole gallery doesn’t apear while it should be there. I hope it’s only a browser thing, that would be awesom, (I use Firefox but when I try Chrome I get the same result but only the images are not set to width=”0px” height=”0px”, but slightly larger sizes (but not correct still). Usually the gallery apears finally when I reload the page a couple of times but my visitors might not do that.

    If it’s related to my machine what should I do than?

    same with me, after deactivating photon in jetpack plugin its back to normal

    Plugin Author Jeremy Herve

    (@jeherve)

    The images are properly displayed on my end, but they are not aligned properly: something appears to be missing in the bottom row. It’s not a missing image though.
    http://i.wpne.ws/TEXK

    I also noticed that you are running another jQuery Tiled Gallery plugin. Could you try to deactivate it and see if it helps?

    Hi Jeremy,

    I deactivated the other tiled gallery (excerpt of gallery) plugin for the page of posts. It doesn’t change that images are missing. I also thought this might be platform related so I checked the site out on a windows laptop, same thing (except that the image dimensions -that I checked- where set right, image still missing, that’s in IE). Do you have any other ideas about this?

    Plugin Author Jeremy Herve

    (@jeherve)

    Could you try switching to one of the default themes for a few minutes, and let me know if it helps?

    Hi Jeremy, did that Switched to twentyeleven and twentyfourteen, both times the galleries got worse, more images appear missing (even ones that loaded before).

    Hi Jeremy,

    I’m out of clues and guess your are to, I’m going to resort to another plugin although I still think your tiled gallery is the best. It just doesn’t work reliably on my site somehow. A feature I would strongly recommend though is the ability to switch off the CDN if you use one yourself or don’t want to use it, I think that’s part of the problem (I know that in theory it should work better than without but it doesn’t for me..).

    Good luck with the plugin and I’ll keep an eye on it!

    Thanks for the support!

    Plugin Author Jeremy Herve

    (@jeherve)

    If the problem is not caused by your theme, it could be a conflict with another one of your plugins, or an image hotlinking protection service that could be active on your server.

    If you don’t find any plugin conflict, then I’m afraid I’m out if ideas, indeed.

Viewing 15 replies - 1 through 15 (of 40 total)
  • The topic ‘Jetpack Tiled Mosaic Gallery not loading all images’ is closed to new replies.