Skip to content
This repository has been archived by the owner on Oct 10, 2019. It is now read-only.

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

Closed
mcous opened this issue Apr 24, 2018 · 1 comment
Closed
Labels

Comments

@mcous
Copy link
Owner

mcous commented Apr 24, 2018

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 #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 #22)

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

1 participant