icon for ms-word file *.doc is "?" instead of ooo-word

Bug #285831 reported by Thomas Thym
12
This bug affects 1 person
Affects Status Importance Assigned to Milestone
shared-mime-info
Fix Released
Medium
Fedora
Fix Released
Low
shared-mime-info (Ubuntu)
Fix Released
Medium
Unassigned
Nominated for Intrepid by mehturt

Bug Description

The mime icon for *.doc files in dolphin is "?" instead of the ms-word icon.
Temp. solution for my kubuntu 8.04, KDE 4.1.2:
Make a symmlink from application-vnd.ms-word.svgz to application-msword.svgz in /usr/lib/kde4/share/icons/oxygen/scalable (/128x128, 64x64 etc.) and run sudo touch -m /usr/lib/kde4/share/icons/default.kde4

Revision history for this message
In , Orion (orion-redhat-bugs) wrote :

Description of problem:

The .doc files on my desktop (and a newly created test user) are using a ? icon.
 No idea how this gets set or whose fault this might be. xls files are okay
(show some kind of spreadsheet icon).

Version-Release number of selected component (if applicable):
kdebase-4.0.3-6.fc9.i386

Revision history for this message
In , Rex (rex-redhat-bugs) wrote :

shared-mime-info should handle mimetypes, etc, now.

Revision history for this message
In , Rex (rex-redhat-bugs) wrote :

I take it back, you actually need an app installed that claims to be able to
handle that mimetype, that provides an icon.

Revision history for this message
In , Kevin (kevin-redhat-bugs) wrote :

So I guess KWord is only registering it with the old KDE 3 system? KOffice
probably needs to be fixed to use shared-mime-info.

Revision history for this message
In , Rex (rex-redhat-bugs) wrote :

ignore me, for now, I'll keep digging. :)

Revision history for this message
In , Orion (orion-redhat-bugs) wrote :

Should pick of OO too:

/usr/share/applications/openoffice.org-1.9-writer.desktop:
MimeType=application/vnd.oasis.opendocument.text;application/vnd.oasis.opendocument.text-template;application/vnd.oasis.opendocument.text-web;application/vnd.oasis.opendocument.text-master;application/vnd.sun.xml.writer;application/vnd.sun.xml.writer.template;application/vnd.sun.xml.writer.global;application/vnd.stardivision.writer;application/msword;application/vnd.ms-word;application/x-doc;application/rtf;application/vnd.wordperfect;application/wordperfect
Icon=openofficeorg-writer

Icons are here:
/usr/share/icons/hicolor/16x16/apps/openofficeorg-writer.png
/usr/share/icons/hicolor/32x32/apps/openofficeorg-writer.png
/usr/share/icons/hicolor/48x48/apps/openofficeorg-writer.png
/usr/share/icons/locolor/16x16/apps/openofficeorg-writer.png
/usr/share/icons/locolor/32x32/apps/openofficeorg-writer.png

Revision history for this message
In , Orion (orion-redhat-bugs) wrote :

FYI - I don't have koffice.

Revision history for this message
In , Kevin (kevin-redhat-bugs) wrote :

The file type icons don't come from the application (in other words, that
Icon=openofficeorg-writer is irrelevant). An icon matching the name of the MIME
type is searched.

Revision history for this message
In , Orion (orion-redhat-bugs) wrote :

So it should be using:

/usr/share/icons/oxygen/32x32/mimetypes/application-vnd.ms-word.png

?

Maybe a naming/alias issue:

  <mime-type type="application/msword">
    <sub-class-of type="application/x-ole-storage"/>
    <glob pattern="*.doc"/>
    <alias type="application/vnd.ms-word"/>
    <alias type="application/x-msword"/>
  </mime-type>

gnome has:

/usr/share/icons/gnome/16x16/mimetypes/gnome-mime-application-msword.png

Revision history for this message
In , Rex (rex-redhat-bugs) wrote :

I tried various things here, but couldn't get the mimetype to match/use the
icon. Something is amiss, but I think at least it's partially some goofy and/or
duplicated parts in the application/msword.xml mimetype.

Revision history for this message
In , Bug (bug-redhat-bugs) wrote :

Changing version to '9' as part of upcoming Fedora 9 GA.
More information and reason for this action is here:
http://fedoraproject.org/wiki/BugZappers/HouseKeeping

Revision history for this message
In , Steven (steven-redhat-bugs) wrote :

Is this still an issue with KDE 4.0.5?

Revision history for this message
In , Orion (orion-redhat-bugs) wrote :

(In reply to comment #11)
> Is this still an issue with KDE 4.0.5?

Yes.

Revision history for this message
In , Steven (steven-redhat-bugs) wrote :

Ping

Revision history for this message
In , Orion (orion-redhat-bugs) wrote :

I'm seeing this with KDE 4.1.2 on latest rawhide.

Revision history for this message
In , David Faure (faure) wrote :

Yes, this MSI magic is definitely wrong. I have a .dot file here (a msword template), which matches this magic. So obviously it is not specific to msi files.

Aren't msi files always called *.msi anyway? I don't think this magic is really necessary - especially if it matches non-msi files.

Revision history for this message
In , David Faure (faure) wrote :

The test suite in fdo shows the issue, btw:
test-template.dot, 'data' test: expected application/msword-template, got application/x-msi (expected failure)
test-template.dot, 'file' test: expected application/msword-template, got application/x-msi

Revision history for this message
Thomas Thym (ungethym) wrote :

The mime icon for *.doc files in dolphin is "?" instead of the ms-word icon.
Temp. solution for my kubuntu 8.04, KDE 4.1.2:
Make a symmlink from application-vnd.ms-word.svgz to application-msword.svgz in /usr/lib/kde4/share/icons/oxygen/scalable (/128x128, 64x64 etc.) and run sudo touch -m /usr/lib/kde4/share/icons/default.kde4

Revision history for this message
Harald Sitter (apachelogger) wrote :

I find it unlikely that this would help in 8.10... my findings so far:

Headers of .doc files differ a lot. Some of the doc files I got were detected as Windows Installer packages (.msi), some (e.g. exported from google docs) are correctly recognized as .docs and have the appropriate icons.

Looking at /usr/share/mime/packages/freedesktop.org.xml (which is the main mimtype definition file) .msi gets partially detected by it's hex-type header
      <match value="\xD0\xCF\x11\xE0\xA1\xB1\x1A\xE1\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x3E\x00\x03\x00\xFE\xFF\x09\x00\x06" type="string" offset="0"/>

Checking the wrong doc files in Okteta unvealed that they start with exactly the same sequence, while the ones which were detected correctly have a completely different header.

Removing the pasted string sequence from mentioned file (and rebuilding the mime caches) leads to a correct detection for all .docs I have available for testing.

So the problems appear to be:
* KDE prefers magic matches over extension matches (actually, without having read the mime spec, I would have assumed it chooses extension over magic match if not at least one magic match and the extension apply to the file ... in this case the magic string matches but the file extension does not, so it would use .doc where no magic matches but the file extension does)
* .doc files have different headers of which one is exactly the same as the one used by .msi files
* it is also possible the .msi mimetype lists a wrong magic string and thus causes the issue

On a side note: xdg-mime query filetype returns the proper mimetype for all .doc files with default freedesktop.org.xml, so if we assume xdg-mime is to be taken as reference implementation, ksycoca appears to be doing something wrong

I'll digg in the appropriate freedestop.org specification and consult with some fedora developers (in case I can get hold of one ;-) since they also have an open report about this.

Revision history for this message
Harald Sitter (apachelogger) wrote :

The spec says:
"glob elements have a pattern attribute. Any file whose name matches this pattern will be given this MIME type (subject to conflicting rules in other files, of course)."

Which I read as: FILE.DOC is always application/msword unless there is sufficient proof it is something else.

"magic elements contain a list of match elements, any of which may match, and an optional priority attribute for all of the contained rules. 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). The default priority value is 50, and the maximum is 100."

This makes me conclude: FILE.DOC is application/msword even though there is a conflicting magic match from application/x-msi, but since that one only has a default priority of 50, FILE.DOC mustn't be of application/x-msi.

Revision history for this message
Harald Sitter (apachelogger) wrote :

I guess there is just some wrong >= in the KDE source. If I lower the priority of x-msi's string match to 49 the .docs also get recognized properly.

Revision history for this message
In , David Faure (faure) wrote :

Fixed today. Fix will be in the next release (current release is still 0.51).

/cvs/mime/shared-mime-info/ChangeLog,v <-- ChangeLog
new revision: 1.512; previous revision: 1.511
/cvs/mime/shared-mime-info/freedesktop.org.xml.in,v <-- freedesktop.org.xml.in
new revision: 1.390; previous revision: 1.389
/cvs/mime/shared-mime-info/tests/list,v <-- tests/list
new revision: 1.63; previous revision: 1.62

This makes ole-storage magic work again, which triggers bug 18109 in the xdgmime code, but at least the spec is correct now for dot/doc/msi/ole-storage.

Revision history for this message
David Faure (faure) wrote :

"KDE prefers magic matches over extension matches" -- definitely not true in general. We follow the spec exactly, which says that globs (extensions) are checked first for performance reason, and that magic is only used if no extension matched, or if more than one mimetype had that extension.
And that is exactly the case here: KDE's kde.xml mimetype additions define *.doc for text/plain, because not all *.doc files are msword files. Examples from my kubuntu system:
/usr/share/doc/texlive-latex-extra-doc/latex/vhistory/README.doc
/usr/share/doc/cvs/contrib/intro.doc

So, yes, for .doc files, we have to rely on magic to determine if they are msword or plain text files.
The magic for x-ole-storage (which msword derives from) is supposed to be triggered for msword .doc files, and the code can handle that case (the matching magic from msword's parent is used to disambiguate msword from text/plain).

I see that shared-mime-info 0.50 added magic for msi files (freedesktop.org bug 16495). If you're saying that magic matches .doc files, then that magic is wrong I would think (not specific enough, just generic ole-storage magic). In that case, please consider replying to freedesktop.org bug 16495 to ask for the removal of this wrong magic. It would help if you had a sample .doc file that matched it :-) (if it's really small we could even use it for the shared-mime-info regression tests)

This would explain why lowering the prio of x-msi to 49 fixes it, btw: the magic for x-ole-storage then hits first, and the one from x-msi is out of the way.

I'm not sure why xdg-mime behaves differently though; I wonder if it implements the conflict resolution properly...

I also wonder why it works here (it's even unit tested, see kdecore/tests/kmimetypetest.cpp:332-336 or look for "IANA" if the line numbers don't match). Ah... the data in the unit test is not big enough for the msi magic to match it. I see.

Revision history for this message
David Faure (faure) wrote :
Revision history for this message
Harald Sitter (apachelogger) wrote :

Moving bug to shared-mime-info package.

Changed in kdebase-runtime:
importance: Undecided → Medium
status: New → Confirmed
Changed in shared-mime-info:
status: Unknown → Confirmed
Revision history for this message
In , Rex (rex-redhat-bugs) wrote :

It indeed was a shared-mime-info bug, fixed yesterday upstream.

Revision history for this message
In , Bastien (bastien-redhat-bugs) wrote :

(In reply to comment #15)
> It indeed was a shared-mime-info bug, fixed yesterday upstream.

Not really. The original bug is on F9, and F9 has shared-mime-info-0.30-3.fc9 which doesn't have the bug fixed yesterday.

Either reassign it to whatever KDE bit is handling the icon fetching, or mark this as an F10/rawhide bug.

Revision history for this message
In , Rex (rex-redhat-bugs) wrote :

fixed *upstream* (or so I was told by dfaure):
https://bugs.freedesktop.org/show_bug.cgi?id=18072

Changed in shared-mime-info:
status: Confirmed → Fix Released
Revision history for this message
In , Bastien (bastien-redhat-bugs) wrote :

(In reply to comment #17)
> fixed *upstream* (or so I was told by dfaure):
> https://bugs.freedesktop.org/show_bug.cgi?id=18072

I know, I'm the upstream maintainer of shared-mime-info. That doesn't answer my question though.

Revision history for this message
In , Rex (rex-redhat-bugs) wrote :

Looks like recent kde's (tested kde-4.1.85 here) workaround it, so any combination of recent kde + shared-mime-info is mmm good.

Ok, let's bounce this back to kde...

Revision history for this message
In , Steven (steven-redhat-bugs) wrote :

Ok its bounced back into our laps. What do you want to do with it?

Revision history for this message
In , Rex (rex-redhat-bugs) wrote :

It's blocking on kde42 updates. When they land, this is fixed.

Revision history for this message
In , Ngo (ngo-redhat-bugs) wrote :

i don't see this issue anymore in F10 with 4.2.0.

Revision history for this message
In , Orion (orion-redhat-bugs) wrote :

Indeed. I do still still see ? for the following:

.cert
.crt
.p12
.sxi
.sxw
.xlsx

But perhaps these are general mime issues...

Changed in shared-mime-info:
assignee: nobody → apachelogger
Revision history for this message
Jonathan Thomas (echidnaman) wrote :

Fix committed for shared-mime-info 0.52. (or whatever the next release after 0.51 is.)

Changed in shared-mime-info:
status: Confirmed → Fix Committed
Revision history for this message
In , Fedora (fedora-redhat-bugs) wrote :

kdeutils-4.2.0-1.fc10, kdetoys-4.2.0-1.fc10, kdesdk-4.2.0-1.fc10, kdeplasma-addons-4.2.0-1.fc10, kdepimlibs-4.2.0-1.fc10, kdepim-4.2.0-2.fc10, kdenetwork-4.2.0-2.fc10, kdemultimedia-4.2.0-1.fc10.1, kdegraphics-4.2.0-1.fc10, kdegames-4.2.0-1.fc10, kdeedu-4.2.0-2.fc10, kdebase-runtime-4.2.0-3.fc10, kdebase-4.2.0-2.fc10, kdebindings-4.2.0-1.fc10, kdeartwork-4.2.0-1.fc10, kdeadmin-4.2.0-1.fc10.1, kdeaccessibility-4.2.0-1.fc10, soprano-2.2.1-1.fc10, strigi-0.6.3-1.fc10, akonadi-1.1.1-1.fc10, automoc-1.0-0.11.rc3.fc10, compiz-0.7.8-7.fc10, kde-settings-4.1-5.20090126svn.fc10, kde-plasma-runcommand-1.0-1.fc10, kde-plasma-quickaccess-0.7.1-7.fc10, kdebluetooth-0.3-1.fc10, kde-i18n-3.5.10-2.fc10, krazy2-2.8-7.20090127svn.fc10, phonon-4.3.0-5.fc10, kde-l10n-4.2.0-2.fc10, kdelibs-4.2.0-7.fc10, kdebase-workspace-4.2.0-4.fc10.2 has been pushed to the Fedora 10 testing repository. If problems still persist, please make note of it in this bug report.
 If you want to test the update, you can install it with
 su -c 'yum --enablerepo=updates-testing update kdeutils kdetoys kdesdk kdeplasma-addons kdepimlibs kdepim kdenetwork kdemultimedia kdegraphics kdegames kdeedu kdebase-runtime kdebase kdebindings kdeartwork kdeadmin kdeaccessibility soprano strigi akonadi automoc compiz kde-settings kde-plasma-runcommand kde-plasma-quickaccess kdebluetooth kde-i18n krazy2 phonon kde-l10n kdelibs kdebase-workspace'. You can provide feedback for this update here: http://admin.fedoraproject.org/updates/F10/FEDORA-2009-1387

Revision history for this message
In , Fedora (fedora-redhat-bugs) wrote :

kdeutils-4.2.0-1.fc10, kdetoys-4.2.0-1.fc10, kdesdk-4.2.0-1.fc10, kdeplasma-addons-4.2.0-1.fc10, kdepimlibs-4.2.0-1.fc10, kdepim-4.2.0-2.fc10, kdenetwork-4.2.0-2.fc10, kdemultimedia-4.2.0-1.fc10.1, kdegraphics-4.2.0-1.fc10, kdegames-4.2.0-1.fc10, kdebase-runtime-4.2.0-3.fc10, kdebase-4.2.0-2.fc10, kdebindings-4.2.0-1.fc10, kdeartwork-4.2.0-1.fc10, kdeadmin-4.2.0-1.fc10.1, kdeaccessibility-4.2.0-1.fc10, soprano-2.2.1-1.fc10, strigi-0.6.3-1.fc10, akonadi-1.1.1-1.fc10, automoc-1.0-0.11.rc3.fc10, compiz-0.7.8-7.fc10, kde-settings-4.1-5.20090126svn.fc10, kde-plasma-runcommand-1.0-1.fc10, kde-plasma-quickaccess-0.7.1-7.fc10, kdebluetooth-0.3-1.fc10, kde-i18n-3.5.10-2.fc10, krazy2-2.8-7.20090127svn.fc10, phonon-4.3.0-5.fc10, kdelibs-4.2.0-9.fc10, kdeedu-4.2.0-5.fc10, kde-l10n-4.2.0-2.fc10, kdebase-workspace-4.2.0-4.fc10.2 has been pushed to the Fedora 10 testing repository. If problems still persist, please make note of it in this bug report.
 If you want to test the update, you can install it with
 su -c 'yum --enablerepo=updates-testing update kdeutils kdetoys kdesdk kdeplasma-addons kdepimlibs kdepim kdenetwork kdemultimedia kdegraphics kdegames kdebase-runtime kdebase kdebindings kdeartwork kdeadmin kdeaccessibility soprano strigi akonadi automoc compiz kde-settings kde-plasma-runcommand kde-plasma-quickaccess kdebluetooth kde-i18n krazy2 phonon kdelibs kdeedu kde-l10n kdebase-workspace'. You can provide feedback for this update here: http://admin.fedoraproject.org/updates/F10/FEDORA-2009-1387

Revision history for this message
In , Fedora (fedora-redhat-bugs) wrote :

kdeutils-4.2.0-1.fc10, kdetoys-4.2.0-1.fc10, kdesdk-4.2.0-1.fc10, kdeplasma-addons-4.2.0-1.fc10, kdepimlibs-4.2.0-1.fc10, kdepim-4.2.0-2.fc10, kdenetwork-4.2.0-2.fc10, kdemultimedia-4.2.0-1.fc10.1, kdegraphics-4.2.0-1.fc10, kdegames-4.2.0-1.fc10, kdebase-runtime-4.2.0-3.fc10, kdebase-4.2.0-2.fc10, kdebindings-4.2.0-1.fc10, kdeartwork-4.2.0-1.fc10, kdeadmin-4.2.0-1.fc10.1, kdeaccessibility-4.2.0-1.fc10, soprano-2.2.1-1.fc10, strigi-0.6.3-1.fc10, akonadi-1.1.1-1.fc10, automoc-1.0-0.11.rc3.fc10, compiz-0.7.8-7.fc10, kde-plasma-runcommand-1.0-1.fc10, kde-plasma-quickaccess-0.7.1-7.fc10, kdebluetooth-0.3-1.fc10, kde-i18n-3.5.10-2.fc10, krazy2-2.8-7.20090127svn.fc10, kde-settings-4.1-6.20090206svn.fc10, phonon-4.3.0-5.fc10, kdelibs-4.2.0-9.fc10, kdeedu-4.2.0-5.fc10, kde-l10n-4.2.0-2.fc10, kdebase-workspace-4.2.0-4.fc10.2 has been pushed to the Fedora 10 testing repository. If problems still persist, please make note of it in this bug report.
 If you want to test the update, you can install it with
 su -c 'yum --enablerepo=updates-testing update kdeutils kdetoys kdesdk kdeplasma-addons kdepimlibs kdepim kdenetwork kdemultimedia kdegraphics kdegames kdebase-runtime kdebase kdebindings kdeartwork kdeadmin kdeaccessibility soprano strigi akonadi automoc compiz kde-plasma-runcommand kde-plasma-quickaccess kdebluetooth kde-i18n krazy2 kde-settings phonon kdelibs kdeedu kde-l10n kdebase-workspace'. You can provide feedback for this update here: http://admin.fedoraproject.org/updates/F10/FEDORA-2009-1387

Revision history for this message
mehturt (mehturt) wrote :

Rox-filer has the same problem.

Revision history for this message
Jonathan Thomas (echidnaman) wrote :

The fix has been released to K/Ubuntu 9.04.

Changed in shared-mime-info:
assignee: apachelogger → nobody
status: Fix Committed → Fix Released
Changed in shared-mime-info:
importance: Unknown → Medium
Changed in shared-mime-info:
importance: Medium → Unknown
Changed in shared-mime-info:
importance: Unknown → Medium
Changed in fedora:
importance: Unknown → Low
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.