![]() |
|
Sort by file name - Printable Version +- ZenphotoCMS Forum (https://forum.zenphoto.org) +-- Forum: Support (https://forum.zenphoto.org/forum-1.html) +--- Forum: General support (https://forum.zenphoto.org/forum-4.html) +--- Thread: Sort by file name (/thread-10673.html) |
Sort by file name - astepanyan - 2012-12-25 I am new to Zenphoto and still trying to figure out how to configure it. What I noticed is that sorting by file name produces unexpected results. I have 3 files in an album. When I sort them by filename in descending order I get: When I sort by file name in ascending order I get: Apparently sorting does work (since the order changes), but my guess it works in Windows 7 fashion, where it converts names to numbers first. As you can tell my files have year number in front and all I want to do is to sort them chronologically. Since a lot of my files are scans and do not have EXIF time stamps I tried to manage it through file names and when I run ls command on the server they do come up in the right order. Is there a way to configure sorting to compare file name literally? Sort by file name - sbillard - 2012-12-25 The sort is what is called a "natural" sort. Most people expect numbers to appear in order before letters. (I think this is not unique to Windows 7!) While it would be possible for you to get a different order (a pure ascii search seems what you wish) it will take a large amount of work. You will have to replace the Even then you will have other problems. For instance, pagination would have to be custom coded as well. A really better approach would be to name your images in a way that gives you the order you want in the first place since you are doing that anyway. (e.g. be consistent in the number of digits you use.) Alternatively would be to set the date via an EXIF editor or the Zenphoto back-end and then use the date itself. |