diff --git a/CHANGELOG.md b/CHANGELOG.md index 82948ed..40f02ca 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,10 @@ - Improve ZIP reader performance and precision when using `reader-zip` feature - Reduce PDF reader memory usage and increase accuracy when using `reader-pdf` feature +## New formats support + +- Picture Exchange (PCX) + # Version 0.22.0 (2023-11-04) ## Internal changes diff --git a/README.md b/README.md index ecca213..94f4d4f 100644 --- a/README.md +++ b/README.md @@ -359,6 +359,7 @@ file-format = "0.23" - OpenEXR (EXR) - OpenRaster (ORA) - Panasonic Raw (RW2) +- Picture Exchange (PCX) - Portable Arbitrary Map (PAM) - Portable BitMap (PBM) - Portable FloatMap (PFM) diff --git a/fixtures/image/sample.pcx b/fixtures/image/sample.pcx new file mode 100644 index 0000000..902b90d Binary files /dev/null and b/fixtures/image/sample.pcx differ diff --git a/src/formats.rs b/src/formats.rs index 9ad6be0..e14b29d 100644 --- a/src/formats.rs +++ b/src/formats.rs @@ -1958,6 +1958,13 @@ formats! { extension = "asc" kind = Application + format = PictureExchange + name = "Picture Exchange" + short_name = "PCX" + media_type = "image/x-pcx" + extension = "pcx" + kind = Image + format = PlainText name = "Plain Text" short_name = "TXT" diff --git a/src/signatures.rs b/src/signatures.rs index fa9ab3c..8c57823 100644 --- a/src/signatures.rs +++ b/src/signatures.rs @@ -1157,6 +1157,18 @@ signatures! { format = PersonalStorageTable value = b"!BDN" + format = PictureExchange + value = b"\x0A\x00\x00", b"\x00" offset = 64 + value = b"\x0A\x00\x01", b"\x00" offset = 64 + value = b"\x0A\x02\x00", b"\x00" offset = 64 + value = b"\x0A\x02\x01", b"\x00" offset = 64 + value = b"\x0A\x03\x00", b"\x00" offset = 64 + value = b"\x0A\x03\x01", b"\x00" offset = 64 + value = b"\x0A\x04\x00", b"\x00" offset = 64 + value = b"\x0A\x04\x01", b"\x00" offset = 64 + value = b"\x0A\x05\x00", b"\x00" offset = 64 + value = b"\x0A\x05\x01", b"\x00" offset = 64 + format = QemuCopyOnWrite value = b"QFI\xFB" diff --git a/tests/image.rs b/tests/image.rs index 3d60866..b253d15 100644 --- a/tests/image.rs +++ b/tests/image.rs @@ -253,6 +253,12 @@ fn test_panasonic_raw() { assert_eq!(fmt, FileFormat::PanasonicRaw); } +#[test] +fn test_picture_exchange() { + let fmt = FileFormat::from_file("fixtures/image/sample.pcx").unwrap(); + assert_eq!(fmt, FileFormat::PictureExchange); +} + #[test] fn test_portable_arbitrary_map() { let fmt = FileFormat::from_file("fixtures/image/sample.pam").unwrap();