Conflicting mime types

Thomas Kluyver thomas at kluyver.me.uk
Tue Mar 5 05:28:15 PST 2013


On 5 March 2013 12:41, Jerome Leclanche <adys.wh at gmail.com> wrote:

>  - PNG is a massively popular file format, who the hell thought this was a
> good idea?


Seconded ;-)

Bastien:
> Your implementation returns results differently from the one we use in
> shared-mime-info itself.

Looking at the implementation in PyXDG, it's quite a long way from the
recommended checking order in the spec. I'll have to sort that out properly
when I've got time, but for now it should be improved by making the first
suffix from the globs file win, not the last one (they're sorted by
decreasing weight).

Jerome:
> I think resulting behaviour should be the same as what you would do when
getting two conflicting, same-priority magics. The spec doesn't seem to
advocate a behaviour in this case[1]. In general, if there are conflicts,
they should be solved using the priority attribute at the package level.

In the file structure, the priority attribute is a property of the magic
matching rule, not of the mimetype. The description in the spec, on the
other hand, seems to be relevant to the Mimetype overall: "Low numbers
should be used for more generic types (such as 'gzip compressed data') and
higher values for specific subtypes (such as a word processor format that
happens to use gzip to compress the file)."

So does it make sense to use this even when we're not using the magic
matching rules?

Thanks,
Thomas
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/xdg/attachments/20130305/59e637b3/attachment.html>


More information about the xdg mailing list