Shared-mime checking order

Alexander Larsson alexl at redhat.com
Fri Aug 24 07:28:03 PDT 2007


On Fri, 2007-08-24 at 16:11 +0200, David Faure wrote:

> We could do the same with *.pdf which could be application/pdf or 
> application/pdf+gz : sniffing would tell us if it's pdf or gzip...
> 
> Hmm and what I described as "unlikely" above is what happens for *.ogg files, 
> if we make their magic low-prio again. The above spec addition would allow to 
> do ogg-related magic only on *.ogg files, not on every file.

Hmm. Aren't these two different cases?

One case is:
 extension matches: text/plain, application/msword
 sniffed type: application/x-ole-storage

One of the matched extensions is a subclass of the sniffed type, so we
pick that one. (i.e. application/msword inherits from
application/x-ole-storage)

The other case is:
 extension mapped: all the *.ogg types
 sniffed type: a specific ogg type

Here the sniffed type is equal to one of the the matched extension
types, so we pick that one.

Both of these rules makes sense to me, and should be applied when there
is a conflict. 

We should also make sure that we add all possible conflicting extension
matches to the database. For instace, if we add "*.pdf" to
application/x-gzpdf then we could use sniffing to resolve which one it
is. 




More information about the xdg mailing list