The simpler media website CMS
Hello everyone,
I am diving into Zenphoto to organize my ever growing photo collection & I would love some advice from those who have been at it for a while. I have got thousands of images family photos, travel shot & a fair amount of random snaps that I have just dumped into folders over the years. Sorting it all has become a bit overwhelming.
What are some of the best ways you have found to organize big libraries with Zenphoto?? Do you use certain album structures or naming conventions that work well?
Also i have check this article and resorse; https://forum.zenphoto.org/discussion/6427/file-size-limit-for-some-featuressf-architecturewitch is good still need your advice
Thank you in advance.
Comments
Zenphoto is file system based which means every album is a physical folder on your server. There is no recommended "structure" for organisation. The only limit is the power (and space) of your server. If you run into issues it is mostly that. You need to test a little.
The topic you referenced is pretty old but generally still applies. Here some recommended reads:
https://www.zenphoto.org/news/caching/
https://www.zenphoto.org/news/working-with-albums-and-images/
https://www.zenphoto.org/news/problems-with-albums-and-images/
https://www.zenphoto.org/news/zenphoto-image-metadata-processing/
There are many ways to do it, but as someone that has used Zenphoto since close to the beginning and has a site with thousands of files, this is what works for me…
First, if you can, setup a local testing server using something like MAMP (which is what the devs here use) or whatever works for you (WAMPServer, XAMPP). This will help you iron out the kinks of your site before uploading to a live server, and will run many times faster with more memory than most shared servers out there (this will come in handy when we talk about caching).
One of the biggest things you can do to help with managing and finding images in a large collection is to properly add as much correct metadata as you can. This will help before you even get into Zenphoto. I use Adobe Lightroom, but there are many free image tools out there that you can use instead (digiKam and XnViewMP both have lots of options). By adding metadata like titles, descriptions, geotagging, and tagging people before you add the images to Zenphoto, you will have images that are truly portable, that you can use in anything else. If you were to add all of that metadata in Zenphoto, and move them with an FTP program to another folder location, you could lose everything you added in Zenphoto (I will suggest something later that can help).
As acrylian said, Zenphoto is file-based, so organize and name your folders and files for what works for you. I will say that you should name all of your folders with basic characters and no spaces. You don’t have to do that, but it will make your life A LOT easier if you do with links, SEO, and Zenphoto. If you don’t want to deal with it, there is a seo_cleanup extension. I just didn’t like all of the changes it made when I tried it, and there is no undo, which is a real drag on a large collection.
This is what I settled on for my folder structure. Almost everything is first broken up by year. So in the albums folder, you’ll find-
2024
Inside that, I have folders that start with the date, then name, so- 3-15_Las_Vegas_trip
I start with the date, that way the folders are organize that way be default in Zenphoto. I don’t have to manually adjust the order on anything. I do, however, have to clean up the title names for the folders in Zenphoto admin, adding the spaces back to make them presentable.
Next, when I export the images from Lightroom, I start all of the images with the full date, then I have it add the sequential order, then the title I added in the metadata. So-
2024-3-15_001_Arriving.jpg
2024-3-15_002_Checking_out_hotel_room.jpg
Again, this way the images are always in the order I want them to be by default in Zenphoto. I don’t have to manually adjust any order. On top of that, if I’ve added titles to all of the images in metadata, Zenphoto will use that as the displayed headline instead of the filename. So they’ll just see on the pages-
Arriving
Checking out hotel room
For any changes I make in Zenphoto, like adding custom titles and descriptions to folders, I like using the xmpMetadata extension to export the changes to an XMP file and then download that file back locally. That way I have a backup to the changes, and the folders become portable outside that install of Zenphoto. So I can move the folders by FTP or to another server, and not lose the changes I’ve made.
One of the big issues I have with Zenphoto is that by default it does not cache any images until a user loads a page. So what it means in practice, especially if you are loading a large collection at once, is that it is trying to generate every sized image on the fly. Depending on the theme and extensions used- thumbnails, image page images, map thumbnails (if using a map extension), OpenGraph images and thumbnails if using the html_meta extension, plus different admin images for albums and image order. On a typical shared server, this can lock your site up, cause it to crash, or at best, make it super slow to navigate until all pages have been loaded.
You can use the cacheManager extension, but even then, I’ve had many problems getting it to cache all the images correctly. I strongly suggest for a large collection looking into the new smartImageCache extension. If you can, I also suggest running it locally, and then copying the cached images to your server. This will get around many of the limits put on your average shared hosting plan.
Good luck!
Thanks @J_C. It's always good to hear from someone running a large gallery.
Yes, true generally but if we would do pre-caching on backend upload with all registered sizes automaically you would get the same problems if you upload lots of images at the same time. Image processing is just a heavy server task especially if the images are large dimension wise.
Not to speak of direct FTP uploads which always would bypass anything and still require later caching or the on the fly default.
As you said "a typical shared server" might or will have problems. I strongely recommend to choose a proper webhost plan matching in power if you plan to run a really huge gallery. The server is really the general bottleneck most of the times.
It would be nice if there was an option to run cacheManager on new uploads instead of expecting admins to manually run it, or maybe even better, would be to set cacheManager as a cron job that could run at non-peak times to check for new files that might have also been uploaded by FTP. As it is, users to your website have albums and random image pages that load super slow for the first time, though they have no idea why, and which can turn them away from visiting your site. Also search engines and OpenGraph previews for pages that have not been cached at least once will instead index image processor links like
zp-core/i.php?a=
instead of the eventual cached images that they should.We do think about things like cronhandling. Currently we don't have a proper facility for that but there are things being reworked in the future that hopefully allow this (also for sitemaps). We also think of image generation on upload. As usual all takes some time…
Well, most sites I create with ZP are more portfolio type sites where this all is really not a problem so far. On huge sites I know it might or is an issue.
You surely know that you can setup your robots.txt to prevent indexing query urls like i.php? ones?
I’m aware that you can disallow query urls in your robots.txt file. I suspect, however, that new Zenphoto users will not realize that is something they might want to consider; especially since it is not included in the installation guide. Also, it does not solve the other issue of social media links not loading an image unless they have been pre-cached when dealing with Open Graph images.
og:image
andtwitter:image
will try to use the image processor links instead of an actual image if everything is not fully cached, causing the preview images not to load.Facebook suggests-
Facebook wants you to pre-cache everything by running it through their debugger, I'm just not sure how practical that is, especially on a large site. Or that everything will always be fully pre-cached in Zenphoto.
I have experienced this issue of images not loading in the past, and I know other people have as well over the years-
1.4.10: Possible bug with og:image in html_meta_tags.php?
html_meta_tags, og:image
I’m glad to hear that sitemaps are being thought of to be automated in the future. I always thought it was odd that new RSS links are generated automatically when media is added, but sitemaps are not. I know that sitemaps are much larger, but they have never taken that long to generate manually on my site. I also found it strange that backups are automated, but cacheManager is not.
Thanks again for your continued help and for the new 1.6.5 update!
For reasons like the opengraph issue the cacheManager exists. If you really upload lots of images at the time this is really needed. Not so much for smaller sites.
Zenphoto uses a differentt concept than other systems that use a predefined set of image sizes (like WP where you always have to regenerate everything if you dare to change or add a size). We are a lot more flexible than those as they are genereted. But it comes with disadvantages as mentioned.
The reason for this is that RSS contains limited contents while sitemaps have to be processed for the whole site and also dividided into sub sitemaps especially on larger sites. We once had a dynamic link for them similar to RSS ones but that caused lots of processing issues on servers again.