Skip to content

Commit 9b49eec

Browse files
committed
Add XBM decoder
1 parent f95d040 commit 9b49eec

18 files changed

+582
-4
lines changed

.github/workflows/rust.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ jobs:
1414
strategy:
1515
fail-fast: false
1616
matrix:
17-
features: ['', default, rayon, avif, bmp, dds, exr, ff, gif, hdr, ico, jpeg, png, pnm, qoi, tga, tiff, webp]
17+
features: ['', default, rayon, avif, bmp, dds, exr, ff, gif, hdr, ico, jpeg, png, pnm, qoi, tga, tiff, webp, xbm]
1818
steps:
1919
- uses: actions/checkout@v4
2020
- uses: dtolnay/rust-toolchain@stable

Cargo.toml

+1
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,7 @@ qoi = ["dep:qoi"]
8383
tga = []
8484
tiff = ["dep:tiff"]
8585
webp = ["dep:image-webp"]
86+
xbm = []
8687

8788
# Other features
8889
rayon = ["dep:rayon", "ravif?/threading"] # Enables multi-threading

README.md

+2
Original file line numberDiff line numberDiff line change
@@ -59,8 +59,10 @@ image format encoders and decoders.
5959
| TGA | Yes | Yes |
6060
| TIFF | Yes | Yes |
6161
| WebP | Yes | Yes (lossless only) |
62+
| XBM | Yes \*\* | --- |
6263

6364
- \* Requires the `avif-native` feature, uses the libdav1d C library.
65+
- \*\* `XBM` is disabled by default and requires the `xbm` feature.
6466

6567
## Image Types
6668

fuzz/Cargo.toml

+5
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ cargo-fuzz = true
1111

1212
[dependencies.image]
1313
path = ".."
14+
features = ["xbm"]
1415
[dependencies.libfuzzer-sys]
1516
version = "0.3"
1617

@@ -66,6 +67,10 @@ path = "fuzzers/fuzzer_script_hdr.rs"
6667
name = "fuzzer_script_exr"
6768
path = "fuzzers/fuzzer_script_exr.rs"
6869

70+
[[bin]]
71+
name = "fuzzer_script_xbm"
72+
path = "fuzzers/fuzzer_script_xbm.rs"
73+
6974
[[bin]]
7075
name = "roundtrip_webp"
7176
path = "fuzzers/roundtrip_webp.rs"

fuzz/fuzzers/fuzzer_script_xbm.rs

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
#![no_main]
2+
#[macro_use] extern crate libfuzzer_sys;
3+
extern crate image;
4+
5+
fuzz_target!(|data: &[u8]| {
6+
let _ = image::load_from_memory_with_format(data, image::ImageFormat::Xbm);
7+
});

0 commit comments

Comments
 (0)