jmimemagic icon indicating copy to clipboard operation
jmimemagic copied to clipboard

svg mime type not found

Open JoachimR opened this issue 9 years ago • 0 comments

 <dependency>
            <groupId>jmimemagic</groupId>
            <artifactId>jmimemagic</artifactId>
            <version>0.1.2</version>
</dependency>
public String getMimeType(byte[] file) throws Exception {
        MagicMatch match = Magic.getMagicMatch(file);
        return match.getMimeType();
}
public void testContentTypeFind() throws Exception {
        TestCase.assertEquals(
                "image/svg+xml",
                getMimeType(filenameToByteArray("public/assets/svg/avatar-1.svg"))
        );
}

Expected :image/svg+xml Actual :text/plain

JoachimR avatar Oct 17 '15 08:10 JoachimR