|
16 | 16 | */ |
17 | 17 | package org.apache.tika.mime; |
18 | 18 |
|
| 19 | +import static java.nio.charset.StandardCharsets.US_ASCII; |
19 | 20 | import static java.nio.charset.StandardCharsets.UTF_16BE; |
20 | 21 | import static java.nio.charset.StandardCharsets.UTF_16LE; |
21 | 22 | import static java.nio.charset.StandardCharsets.UTF_8; |
@@ -894,7 +895,17 @@ public void testRawDetection() throws Exception { |
894 | 895 | assertTypeByName("image/x-raw-minolta", "x.mrw"); |
895 | 896 | assertTypeByName("image/x-raw-nikon", "x.nef"); |
896 | 897 | assertTypeByName("image/x-raw-nikon", "x.nrw"); |
| 898 | + assertTypeByName("image/x-raw-samsung", "x.srw"); |
| 899 | + //MimeTypes alone sees a TIFF; RawTiffDetector tells the raw formats apart, |
| 900 | + //see TestContainerAwareDetector |
897 | 901 | assertTypeByData("image/tiff", "testNEF.nef"); |
| 902 | + //formats with a fixed signature (TIKA-4861) |
| 903 | + assertTypeByData("image/x-raw-fuji", "FUJIFILMCCD-RAW 0201FF393103".getBytes(US_ASCII)); |
| 904 | + assertTypeByData("image/x-raw-panasonic", new byte[]{'I', 'I', 'U', 0, 0x18, 0, 0, 0}); |
| 905 | + assertTypeByData("image/x-raw-minolta", new byte[]{0, 'M', 'R', 'M', 0, 0, 0, 0}); |
| 906 | + assertTypeByData("image/x-raw-olympus", new byte[]{'I', 'I', 'R', 'O', 8, 0, 0, 0}); |
| 907 | + assertTypeByData("image/x-raw-olympus", new byte[]{'I', 'I', 'R', 'S', 8, 0, 0, 0}); |
| 908 | + assertTypeByData("image/x-raw-olympus", new byte[]{'M', 'M', 'O', 'R', 0, 0, 0, 8}); |
898 | 909 | assertTypeByNameAndData("image/x-raw-nikon", "testNEF.nef"); |
899 | 910 | assertTypeByData("image/tiff", "testARW.arw"); |
900 | 911 | assertTypeByNameAndData("image/x-raw-sony", "testARW.arw"); |
|
0 commit comments