Bug 103448 - LibreOffice installs bad mimetype info for *.wps/*.wpt files
Summary: LibreOffice installs bad mimetype info for *.wps/*.wpt files
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: filters and storage (show other bugs)
Version:
(earliest affected)
5.2.2.2 release
Hardware: All All
: medium normal
Assignee: David Tardon
URL:
Whiteboard: target:5.3.0
Keywords:
Depends on:
Blocks:
 
Reported: 2016-10-24 07:01 UTC by Friedrich
Modified: 2017-01-19 21:30 UTC (History)
5 users (show)

See Also:
Crash report or crash signature:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Friedrich 2016-10-24 07:01:29 UTC
/usr/share/mime/packages/libreoffice.xml registers <glob pattern="*.wpt"/> for
<mime-type type="application/vnd.ms-word.template.macroenabled.12"> and <glob pattern="*.wps"/> for "<mime-type type="application/msword">.
which seems a result of https://gerrit.libreoffice.org/#/c/23037/

Which results in shadowing the info for MS Works files from freedesktop.org's shared-mime-info and thus in the filemanager displaying all my old MS Works files as MS Word ones and also offering the wrong handlers for it.

Are Kingsoft's formats really the same as the Microsoft ones? At least Kingsoft themselves claim the formats are a different one. So registering *.wps & *.wpt with the MS Word mimetypes is even wrong then.

Please create separate mimetype entries for the Kingsoft files (given they seem not yet registered with iana.org/assignments/media-types/ perhaps some application/x-whatever-seems-sane-or-used), best also register them with https://freedesktop.org/wiki/Software/shared-mime-info/
Even better would be to contact the Kingsoft developers and ask to register their mimetypes officially with IANA.

The current approach in libreoffice.xml is a nice hack to register LibreOffice as handler for those files, but is awful for everyone else relying on the mimetype database :)
Comment 1 Julien Nabet 2016-10-24 07:27:40 UTC
Jaskaran/Caolán: Thought you might be interested in this one.
Comment 2 David Tardon 2016-10-24 12:47:08 UTC
(In reply to Friedrich from comment #0)
> /usr/share/mime/packages/libreoffice.xml registers <glob pattern="*.wpt"/>
> for
> <mime-type type="application/vnd.ms-word.template.macroenabled.12"> and
> <glob pattern="*.wps"/> for "<mime-type type="application/msword">.
> which seems a result of https://gerrit.libreoffice.org/#/c/23037/
> 
> Which results in shadowing the info for MS Works files from
> freedesktop.org's shared-mime-info and thus in the filemanager displaying
> all my old MS Works files as MS Word ones and also offering the wrong
> handlers for it.
> 
> Are Kingsoft's formats really the same as the Microsoft ones?

They can be opened as Microsoft ones anyway. I've no idea if they contain any extensions compared to the Microsoft ones.

> At least
> Kingsoft themselves claim the formats are a different one.

Where?

> Please create separate mimetype entries for the Kingsoft files (given they
> seem not yet registered with iana.org/assignments/media-types/ perhaps some
> application/x-whatever-seems-sane-or-used), best also register them with
> https://freedesktop.org/wiki/Software/shared-mime-info/
> Even better would be to contact the Kingsoft developers and ask to register
> their mimetypes officially with IANA.
> 
> The current approach in libreoffice.xml is a nice hack to register
> LibreOffice as handler for those files, but is awful for everyone else
> relying on the mimetype database :)

Hm, but even if we do this, it won't really change anything, will it? The libreoffice-specific patterns will still shadow the system ones; the only difference is that MS Works files will be identified as WPS Spredsheet, not MS Word... Or do I miss someting?
Comment 3 David Tardon 2016-10-24 12:49:30 UTC
As an aside, one thing that we should definitely do is to clean up the internal MIME types. Many of them have been in shared-mime-info for ages, so there's no need to duplicate them on our side.
Comment 4 David Tardon 2016-10-24 16:35:07 UTC
On second thought: let's remove these patterns. We don't have custom MIME type entries for any other format we support which is not in shared-mime-info (or was only added there relatively recently). And I don't see why WPS Office should be an exception to that...
Comment 5 Commit Notification 2016-10-25 07:03:52 UTC
David Tardon committed a patch related to this issue.
It has been pushed to "master":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=b1686f6cf1a52d53b46f1483e8a79dda0ccea797

tdf#103448 remove WPS Office exts. from MIME types

It will be available in 5.3.0.

The patch should be included in the daily builds available at
http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
http://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.