← Back to team overview

kicad-developers team mailing list archive

Re: [PATCH] Add mime package for gerber and excellon files

 

Le 31/05/2016 à 18:43, José Ignacio a écrit :
> I just copied the definition from the gEDA project. It does match all
> the gerber files i've generated or have in my possession, they usually
> start with a comment. If we go by official standards, the IANA
> registered mime type for gerber files is application/vnd.gerber
> assigned only to the .gbr extension[1]. I used application/x-gerber
> and that definition to be more useful (match all gerber files
> regardless of extension) and play nice with gEDA.

Yes, .gbr is the official extension.
But G04 is the beginning of a comment.
A Gerber file can start by many others strings (often by %).
Many Gerber files have no comment or do not start by a comment.

In X2 mode, a Gerber file created by Kicad starts by %.TF (%.TF is a file function specification)

Sorry, but expecting G04 as first line of a Gerber file is a mistake.


> 
> [1]: http://www.iana.org/assignments/media-types/application/vnd.gerber
> 
> On Tue, May 31, 2016 at 11:35 AM, jp charras <jp.charras@xxxxxxxxxx> wrote:
>> Le 31/05/2016 à 18:13, José Ignacio Romero a écrit :
>>> ---
>>>  resources/linux/mime/mime/packages/kicad-gerbers.xml | 19 +++++++++++++++++++
>>>  1 file changed, 19 insertions(+)
>>>  create mode 100644 resources/linux/mime/mime/packages/kicad-gerbers.xml
>>>
>>>
>>
>> Hi, José.
>>
>> In your patch, what is the usefulness of the line:
>> "+      <match value="G04" type="string" offset="0"/>"
>>
>> Gerber files (even created by Kicad) do not start always by G04 (G04 is just starting a comment, not
>> a Gerber file).
>> There is not specific header in a Gerber file.
>>
>> Thanks.
>>
>> --
>> Jean-Pierre CHARRAS
>>
>> _______________________________________________
>> Mailing list: https://launchpad.net/~kicad-developers
>> Post to     : kicad-developers@xxxxxxxxxxxxxxxxxxx
>> Unsubscribe : https://launchpad.net/~kicad-developers
>> More help   : https://help.launchpad.net/ListHelp
> 


-- 
Jean-Pierre CHARRAS


References