diff --git a/src/main/java/com/j256/simplemagic/ContentType.java b/src/main/java/com/j256/simplemagic/ContentType.java index 1b42869..e9077fa 100644 --- a/src/main/java/com/j256/simplemagic/ContentType.java +++ b/src/main/java/com/j256/simplemagic/ContentType.java @@ -879,6 +879,7 @@ public enum ContentType { SMV("video/x-smv", "smv", "smv"), ICE("x-conference/x-cooltalk", "ice", "ice"), HBS("text/x-handlebars-template", "hbs", "hbs"), + AMR("audio/amr", "amr", "amr"), /** default if no content */ EMPTY("application/octet-stream", "other"), diff --git a/src/main/javadoc/doc-files/changelog.txt b/src/main/javadoc/doc-files/changelog.txt index 59cb4db..9d2437c 100644 --- a/src/main/javadoc/doc-files/changelog.txt +++ b/src/main/javadoc/doc-files/changelog.txt @@ -1,3 +1,6 @@ +1.16: ?/??/2019 + * Added support for AMR (audio/amr) type in ContentInfo. Thanks to @ledjon. + 1.15: 2/16/2019 * Fixed a bug around the processing of offset increment. Thanks to @stokito. * Fixed a bug around unknown magic entry constant. Thanks to @stokito. diff --git a/src/main/resources/magic.gz b/src/main/resources/magic.gz index c7fa0f9..b1b3207 100644 Binary files a/src/main/resources/magic.gz and b/src/main/resources/magic.gz differ diff --git a/src/test/java/com/j256/simplemagic/ContentInfoUtilTest.java b/src/test/java/com/j256/simplemagic/ContentInfoUtilTest.java index 1263166..4f5be80 100644 --- a/src/test/java/com/j256/simplemagic/ContentInfoUtilTest.java +++ b/src/test/java/com/j256/simplemagic/ContentInfoUtilTest.java @@ -24,7 +24,6 @@ import org.easymock.EasyMock; import org.junit.BeforeClass; -import org.junit.Ignore; import org.junit.Test; public class ContentInfoUtilTest { @@ -121,6 +120,8 @@ public class ContentInfoUtilTest { true /* not handling recursion */), new FileType("/files/x.ai", ContentType.AI, "ai", "application/vnd.adobe.illustrator", "Adobe Illustrator, version 1.5", false), + new FileType("/files/x.amr", ContentType.AMR, "amr", "audio/amr", + "Adaptive Multi-Rate Codec (GSM telephony)", false), // end }; @@ -146,7 +147,6 @@ public void testSpecific() throws Exception { } @Test - @Ignore("for spot testing") public void testSpecificFileProblem() throws Exception { /* * For testing specific entries from a different magic file. diff --git a/src/test/resources/files/x.amr b/src/test/resources/files/x.amr new file mode 100644 index 0000000..3f00fa5 Binary files /dev/null and b/src/test/resources/files/x.amr differ diff --git a/src/test/resources/magic b/src/test/resources/magic index 1223b3a..e15c148 100644 --- a/src/test/resources/magic +++ b/src/test/resources/magic @@ -1941,6 +1941,7 @@ 60 string SONG SoundFX Module sound file 0 string #!AMR Adaptive Multi-Rate Codec (GSM telephony) +!:mime audio/amr 0 string SCgf SuperCollider3 Synth Definition file, >4 belong x version %d