Skip to content

Commit

Permalink
Add XBM decoder
Browse files Browse the repository at this point in the history
  • Loading branch information
mstoeckl committed Feb 2, 2025
1 parent f95d040 commit 9b49eec
Show file tree
Hide file tree
Showing 18 changed files with 582 additions and 4 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/rust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
strategy:
fail-fast: false
matrix:
features: ['', default, rayon, avif, bmp, dds, exr, ff, gif, hdr, ico, jpeg, png, pnm, qoi, tga, tiff, webp]
features: ['', default, rayon, avif, bmp, dds, exr, ff, gif, hdr, ico, jpeg, png, pnm, qoi, tga, tiff, webp, xbm]
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
Expand Down
1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@ qoi = ["dep:qoi"]
tga = []
tiff = ["dep:tiff"]
webp = ["dep:image-webp"]
xbm = []

# Other features
rayon = ["dep:rayon", "ravif?/threading"] # Enables multi-threading
Expand Down
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,10 @@ image format encoders and decoders.
| TGA | Yes | Yes |
| TIFF | Yes | Yes |
| WebP | Yes | Yes (lossless only) |
| XBM | Yes \*\* | --- |

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

## Image Types

Expand Down
5 changes: 5 additions & 0 deletions fuzz/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ cargo-fuzz = true

[dependencies.image]
path = ".."
features = ["xbm"]
[dependencies.libfuzzer-sys]
version = "0.3"

Expand Down Expand Up @@ -66,6 +67,10 @@ path = "fuzzers/fuzzer_script_hdr.rs"
name = "fuzzer_script_exr"
path = "fuzzers/fuzzer_script_exr.rs"

[[bin]]
name = "fuzzer_script_xbm"
path = "fuzzers/fuzzer_script_xbm.rs"

[[bin]]
name = "roundtrip_webp"
path = "fuzzers/roundtrip_webp.rs"
7 changes: 7 additions & 0 deletions fuzz/fuzzers/fuzzer_script_xbm.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#![no_main]
#[macro_use] extern crate libfuzzer_sys;
extern crate image;

fuzz_target!(|data: &[u8]| {
let _ = image::load_from_memory_with_format(data, image::ImageFormat::Xbm);
});
Loading

0 comments on commit 9b49eec

Please sign in to comment.