Announcement

Collapse
No announcement yet.

Sorting Directory Files

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    no bug Sorting Directory Files

    Here is a bug in the sense of wrong algorithm for sorting.

    Let's say we have the following 3 files in a folder:

    name.jpg
    name1.jpg
    name 2.jpg

    If we sort them by Name we get this order:

    name 2.jpg
    name.jpg
    name1.jpg

    I marked in red the file that is wrong sorted by name. This should be always the first because it is the shortest in the sequence starting with 'name' and there are no more letters after the 4th (in my example) to compare with.

    So please correct it. Thanks.

    PS In Total Commander sorting by name is correct, that's how I observed this bug.
    Last edited by masster; 11.12.2012, 12:56 AM.

    #2
    What Total Commander does is irrelevant — IrfanView will sort the same way as Windows Explorer which is:

    a.png
    name1.png
    name 2.png
    name.png
    z.png

    If we sort by name (logical order) or XP order we get the same result which is:

    a.png
    name1.png
    name 2.png
    name.png
    z.png

    If we add a jpg file into the mix we get:


    a.png
    name1.png
    name 2.png
    name.jpg
    name.png
    z.png

    If using sort by name in IrfanView we get:
    a.png
    name 2.png
    name.jpg
    name.png
    name1.png
    z.png

    The name with the space is moved up the list because the algorithm includes the period and the extension — space (code-point 32) comes before period (46), and period (46) comes before 1 (49).

    So, this is not a bug in IrfanView. Report it to Microsoft if you want, but I doubt if it will be changed for Windows after all these years, and Irfan Skiljan is unlikely to change the order unless Microsoft do.

    I have no time to discuss it further — perhaps other forum members want to waste their time so I will leave the thread open. Probably there are some who use Total Commander, but what would discussing it here achieve? Microsoft are the ones who would need to be persuaded to get the sort algorithm changed.
    Before you post ... Edit your profile • IrfanView 4.67 • Windows 10 Home 19045.2486

    Irfan PaintIrfan View HelpIrfanPaint HelpRiot.dllMore SkinsFastStone CaptureUploads

    Comment


      #3
      Originally posted by Bhikkhu Pesala View Post
      If we sort by name (logical order) or XP order we get the same result which is:
      I don't remember expressing my concerns towards sorting by Name (natural/logic).
      On the other hand, an argument like "Microsoft did it like that, so we follow them" coming from an independent team of programmers, it's strange to say the least. You are not Microsoft's slaves, and Microsoft is not the fountain of wisdom. You have the freedom to create whatever sorting algorithm you find most suitable. In every programming book name.jpg can't follow name1.jpg or name 1.jpg simply because sorting is done in a comparative cycle by letter position using character codes. If a name has fewer letters, the cycle for it ends earlier, thus that name is put higher in list sorting order.

      Why don't you let Irfan Skiljan decide for himself what is best? You can't assume anything in his place.

      Comment


        #4
        I think Irfan Skiljan already decided for himself what's best, as this sorting behaviour is not new to IV 4.35.

        Would anyone else from our "independent team of programmers" care to reply to this?
        Before you post ... Edit your profile • IrfanView 4.67 • Windows 10 Home 19045.2486

        Irfan PaintIrfan View HelpIrfanPaint HelpRiot.dllMore SkinsFastStone CaptureUploads

        Comment


          #5
          It seems you don't understand what is the role of a moderator.
          You were not given this position to make sarcastic jokes or impose your point of view.
          Why do you keep pressuring things?
          Give people time to read this topic. Not everybody watches the forum daily. Why such hurry? Let them express opinions based on pertinent arguments, not on assumptions or pretexts pointing to third parties.
          Let people DEBATE, that is a forum for. You behave like it is closing time in a pub.
          Ok, we know your position, we know you read Irfan's mind, we know you want a status quo. That's enough. Let other people talk too.

          Comment


            #6
            It has been like this as long as I can remember, and at least since IV 3.97, so I think someone might have reported it as a bug before now.

            Forward your bug report to Irfan Skiljan, and tell us what he says.
            Before you post ... Edit your profile • IrfanView 4.67 • Windows 10 Home 19045.2486

            Irfan PaintIrfan View HelpIrfanPaint HelpRiot.dllMore SkinsFastStone CaptureUploads

            Comment

            Working...
            X