Coder Social home page Coder Social logo

Comments (6)

jneilliii avatar jneilliii commented on May 29, 2024 1

I probably need to come up with another parsing routine since it currently uses a regular expression match against the whole file contents. That's really overkill since the thumbnails are currently stored right at the very beginning of the file.

from octoprint-prusaslicerthumbnails.

erezge avatar erezge commented on May 29, 2024

This has to do with a change I requested in order to support also thumbnails in Cura which end with CRLF instead of LF like PrusaSlicer does.
After looking for a possible solution to remove the need for the replace I came up with this solution:
Replace :
regex = r"(?:^; thumbnail begin \d+x\d+ \d+)(?:\n|\r\n?)((?:.+(?:\n|\r\n?))+)(?:^; thumbnail end)"
With :
regex = r"(?:^; thumbnail begin \d+x\d+ \d+)(?:\n|\r\n?)((?:[^\n\r]+(?:\n|\r\n?))+)(?:^; thumbnail end)"

This allows supporting both LF and CRLF without the replace statement. From my tests the solution seems to produce the exact same outputs.

from octoprint-prusaslicerthumbnails.

jneilliii avatar jneilliii commented on May 29, 2024

What version of octoprint?

from octoprint-prusaslicerthumbnails.

ochm avatar ochm commented on May 29, 2024

What version of octoprint?

OctoPrint 1.4.0 running on OctoPi 0.17.0

from octoprint-prusaslicerthumbnails.

jneilliii avatar jneilliii commented on May 29, 2024

I think I may have just fixed this issue with the latest release. Please check it out and let me know, version 0..1.1. You may have to force a check in the bottom of Software Update in the Advanced section at the bottom..

from octoprint-prusaslicerthumbnails.

ochm avatar ochm commented on May 29, 2024

Perfect! 0.1.1 renders the big gcode file without issue. Thank you!

from octoprint-prusaslicerthumbnails.

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.