Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Officefile detection support #17

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open

Officefile detection support #17

wants to merge 2 commits into from

Conversation

Qnerd
Copy link
Contributor

@Qnerd Qnerd commented Dec 18, 2013

Detection of Office-Files based on this article:
http://serverfault.com/questions/338087/making-libmagic-file-detect-docx-files/377792#377792

Some functions may be improved and the mimetypes are hardcoded atm (should be moved to magic.xml?).

@arimus
Copy link
Owner

arimus commented Dec 31, 2013

It looks like the tests aren't passing on this quite yet. I'm getting this on the Excel file test:


Test set: net.sf.jmimemagic.MagicTest

Tests run: 26, Failures: 1, Errors: 0, Skipped: 0, Time elapsed: 0.658 sec <<< FAILURE!
testXlsx(net.sf.jmimemagic.MagicTest) Time elapsed: 0.006 sec <<< FAILURE!
junit.framework.AssertionFailedError: error in testXlsx(). message: expected:<...spreadsheetml.shee...> but was:<...wordprocessingml.documen...>
at junit.framework.Assert.fail(Assert.java:47)
at net.sf.jmimemagic.MagicTest.testXlsx(MagicTest.java:564)

@Qnerd
Copy link
Contributor Author

Qnerd commented Jan 9, 2014

It seems that this modification clashes with an other "Office-Document"-Recognition change.

The problem with the actual solution is, that an file extension is needed.

I need to get the right match from an byte-array, so there is no extension available. In that case, the library only matches the content as a zip file.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants