7939 Posts in 1472 Topics by 944 members
Page: 1 2
|Go to End||Next >|
3 March 2010 at 9:53am
You might already be aware of this, but Chrome has a...ahem...wonderful little bug in it that causes it to time out on some image-heavy sites, thus only partially downloading the images.
My issue is that my site has large enough image galleries (and images) that it's triggering this timeout (and I get an endless loading overlay). I noticed when looking at the rendered code that the page renders all of the images, even if they're not all visible.
What I was thinking was a way to sort of "optimize" the loading time for the galleries by, perhaps, only rendering the visible ones. However, I don't know if that's even possible, and since you seem to be more familiar with image galleries in general, I was wondering if you'd have some insight into that. I'm thinking it'd be on the PHP end, where it only retrieves the X set of images, though I'm not seeing anything obvious in your code for getting the images and putting them in the generated list. Also, if I understand how SilverStripe handles images and thumbnails (the _resampled folder), the thumbnails are already generated, as I loaded up the galleries in a different browser, first. So, unless SS rebuilds the thumbnails every time, the hangup shouldn't be in that generation sequence.
I understand that this solution would result in longer load times between gallery pages, but it would lower the initial load time and (theoretically) allow visitors using Chrome to load the galleries at all.
So, would that be possible (at least with Image_Gallery/SS)? If so, which function is controlling that? If not, do you suppose there's another way I could work around Chrome's bug?
3 March 2010 at 10:59am
Yeah, I was opposed to adding this in, but people really liked that you could paginate past the current page in the lightbox.
I don't think we need some heroic effort of programming to change the presentation, though. Just override the GalleryUI_layout.ss so exclude the PreviousGalleryItems and NextGalleryItems.
<% if GalleryItems %>
<ul class="gallery-layout" id="gallery-list">
<% control GalleryItems %>
<% end_control %>
<% end_if %>
3 March 2010 at 11:21am
Would that still keep the pagination? I do like the ability to only display a select number of images, as it cleans up the page and makes it look more professional (especially on galleries with 80 images).
3 March 2010 at 2:54pm
Yeah, pagination shouldn't be affected.
4 March 2010 at 4:53am
Okay, this is dumb... Chrome still won't load the image gallery images, even if I set it to only show one image per page after the template change you suggested. It's odd, too, because it loads the auto-generated image lists on the static site (simple PHP function that gets all the images from a given folder and loads them into a list), and that doesn't have pagination at all, so all 70+ images are loaded into the page and are visible. What makes it even more strange is that I have a jQuery carousel on the front page that has about a dozen images (image size range is roughly 150kb, currently hard-coded into the template for time's sake) that it loads just fine.
4 March 2010 at 5:03am
Have you confirmed that there's only one image in your source code? Did the template change work?
4 March 2010 at 5:19am
After a little coaxing with Chrome, I was able to get it to see that the template change worked (it works in Firefox, confirmed by Firebug), but Chrome still won't load the image. It just sits with the endlessly spinning loading gear. Chrome's developer tools shows that it downloads the image, but it doesn't seem to get rid of the loading gear in place of the images.
Perhaps it's that layering? I'm grasping at straws here, at the moment. I figure maybe if I get rid of the loading overlay, it might remedy the issue (worth a shot, at least).
4 March 2010 at 6:36am
Check JS errors.
Page: 1 2
|Go to Top||Next >|