digipres / sentinel

The Sentinel watches various data source and updates digipres.org
Apache License 2.0
5 stars 3 forks source link

Add File coverage to format listings #11

Open nkrabben opened 6 years ago

nkrabben commented 6 years ago

The file tool also identifies a number of formats and would be useful to have in this combined registry.

anjackson commented 6 years ago

Yes, very happy to review any pull requests to improve this. You can see the fine free file magic here: https://github.com/file/file/tree/master/magic/Magdir

It doesn't have file extensions, but it does have some MIME types, e.g. https://github.com/file/file/blob/master/magic/Magdir/pdf

anjackson commented 2 years ago

Hmm, does have some extension info, e.g.

https://github.com/file/file/blob/d3516f29966c52ebd0619839110edd6646540e0b/magic/Magdir/jpeg#L17-L21

But it looks a bit gnarly to parse. I guess look for the !:mime and then backtrack to a non-!: line and backtrack via the > to put the name together?