<html>
<head>
<base href="https://bugs.documentfoundation.org/">
</head>
<body>
<p>
<div>
<b><a class="bz_bug_link
bz_status_UNCONFIRMED "
title="UNCONFIRMED - inconsistent behavior when opening odt vs. docx"
href="https://bugs.documentfoundation.org/show_bug.cgi?id=127226#c2">Comment # 2</a>
on <a class="bz_bug_link
bz_status_UNCONFIRMED "
title="UNCONFIRMED - inconsistent behavior when opening odt vs. docx"
href="https://bugs.documentfoundation.org/show_bug.cgi?id=127226">bug 127226</a>
from <span class="vcard"><a class="email" href="mailto:quikee@gmail.com" title="Tomaz Vajngerl <quikee@gmail.com>"> <span class="fn">Tomaz Vajngerl</span></a>
</span></b>
<pre>The problem is that OOXML/MOX files can't be detected with examining magic
bytes like for example ODF file can (that's why it is required mimetype file
with appropriate content is at first place in the zip file). So when this
detection fails we rely on the extension (I'm not completely sure what the
detection does).
To solve this issue we need to detect the type by checking the actual content:
- check if it is a zip
- if yes, check if it contains a file [Content-Types].xml,
- if yes, we know it's a OOXML file but not which type, so parse the xml file
to determine the type.
This is far from a simple detection so we need to do it when magic detection
fails. The trick is that we can easily detect it is a zip file and know it's
not a ODF file just by looking at the magic bytes.
As for the extension - yes, we should probably warn that the file doesn't use
the correct extension.</pre>
</div>
</p>
<hr>
<span>You are receiving this mail because:</span>
<ul>
<li>You are the assignee for the bug.</li>
</ul>
</body>
</html>