Member
Member
gracestanat   2008-09-29, 02:58
#1

I've found a few posts, but they seem quite dated now. Can somebody tell me if there is any standard preloading that happens in ZenPhoto? Or should I be putting the printPreloadScript on my image pages?

On that subject, would it be better to simply use getNextImageURL and set it's display:none? That way, the preload wouldn't be dependent on Javascript.

Lastly, is there a standard way to load the next, say, 3 images instead of just the next one?

Thanks in advance for any input.

Administrator
Administrator
acrylian   2008-09-29, 09:23
#2

Zenphoto does not preload by default, since it follows the concept of "lazy evaluation", which means images are loaded when requested. (preloading can cause overhead on slower computers with slowers connections/servers.)

There is no way to do that without the javascript you mentioned. Also there are lots of other js solutions out there you could try to adapt.

Developer
Developer
trisweb   2008-09-29, 17:49
#3

The printPreloadScript is just an example, for the most part. Your way would work just as well. You can load the image with 1x1 pixel size too, and then display:none of course.

If you want the next three, load the next three. Look at the way printPreloadScript works to see how.

Member
Member
gracestanat   2008-09-29, 20:27
#4

okay - thanks!

but i'm confused. am i correct that the method i'm suggesting does indeed accomplish the preload without Javascript? It's a minor issue; just curious. Thanks.

Member
Member
jlang   2008-09-30, 15:02
#5

It's been working fine like that for me since I did my own theme years ago. I've been meaning to merge the playing with js I did into the active theme, but I'm still using the naive code which loads a hidden image (at the bottom). Even this amount of "magic" preloading really makes browsing the gallery quite fast as going to the next/previous image means usually only the image.php needs to be loaded.

At the end of image.php, I just have the following ("hidden" is a CSS class for display:noone)...
`

`

Member
Member
gracestanat   2008-11-25, 00:30
#6

yep, sounds good. I've decided that i will load all of the following on every page:
-the next two pics
-the previous pic
-all the thumbs for the album (since i display all the image thumbs via rollover on every image page)

it's working pretty well now i think.

Member
Member
no64   2008-12-19, 12:12
#7

jlang,

if I trying your code I get an Error: "call to undefined function...."

gracestanat how did you make it?

Administrator
Administrator
acrylian   2008-12-19, 14:00
#8

There are just typos in his code it'sif(hasNextImage()/hasPrevImage().

Member
Member
Herr   2011-03-02, 18:25
#9

`

`

This code works for getting the prev/next fullsize-image. Any one, how to get de DefaultSizedImage?

Administrator
Administrator
acrylian   2011-03-02, 19:30
#10

See the documentation of the image class.

Member
Member
Herr   2011-03-05, 21:51
#11

thank you.

  
Powered By MyBB, © 2002-2026 MyBB Group.
Made with by Curves UI.