When I use printLatestImagesByMtime a lot of images are missing.
I have 1 album, sorted by Mtime.
<?php printLatestImagesByMtime ("27"); ?> doesn't look the same as the first page of my album, a lot of images are missing. When I uploaded 9 photo's only 4 appeared in the printLatestImagesByMtime function.
When I sort my album by ID and use printLatestImages I also don't get the same output. A few images have swapped places.
I use 1.4.0.4.
Comments
Second, did you chekc if maybe some images are unpublished or protected. Then they won't appear.
Third, please try the 1.4.1 beta nightly build to see if the issue appears there as well.
No unpublished or protected images.
I tried the nightly, problem still there.
I have the printLatestImagesByMtime on the index and only 1 album with 270 photo's, the album is sorted by Mtime configured in the gallery options.
The first 27 images from printLatestImagesByMtime are not the same as the album, a lot of them are missing.
When I use printLatestImages instead, and sort the album by ID, then sometimes the order is not the same, a few images have swapped places if you compare printLatestImages with the album.
Pretty weird huh?
They are all displayed in the album on the first row.
1 2 3 4 5 6 7 8 9
In printLatestImagesByMtime only 5 new images appeared.
2 1 3 6 8 (in that order)
So not only 4 images are missing, but also 2 have swapped places.
All images are now appearing in the function, but the order is not the same as the album.
Album
1 2 3 4 5 6 7 8 9
printLatestImagesByMtime
2 1 3 9 4 5 7 6 8
I also noticed this with printLatestImages function and sorting the album on ID.
1 - created one album with mtime decending in options->image
2 - uploaded 100 images
3 - edited the default theme with printLatestImagesByMtime(27) on the index
4 - everything looked oké, all 27 images have the same order, both in printLatestImagesByMtime as the album
5 - uploaded 9 new images
6 - the order between the first 9 images of printLatestImagesByMtime was not the same as the album
7 - uploaded 9 new images
8 - first 9 images have the same order, but images 10-18 have different order, but it's also different then the order i had in (6).
9 - uploaded 9 new images
10 - all 27 have the same order
11 - uploaded 9 new images
12 - 2 of the newly uploaded images have "switched places".
It looks so random, that i'm afraid i'm doing something incredibly stupid
I also posted it in the bugtracker.
On Unix systems there is no reliabale timestamp to know when a file was created. Probably the best bet is the Zenphoto ID of the image. That at least represents when Zenphoto discovered the image.
I experienced printLatestImages and sorting by ID had the same problems, but I can't replicate it now, so sorting by ID seems to be the quick fix for me.
But it stays weird that printLatestImagesByMtime and a album sorted by mtime have a different sorting order. Especially because of the randomness I described.