commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jörg Schaible <>
Subject RE: JMimeMagic (was [fileUpload] file content-type)
Date Wed, 19 Apr 2006 06:45:53 GMT
Hi Markus,

Markus Härnvi wrote on Wednesday, April 19, 2006 8:47 AM:

> Hi!
>> Starting from scratch would be possibly the best anyway. I
> had it also on my todo list on a very low priority ... but
> just, because I found that jMimeMagic has a really worse
> implemenattion - extremly slow and not working correctly. I
> have a good pile of image files it does not detect. Main
> reason is, that the implementation is simply wrong. The
> original magic files have a clear idea of precedence of
> patterns - this has been lost completely in the
> conversion/implementation of jMimeMagic.
>> - Jörg
> Using the original magic file and parse it in Java also makes
> it easier
> to keep it updated. Just add the newest magic file to the jar
> file and
> we are done.

That would have been my approach also. I was just not sure, whether we should bundle the magic
file or try to locate it (this is the interesting part and highly system dependent). And a
user might have an additional magic file in its home - at least this can be located.

> I have a (pretty C-like) Python port of file(1). Maybe that can be of
> some help, implementing it in Java. I don't know about the license of
> that code though. 
> The C implementation can be found here:
> The meat is in softmagic.c.  It under a BSD license.

If we bundle the magic file, we must take care of that file's license only. For a port I don't
think that the license of the code is of any interest (unless it is published under a disclosure

- Jörg

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message