On Friday 24 August 2007, Alexander Larsson wrote:
> 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)
Right. Well it doesn't seem to inherit from it right now, so this bug should be
fixed, see attachment.
> 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.
I see.
Interesting, I hadn't noticed that freedesktop.xml already comes with
"conflicting extensions",
i.e. multiple mimetypes associated to the same extension. Which proves that we
-have- to
define rules for how to handle this in any case :)
> Both of these rules makes sense to me, and should be applied when there
> is a conflict.
Agreed.
> 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.
I agree. My unit test for the *.doc conflict-resolving shows that "*.doc" should
be added to the glob patterns for text/plain, for instance.
Do you have access for making changes to the specification and to the
shared-mime database, btw? (I don't)
--
David Faure, [EMAIL PROTECTED], sponsored by Trolltech to work on KDE,
Konqueror (http://www.konqueror.org), and KOffice (http://www.koffice.org).
--- freedesktop.org.xml.in.orig2 2007-09-17 21:45:21.000000000 +0200
+++ freedesktop.org.xml.in 2007-09-17 21:54:59.000000000 +0200
@@ -394,7 +394,8 @@ command to generate the output files.
<glob pattern="*.xps"/>
</mime-type>
<mime-type type="application/msword">
- <_comment>Word document</_comment>
+ <sub-class-of type="application/x-ole-storage"/>
+ <_comment>Word document</_comment>
<magic priority="50">
<match type="string" value="\x31\xbe\x00\x00" offset="0"/>
<match type="string" value="PO^Q`" offset="0"/>
_______________________________________________
xdg mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/xdg