prusa3d / prusa3d/libbgcode

Bug in binary gcode specification, thumbnail block

Open
#41 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
G-code
Stars
73
Forks
23
PR merge metrics
No merged PRs in 30d

Description

I wrote my own binary gcode parser ThumbnailBinaryGCode.m because your sample code
core.cpp had too many dependencies for me to get it to compile. In that core.cpp, block_parameters_size() claims that the block header for a Thumbnail block is longer than the others by two sizeof(uint16_t). This matches what the thumbnail spec says, but it isn't actually true.

In reality, a thumbnail block, is the same length as all the other blocks. The following data is either a PNG file, a QOI file, or a JPG file. Following the compressed data are 4 bytes that I don't know what they are, and the next block starts after that. (both PNG and QOI start with a 4 byte magic number, then the width and height.

Since core.cpp doesn't actually try to show the thumbnail, that code doesn't detect the error.

Please correct the thumbnail spec to say that there is a single sizeof(uint16_t) parameter at the end of the block, then the uncompressed data of the thumbnail, then 4 bytes of ?what?, and then the next block.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the thumbnail section in doc/specifications.md and compare its block layout with src/LibBGCode/core/core.cpp and the linked ThumbnailBinaryGCode.m parser. Confirm how the thumbnail data and trailing four bytes are represented, then update the specification so the documented layout matches the observed format.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp
Domain
documentation
Issue type
Documentation
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
55/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.