robrotheram / gogallery

Static Site generator but for images. Its like Hugo but for large photo galleries

Home Page:https://gallery.exceptionerror.io

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

clarification on what is displayed on the home

gurugeek opened this issue Β· comments

First of all thanks for this wonderful gallery πŸ‘ it is really useful and simple!
I have just started using it today and I am not sure how the photos displayed on the home are set. I was thinking that it will shows all photos from all albums but somehow it now displays only the photos from one of my two albums. Is there a limit of photos displayed on the home or how does it work by default?

Hi thanks for trying it out.
It should show all images that the gallery has found and display them in reverse chronological order I.E with the newest first.
The time is found by looking at the DateTime exif parameter.

The results are paginated showing 50 images at a time as you scroll the js (Masonry infinite scroll lib )
will load the next page of images. You should see the url change from / to /1 /2 etc for each page.
you can see the code that does this here https://github.com/robrotheram/gogallery/blob/master/web/ui.go#L236
There should be no limit. My gallery has 30+ folders and a total of 800+ images.

To check to see if its a js issue or the server you can do view-source:URL/NUMBER
and change the number and you should see different html containing images.

Another note. Currently the gallery does not detect new images added if you have new images added you will need to restart it for it to detect the new images. I am hoping to fix this at some point

hi and thank you for your prompt reply! Interesting..I must have done something wrong because the infinite load doesn't seem to work see https://1.1.photo I wonder if by changing the style I removed something necessary to work properly?

No worries about the restart. I figured that out and I also think the DB files have to be removed in some cases e.g. if an album is removed.

you are correct you do need to delete the db files if you remove the album.
A just checked your site. (liking the barcode image πŸ˜ƒ ) Looks like it is a js issue since i can get to https://1.1.photo/1 to see the other images

I just tested it and its a bug in the pagination code. The backend code assumes that you start counting at 0 while js starts at 1. meaning that in the homepage you miss a whole page of images.

thanks a lot for checking it out ! is it something I changed or you mean a bug somewhere in the js library? Is the version on your site different? I have been very careful in changing the design and some fonts. It was almost surgical :)

No its a bug in the backend code where I take the whole list of images and spilt them in pages of 50 images for the js library. I assume the JS will start at 0 the same as the backend but it starts at 1 so its one out. I fixing the backend code now.

I noticed the same problem in my own site. I just mist it due to the number of images I have, my gallery fills around 10 pages so never noticed that I was a page out

That should now fix that issue you were seeing. I tested it with the same number of image you have 50 in one folder and 3 in the other.

this is wonderful thank you !! it seems fixed and is live on https://1.1.photo only one further question: after loading all pics (as it is in my case) shouldn't it show all photos loaded? it seems that it attempts to load more (with the 3 dots) but as there isn't any it just keeps showing the 3 dots if you scroll down. Thank you again for fixing this bug πŸ‘ the infinite scroll is certainly very useful and cool

I think the problem is that the JS does not know when all images have been loaded, so it will try and load the next page when you scroll down. It will then fail I will look into under a different ticket