thibaud-rohmer / PhotoShow

A free web gallery in PHP with drag-n-drop support
http://www.photoshow-gallery.com
502 stars 151 forks source link

Preload next image before showing in slideshow plus delay config #360

Open bufemc opened 6 years ago

bufemc commented 6 years ago

In image.php it seems you can disable to generate an image with "_small" suffix all the time, before viewing it, that saves hdd health and even time, as the thumbnail generation is not the fastest. Should be configurable in admin, or is there a config flag? For a quick fix edit image.php:

    public function __construct($file=NULL, $forcebig = true){

However, whether $forcebig is true or false, in slideshow you see between images sometimes a black screen or you see the new image while it is still loaded. In former times you just preloaded the image2 while showing image1 in e.g. div with display:none and then switched the divs - maybe even wait for the event that it has loaded completely, before switching to next image.

This should also be configurable IMHO in admin: in slideshow.js, I decreased from 7 to 3 seconds:

function start_slideshow(){ 
    slideshow_status = 1;
    timer = setInterval('run_slideshow()', 3000);

The thumbnail generation seems also to block quite often everything else, I guess because it checks all the time if all folders have been generated already. I would maybe use the session or whatever and save a flag "all done", so I don't need to crawl all the time through all sub folders etc. And for the folder itself, maybe just check if the first and the last file of the folder has been generated as thumbnail, instead to check all files, if this is the case. But I am only guessing what the reasons could be.