What determines order of ID creation?

I know that when uploading files, which ever file happens to make it into the gallery first gets the lowest ID. What about when unzipping a whole album's worth of images (via FTP and then unzipping via shell connection)? Does it see the files via filename, date, or what criteria to determine which file it sees first?

Unless I am missing something, is there a way (using Jquery) to do the uploads 1 file at a time in the order they are shown?

Generally it's not that big a deal since you can sort the albums by whatever but there are times I want to control the of files it sees.

Mark H.


  • acrylian Administrator, Developer
    The ID is the order of discovery from the file system. I don't know how Gallery does it, but Zenphoto is entirely file system based. If you uploads folders with images or folders directly via FTP and once visiting the first time they are recognized and added.

    If you remove them via FTP Zenphoto will remove them as soon as the album is visited. Both counts for front and back end.

    Some info on the caching and discovery process:
  • MarkRH Member
    Yeah, Gallery had an option in the batch upload window to upload one file at a time or X number at the same time. Hmm an idea. I'll use my FTP client and set it to single connection only and ftp them one at a time to server to see if that will do what I want.

    Hmmm.. not really. The ID it creates for the images seems fairly random. Not really by filename or modified date. Anyway, been up too long. I may go look around in the code for my own curiosity to see how/when it creates the IDs. It was just weird seeing the RSS feed with images with names like "XYZ Photo #1", "XYZ Photo #2" and so on being out of order when using the ID.

    For this gallery it's all kind of moot since I won't really be doing anymore batch uploads. Mostly the next one I need to do with its 1000+ images. I'm probably making a mountain out of mole hill anyway. LOL
  • acrylian Administrator, Developer
    To discover the images and albums Zenphoto needs to be visited. So even if you upload image 1 first via ftp but you first visit image 2 on the backend or someone on the front end, image 2 will have the lower id.

    RSS feeds can be change to sort by something else than ID, too. Either by calling a specific feed or changing the option defaults.
  • MarkRH Member
    Yeah, I tried doing it by date, but that doesn't really work since I uploaded a new image I found that I took back in the 90s and it didn't show in the feed because it was much older date wise (Exif info)... so I put the RSS feed back on ID. Filemtime might work.

    But, after I get back to just doing my normal operation then it won't really matter as the ID will work fine because I typically look at the image right after I upload it anyway. Gallery, would process the image right after it was uploaded. I'm probably the only one that subscribes to it anyway so it's all a silly discussion most likely LOL. Anyway, still nice to know how it does things. Thanks for the info.
Sign In or Register to comment.