diff --git a/lib/marcel/tables.rb b/lib/marcel/tables.rb index bcc7622..774ce5c 100644 --- a/lib/marcel/tables.rb +++ b/lib/marcel/tables.rb @@ -1873,7 +1873,7 @@ module Marcel 'application/x-pkcs7-certreqresp' => %w(p7r), 'application/x-project' => %w(mpx), 'application/x-prt' => %w(prt), - 'application/x-quattro-pro' => %w(wq1 wq2 wkq qpw wb1 wb2 wb3), # Quattro Pro - Corel Spreadsheet (part of WordPerfect Office suite) + 'application/x-quattro-pro' => %w(wq1 wq2 wkq qpw wb1 wb2 wb3), # Quattro Pro - Corel Spreadsheet (part of WordPerfect Office suite) 'application/x-quattro-pro;version=1+5' => %w(wb1), # Quattro Pro for Windows, version 1, 5 'application/x-quattro-pro;version=1-4' => %w(wq1 wkq), # Quattro Pro for DOS, version 1-4 'application/x-quattro-pro;version=5' => %w(wq2 wkq), # Quattro Pro for DOS, version 5 @@ -2047,7 +2047,7 @@ module Marcel 'image/x-dpx' => %w(dpx), # Digital Picture Exchange from SMPTE 'image/x-emf-compressed' => %w(emz), # Compressed Enhanced Metafile 'image/x-freehand' => %w(fh fhc fh4 fh40 fh5 fh50 fh7 fh8 fh9 fh10 fh11 fh12 ft7 ft8 ft9 ft10 ft11 ft12), # FreeHand image - 'image/x-jbig2' => %w(jb2 jbig2), # A lossless image compression standard from the Joint Bi-level Image Experts Group. + 'image/x-jbig2' => %w(jb2 jbig2), # A lossless image compression standard from the Joint Bi-level Image Experts Group. 'image/x-jp2-codestream' => %w(j2c), # JPEG 2000 Codestream 'image/x-pict' => %w(pic pct pict), # Apple Macintosh QuickDraw/PICT Format 'image/x-portable-anymap' => %w(pnm), # Portable Any Map @@ -2514,6 +2514,7 @@ module Marcel ['image/jpeg', [[0, b["\377\330\377"]]]], ['image/png', [[0, b["\211PNG\r\n\032\n"]]]], ['image/gif', [[0, b['GIF87a']], [0, b['GIF89a']]]], + ['image/x-raw-sony', [[0, b["II*\000"], [[0..4096, b['SONY']]]], [0, b["MM\000*"], [[0..4096, b['SONY']]]]]], ['image/tiff', [[0, b["MM\000*"]], [0, b["II*\000"]], [0, b["MM\000+"]]]], ['image/bmp', [[0, b['BM'], [[26, b["\001\000"], [[28, b["\000\000"]], [28, b["\001\000"]], [28, b["\004\000"]], [28, b["\b\000"]], [28, b["\020\000"]], [28, b["\030\000"]], [28, b[" \000"]]]]]]]], ['image/vnd.adobe.photoshop', [[0, b["8BPS\000\001"]], [0, b["8BPS\000\002"]]]], diff --git a/test/fixtures/magic/image/x-raw-sony/arw.arw b/test/fixtures/magic/image/x-raw-sony/arw.arw new file mode 100644 index 0000000..b9ce8ea Binary files /dev/null and b/test/fixtures/magic/image/x-raw-sony/arw.arw differ diff --git a/test/fixtures/name/image/x-raw-sony/arw.arw b/test/fixtures/name/image/x-raw-sony/arw.arw index bae24c9..b9ce8ea 100644 Binary files a/test/fixtures/name/image/x-raw-sony/arw.arw and b/test/fixtures/name/image/x-raw-sony/arw.arw differ diff --git a/test/magic_test.rb b/test/magic_test.rb index 14d11e2..e758361 100644 --- a/test/magic_test.rb +++ b/test/magic_test.rb @@ -7,7 +7,8 @@ class Marcel::MimeType::MagicTest < Marcel::TestCase # be recognised by magic alone; their name is also needed to correctly identify them. each_content_type_fixture('magic') do |file, name, content_type| test "gets type for #{content_type} by using only magic bytes #{name}" do - assert_equal content_type, Marcel::MimeType.for(file) + actual_type = Marcel::MimeType.for(file) + assert_equal content_type, actual_type, "Expected #{file} to be #{content_type}, but was #{actual_type}" end end