diff --git a/README.md b/README.md index ff5f0dd..8fc531c 100644 --- a/README.md +++ b/README.md @@ -496,6 +496,8 @@ identification. ### Presentation +- Corel Presentations (SHW) +- Corel Presentations 7 (SHW) - Microsoft PowerPoint Presentation (PPT) - Office Open XML Presentation (PPTX) - OpenDocument Presentation (ODP) @@ -503,6 +505,7 @@ identification. - StarImpress (SDD) - Sun XML Impress (SXI) - Sun XML Impress Template (STI) +- WordPerfect Presentations (SHW) ### ROM diff --git a/fixtures/presentation/sample1.shw b/fixtures/presentation/sample1.shw new file mode 100644 index 0000000..e51981c Binary files /dev/null and b/fixtures/presentation/sample1.shw differ diff --git a/fixtures/presentation/sample2.shw b/fixtures/presentation/sample2.shw new file mode 100644 index 0000000..69873bb Binary files /dev/null and b/fixtures/presentation/sample2.shw differ diff --git a/fixtures/presentation/sample3.shw b/fixtures/presentation/sample3.shw new file mode 100644 index 0000000..dde1f3f Binary files /dev/null and b/fixtures/presentation/sample3.shw differ diff --git a/src/formats.rs b/src/formats.rs index 1b40168..f2e323e 100644 --- a/src/formats.rs +++ b/src/formats.rs @@ -543,6 +543,20 @@ formats! { extension = "cfb" kind = Other + format = CorelPresentations + name = "Corel Presentations" + short_name = "SHW" + media_type = "application/x-corelpresentations" + extension = "shw" + kind = Presentation + + format = CorelPresentations7 + name = "Corel Presentations 7" + short_name = "SHW" + media_type = "application/x-corelpresentations" + extension = "shw" + kind = Presentation + format = Cpio name = "cpio" media_type = "application/x-cpio" @@ -2858,6 +2872,13 @@ formats! { extension = "wpm" kind = Other + format = WordperfectPresentations + name = "WordPerfect Presentations" + short_name = "SHW" + media_type = "application/vnd.wordperfect" + extension = "shw" + kind = Presentation + format = XPixmap name = "X PixMap" short_name = "XPM" diff --git a/src/lib.rs b/src/lib.rs index dfbfe9a..8b36d7f 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -67,6 +67,7 @@ identification. * [Autodesk Inventor Drawing (IDW)](`FileFormat::AutodeskInventorDrawing`) * [Autodesk Inventor Part (IPT)](`FileFormat::AutodeskInventorPart`) * [Autodesk Inventor Presentation (IPN)](`FileFormat::AutodeskInventorPresentation`) + * [Corel Presentations 7 (SHW)](`FileFormat::CorelPresentations7`) * [Microsoft Excel Spreadsheet (XLS)](`FileFormat::MicrosoftExcelSpreadsheet`) * [Microsoft PowerPoint Presentation (PPT)](`FileFormat::MicrosoftPowerpointPresentation`) * [Microsoft Project Plan (MPP)](`FileFormat::MicrosoftProjectPlan`) diff --git a/src/readers.rs b/src/readers.rs index fe17f09..87506b8 100644 --- a/src/readers.rs +++ b/src/readers.rs @@ -189,6 +189,7 @@ impl crate::FileFormat { "bbf9fdf1-52dc-11d0-8c04-0800090be8ec" => Self::AutodeskInventorDrawing, "4d29b490-49b2-11d0-93c3-7e0706000000" => Self::AutodeskInventorPart, "76283a80-50dd-11d3-a7e3-00c04f79d7bc" => Self::AutodeskInventorPresentation, + "402efe62-1999-101b-99ae-04021c007002" => Self::CorelPresentations7, "00020810-0000-0000-c000-000000000046" => Self::MicrosoftExcelSpreadsheet, "00020820-0000-0000-c000-000000000046" => Self::MicrosoftExcelSpreadsheet, "00044851-0000-0000-c000-000000000046" => Self::MicrosoftPowerpointPresentation, diff --git a/src/signatures.rs b/src/signatures.rs index fac942c..801d335 100644 --- a/src/signatures.rs +++ b/src/signatures.rs @@ -877,6 +877,10 @@ signatures! { format = Bzip3 value = b"BZ3v1" + format = CorelPresentations + value = b"\xFFWPC", b"\x0F" offset = 9 + value = b"\xFFWPC", b"\x10" offset = 9 + format = EmbeddedOpentype value = b"\x00\x00\x01" offset = 8, b"LP" offset = 34 value = b"\x01\x00\x02" offset = 8, b"LP" offset = 34 @@ -972,6 +976,9 @@ signatures! { value = b"KDMV\x02" value = b"KDMV\x03" + format = WordperfectPresentations + value = b"\xFFWPC", b"\x0A" offset = 9 + // 4 bytes format = AdaptableScalableTextureCompression value = b"\x13\xAB\xA1\x5C" diff --git a/tests/presentation.rs b/tests/presentation.rs index e4089bd..fdde02b 100644 --- a/tests/presentation.rs +++ b/tests/presentation.rs @@ -1,6 +1,18 @@ -#[cfg(any(feature = "reader-cfb", feature = "reader-zip"))] use file_format::FileFormat; +#[test] +fn test_corel_presentations() { + let fmt = FileFormat::from_file("fixtures/presentation/sample1.shw").unwrap(); + assert_eq!(fmt, FileFormat::CorelPresentations); +} + +#[cfg(feature = "reader-cfb")] +#[test] +fn test_corel_presentations7() { + let fmt = FileFormat::from_file("fixtures/presentation/sample2.shw").unwrap(); + assert_eq!(fmt, FileFormat::CorelPresentations7); +} + #[cfg(feature = "reader-cfb")] #[test] fn test_microsoft_powerpoint_presentation() { @@ -49,3 +61,9 @@ fn test_sun_xml_impress_template() { let fmt = FileFormat::from_file("fixtures/presentation/sample.sti").unwrap(); assert_eq!(fmt, FileFormat::SunXmlImpressTemplate); } + +#[test] +fn test_wordperfect_presentations() { + let fmt = FileFormat::from_file("fixtures/presentation/sample3.shw").unwrap(); + assert_eq!(fmt, FileFormat::WordperfectPresentations); +}