GithubHelp home page GithubHelp logo

Comments (4)

asmigala avatar asmigala commented on July 2, 2024

In fact, why do we have a separate method for sorting filenames at all? Isn't simply sorting them in a lexicographic order enough? While that wouldn't work when the numbers are not zero-padded (such as file_1.jpg to file_10.jpg), I think that's very rare and easily correctable with some shell scripting.

Also, I believe there is a bug in the code where filenames such as file-01_0001.jpg, file-01_0002.jpeg won't be correctly sorted. That would also be fixed with lexicographic sort.

from apriltools.

thegoodhen avatar thegoodhen commented on July 2, 2024

You are correct; I was trying to catch the edge case you mentioned, while creating a bug for the other edge case. I believe that the correct approach would be to parse the number from the filename from the end to the start, possibly ending when the number is too large (6 digits?). This approach would cover both edge cases mentioned while still working for other cases.

from apriltools.

asmigala avatar asmigala commented on July 2, 2024

The simplest solution to me is simply assuming zero-padded frame numbers, I believe that's what most video software does.

from apriltools.

thegoodhen avatar thegoodhen commented on July 2, 2024

You are probably right. I am about to leave home soon, but I'll reimplement the sorting shortly.

from apriltools.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.