• Resolved rkgneuschul

    (@rkgneuschul)


    When image file names are numbers and gallery is sorted by filename in ascending order the order displayed is NOT correct: the same applies when there are multiple files of the form “name – number.jpg”

    Image 1.jpg is shown first, Image 10.jpg is shown second, image 100.jpg is shown third: and so on. In a gallery collection of 100 or more images when managing galleries paging through to find image 37 or 49 or 74 is a pot-luck exercise – a gamble – there’s no logical ordering to it and one has no idea which page the image will be shown on.
    When one examines the page or post which holds the gallery display the same applies.

    Any normal human being interprets numbers in counting order, not some perverted programing order.

    https://ww.wp.xz.cn/plugins/nextgen-gallery/

Viewing 13 replies - 1 through 13 (of 13 total)
  • Plugin Contributor photocrati

    (@photocrati)

    @rkgneuschul – Unfortunately, using your example, the sort order is actually correct.

    • image 1.jpg
    • image 10.jpg
    • image 100.jpg
    • image 2.jpg

    The above list helps to provide a better example as in most cases a “computer” will sort going left to right when sorting a mixed character string (or file name in this case).

    You might consider changing your naming convention (and I would also strongly suggest not using spaces as well).

    Thanks!

    – Cais.

    Thread Starter rkgneuschul

    (@rkgneuschul)

    That was my point: computer ordering is not natural or lexical ordering. Which makes your reply a fairly poor one: instead of telling me to change my working practices you could try accepting and owning the problem.

    The end user requirement *always* outweighs any limitations of a programmer’s short-sighted blinkered mindset.

    Library indexing and retrieval would not work for humans if the programmers of such systems applied your methods and logic to sorting and ordering. Even Microsoft manages to get this correct within its office products, even if it still screws it up somewhat at the OS file system level.

    Much the same applies to the use of blank spaces in file names or in any lexical string sort. There are many quite well known ordering algorithms for achieving natural number ordering and lexical string ordering; try looking for them.

    If one is going to allow sorting and ordering in the first place then those functions should do what the user wants and needs, not what the machine decides, let alone what a lazy programmer cannot be bothered to make functional. This isn’t rocket science: it’s basic usability and UI good practice.

    The goal of good software production is to allow the user to do what they want and need, not what you or the program deign to permit. The sort/order functions in NGG are seriously flawed; as one simple example, it makes creating a storyboard or flipbook sequence very complex – i.e. close to impossible.

    Plugin Contributor photocrati

    (@photocrati)

    @rkgneuschul – You are always more than welcome to offer a solution as well. Please feel free to share your knowledge, experience, and expertise in creating these sorting algorithms. We will be more than happy to review your suggestion(s).

    As it is, I am only explaining what is happening, in no way was it meant to be any more than that … my apologies if you understood it to be anything more.

    Thanks!

    – Cais.

    Thread Starter rkgneuschul

    (@rkgneuschul)

    Cais

    Thanks – but I already knew all of that – if you’d paid attention you would have noticed that.
    I’ve been “in” IT for over 35 years – and “in” image handling and processing for even longer: which is precisely why I was complaining about the sort issues; because we’ve had solutions to this set of problems since the early 1960s. It’s a significant part of how financial systems and spreadsheets and databases and library retrieval systems all work – by using sorting algorithms to present information to end users in *HUMAN* terms. We’ve also had solutions to the human interface aspects of sorting for almost that long: mostly involving giving users meaningful and clear interfaces with helpful popups and explanations – and good documentation.

    The points here are relatively simple:

    1] it is not made clear that setting a default sort order in Gallery Options removes the ability to sort within each gallery’s management page; this is an illogical application of a rule: setting a default should not block case by case over-rides unless one is going to apply much more granular permissions sets to the admin UI – for example so that root or superuser or supreme master of the universe can limit *exactly* what each other class of user may or may not do within the admin UI. All a default sort rule should do is set the normal order on import and presentation and allow the end user of a gallery management page to alter that order as required on a case by case basis.
    Moving such an over-ride into the “green” control on pages/posts doesn’t help: especially when it isn’t documented that it *has* been moved.

    2] it is not made clear that the sort orders available to the end user when adding a gallery to a page/post still do not allow for natural or lexical ordering in a logical consistent and coherent manner.

    Meanwhile the available ordering options are limited.

    Custom ordering as provided in NGG is a non-starter when the target gallery contains more than a few dozen images – whilst adding new images to an existing custom sorted gallery becomes a complete nightmare since there is no way to record and preserve that ordering schema: custom ordering is in effect a one-time randomisation that isn’t preserved across the process of image addition or of any changes to gallery presentation mode – e.g. from basic thumbnail to any other gallery mode – which can be particularly problematic in a WP multi-user environment with shared galleries.

    3] the algorithms currently used for ordering are not efficient or effective.
    There are dozens of different and quite well known sort order algorithms which do a better job than those currently deployed in NGG. You invite me to contribute my expertise; my expertise says – start with the wikipedia entry on sorting of numbers and classes. Then investigate how lexical ordering works across strings with empty spaces or unicode non-alphanumeric characters. Basically, you’re not using the power of collations in SQL stores and you’re also not using SQL sorting effectively, let alone the power of your coding and scripting languages.

    Whilst NGG is an extremely powerful and generally fairly well-written and relatively robust product it suffers major flaws in the UI; not least because it is still living in the late 20th century – delivering command driven interfaces rather than task driven interfaces. The workflow to achieving a usable gallery display which meets a users’ requirements is frankly awful, and far more time consuming and complex than it needs to be.

    My expertise also says: I did offer you my expertise. You elected to trivialise that contribution.

    Oh sorry, did I just patronise you and treat what you wrote as trivial? That’s just what you did to me. Never assume the end user knows less than you do. If you don’t understand or are unsure about what they wrote then ASK them for clarification.

    Plugin Contributor photocrati

    (@photocrati)

    @rkgneuschul – Thank you very much for the additional feedback, all constructive criticisms are gladly received and read.

    In this case, as valuable as your feedback may be, it is not what I suggested you provide; but, I will definitely keep in mind when having conversations with you that everything needs to be spelled out quite clearly.

    To that end …

    Have a nice day!

    – Cais.

    @rkgneuschul – you state that;

    Even Microsoft manages to get this correct within its office products…

    As noted by Cais, the sort order is correct – a simple exercise of plugging an array of mixed character strings (such as you’re using) into Excel and then sorting them will clearly demonstrate this. So; Microsoft does get it correct. You – unfortunately – do not.

    Cais, you are an extremely polite person. Keep up the great work!

    I’m also having problems with sorting with the same problem as rkgneuschul wrote.

    We have like 50 galleries, all with over 200 images and they must be sorted as filename

    1,2,3,4… 10,11..20,22

    Please advice us how to rename filenames so we get them sorted as “human”

    Thank you

    @gregy1403, going back to Casi’s first reply, and from personal experience, if you have 3 digit file names then renaming your files so that 1 is 001, 10 is 010, and 100 is 100, and 99 is 099, then they will sort 001, 010, 099, 100. Give it a try, I know initially it will take some time but it works.

    thank your for prompt answer .. will try it and report back

    It’s not working as it should ..

    You can see filenames when you hover over the image

    ok .. got it .. had to change sorting by Image ID not filename šŸ™‚

    it works. Thank you

    @gregy1403 and @purplepix – if I can combine a reply to your collective responses – I always go with the three (or more) digit file names. We now have it!

    @rkgneuschul still doesn’t know how Excel (and computers, generally) sort(s) days of the week. No doubt we’ll be educated…

    Plugin Contributor photocrati

    (@photocrati)

    @webbo69, @gregy1403, and @purplepix – Thank you all for the additional feedback and comments.

    – Cais.

Viewing 13 replies - 1 through 13 (of 13 total)

The topic ‘Numeric Sorting is NOT natural ordering’ is closed to new replies.