"S.Veenhof" <[EMAIL PROTECTED]> wrote: > Dag, > > Ik probeer de file WEB-INF/config/magic.xml uit te breiden zodat bij het > uploaden ook mp3-files herkend worden en met het correcte mimetype in > MMBase terecht komen. > > Dat lukt wel voor mp3-files met daarin een ID3 tag. De detector: > > <detector> > <mimetype>audio/mpeg</mimetype> > <extension>mp3</extension> > <designation>MP</designation> > <test offset="0" type="string" comparator="=">ID3</test> > </detector> > > Maar het lukt niet om een detector te formuleren voor de overige > mp3-files, terwijl de Linux magic-file in /usr/share/magic daar wel toe > in staat is m.b.v. de volgende regel: > > 0 beshort&0xfffe =0xfffa \bMP3 > > Mijn vraag is: hoe zet ik bovenstaande check om in in een werkende > detectie in die magic.xml file van MMbase? > > Wie heeft dit al draaiend of wie weet hoe ik de detector moet opstellen > om een zo groot mogelijke verzameling mp3's te herkennen?
magic.xml is a bit hard to grasp. I think it is easiest to try to add those mp3 detectors and then test it with debug enabled on org.mmbase.util.magic. It will show what 'detectors' are used then, and if any of them is matching. Also make sure that no detector is matching but couples it to mimetype '???' (a lot of those are in magic.xml). Such detectors are actually working, but look like as if there are not, just becasue nobody ever filled a sensible mimetype/extension. If you succeed producing a better magic.xml, please post it, or otherwise sent it to a committor for that it can be checked in. Michiel -- Michiel Meeuwissen | Mediapark C101 Hilversum | +31 (0)35 6772979 | I hate computers nl_NL eo_XX en_US | mihxil' | [] () |
