Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Gerber file starting with newline incorrectly identified as drill file #307

Open
mcous opened this issue Oct 10, 2019 · 0 comments
Open
Labels
bug gerber-parser Tickets for the gerber-parser package v5-fixed Ticket is resolved in the `v5` branch

Comments

@mcous
Copy link
Member

mcous commented Oct 10, 2019

Ticket taking over for mcous/gerber-parser#23

The file determination routine is pretty naive, basically saying "if I see an * it's a gerber, but if I see a \n first it's a drill". This is a problem because it's perfectly valid for a gerber file to be padded with newlines at the beginning, but gerber-parser will detect a drill file instead.

A file should probably only be called a drill upon the first newline encountered on a non-blank line. Also related, the discussion in mcous/gerber-parser#16 talked about potential problems with the drill/gerber filetype detection (which are no longer potential).

As a workaround, passing the option filetype: 'gerber' will force the parser to parse as a gerber, unless you're trying to use parser.parseSync because of another bug (see mcous/gerber-parser#22)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug gerber-parser Tickets for the gerber-parser package v5-fixed Ticket is resolved in the `v5` branch
Projects
None yet
Development

No branches or pull requests

1 participant