Skip to content

Commit 2b2db27

Browse files
committed
feat!: Remove XBM support
1 parent 3001ee5 commit 2b2db27

12 files changed

Lines changed: 7 additions & 655 deletions

File tree

BUILD.adoc

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -93,10 +93,6 @@ The man pages are generated in `docs/man/man1`.
9393

9494
Enable decoding from the WebP image. This is enabled by default.
9595

96-
`decode-from-xbm`::
97-
98-
Enable decoding from the XBM image. This is enabled by default.
99-
10096
`optimize-output-png`::
10197

10298
Enable options to optimize output PNG image. This is enabled by default.

CHANGELOG.adoc

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,10 @@ project adheres to https://semver.org/[Semantic Versioning].
2020

2121
* Bump MSRV to 1.89.0 ({pull-request-url}/954[#954])
2222

23+
=== Removed
24+
25+
* Remove XBM support ({pull-request-url}/984[#984])
26+
2327
== {compare-url}/v0.13.1\...v0.13.2[0.13.2] - 2025-12-20
2428

2529
=== Added

Cargo.lock

Lines changed: 0 additions & 10 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@ image = { version = "0.25.10", default-features = false, features = [
2828
"png",
2929
"rayon",
3030
] }
31-
image-extras = { version = "0.1.0", default-features = false, optional = true }
3231
is-svg = { version = "0.2.2", optional = true }
3332
oxipng = { version = "10.1.0", default-features = false, features = [
3433
"parallel",
@@ -60,7 +59,6 @@ default = [
6059
"decode-from-tga",
6160
"decode-from-tiff",
6261
"decode-from-webp",
63-
"decode-from-xbm",
6462
"optimize-output-png",
6563
"output-as-ansi",
6664
]
@@ -78,7 +76,6 @@ decode-from-svg = ["dep:is-svg", "dep:resvg"]
7876
decode-from-tga = ["image/tga"]
7977
decode-from-tiff = ["image/tiff"]
8078
decode-from-webp = ["image/webp"]
81-
decode-from-xbm = ["dep:image-extras", "image-extras/xbm"]
8279
optimize-output-png = ["dep:oxipng"]
8380
output-as-ansi = [
8481
"dep:anstyle",

README.md

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -170,7 +170,6 @@ List of supported image formats:
170170
- [TGA]
171171
- [TIFF]
172172
- [WebP]
173-
- [XBM]
174173

175174
To support decoding from SVG image, the `decode-from-svg` feature must be
176175
enabled at compile time. Note that the SVG image is rasterized before scanning.
@@ -365,7 +364,6 @@ licensing information.
365364
[TGA]: https://en.wikipedia.org/wiki/Truevision_TGA
366365
[TIFF]: https://en.wikipedia.org/wiki/TIFF
367366
[WebP]: https://developers.google.com/speed/webp/
368-
[XBM]: https://en.wikipedia.org/wiki/X_BitMap
369367
[`oxipng`]: https://github.com/shssoichiro/oxipng
370368
[`svgcleaner`]: https://github.com/RazrFalcon/svgcleaner
371369
[ImageMagick]: https://imagemagick.org/

docs/book/modules/ROOT/pages/usage.adoc

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@
2525
:tga-url: {enwp-article-url}/Truevision_TGA
2626
:tiff-url: {enwp-article-url}/TIFF
2727
:webp-url: https://developers.google.com/speed/webp/
28-
:xbm-url: {enwp-article-url}/X_BitMap
2928
:oxipng-repo-url: {github-url}/shssoichiro/oxipng
3029
:svgcleaner-repo-url: {github-url}/RazrFalcon/svgcleaner
3130
:imagemagick-url: https://imagemagick.org/
@@ -145,7 +144,6 @@ the output format, etc.
145144
* {tga-url}[TGA]
146145
* {tiff-url}[TIFF]
147146
* {webp-url}[WebP]
148-
* {xbm-url}[XBM]
149147

150148
To support decoding from SVG image, the `decode-from-svg` feature must be
151149
enabled at compile time. Note that the SVG image is rasterized before scanning.

docs/man/man1/qrtool-decode.1.adoc

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
= qrtool-decode(1)
66
// Specify in UTC.
7-
:docdate: 2025-11-28
7+
:docdate: 2026-04-12
88
:revnumber: 0.13.2
99
:doctype: manpage
1010
:mansource: qrtool {revnumber}
@@ -29,7 +29,6 @@ ifndef::site-gen-antora[:includedir: ./include]
2929
:tga-url: {enwp-article-url}/Truevision_TGA
3030
:tiff-url: {enwp-article-url}/TIFF
3131
:webp-url: https://developers.google.com/speed/webp/
32-
:xbm-url: {enwp-article-url}/X_BitMap
3332
:qrcode-codes: {qrcode-url}/codes
3433
:normal-qr-code-url: {qrcode-codes}/model12.html
3534
:micro-qr-code-url: {qrcode-codes}/microqr.html
@@ -65,7 +64,6 @@ vector image. By default, the result will be output to standard output.
6564
* {tga-url}[TGA] (if enabled at compile time)
6665
* {tiff-url}[TIFF] (if enabled at compile time)
6766
* {webp-url}[WebP] (if enabled at compile time)
68-
* {xbm-url}[XBM] (if enabled at compile time)
6967

7068
Use *-t* option to specify the image format. If this option is not specified,
7169
the image format is determined based on the extension or the magic number.
@@ -169,11 +167,6 @@ _IMAGE_::
169167
WebP. This value is available if the `decode-from-webp` feature is
170168
enabled at compile time.
171169

172-
*xbm*::::
173-
174-
X BitMap. This value is available if the `decode-from-xbm` feature is
175-
enabled at compile time.
176-
177170
*--verbose*::
178171

179172
Also print the metadata. It is output to stderr. This option conflicts with

src/app.rs

Lines changed: 1 addition & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -12,17 +12,13 @@ use std::{
1212

1313
use anyhow::Context;
1414
use clap::Parser;
15-
#[cfg(feature = "decode-from-xbm")]
16-
use image::DynamicImage;
1715
use image::{ImageFormat, imageops};
18-
#[cfg(feature = "decode-from-xbm")]
19-
use image_extras::xbm::XbmDecoder;
2016
#[cfg(feature = "optimize-output-png")]
2117
use oxipng::{Deflater, Options, ZopfliOptions};
2218
use qrcode2::{QrCode, bits::Bits};
2319
use rqrr::PreparedImage;
2420

25-
#[cfg(any(feature = "decode-from-svg", feature = "decode-from-xbm"))]
21+
#[cfg(feature = "decode-from-svg")]
2622
use crate::cli::InputFormat;
2723
use crate::{
2824
cli::{Command, Opt, OutputFormat, Variant},
@@ -191,19 +187,10 @@ pub fn run() -> anyhow::Result<()> {
191187
#[cfg(feature = "decode-from-svg")]
192188
let input_format =
193189
input_format.or_else(|| is_svg::is_svg(&input).then_some(InputFormat::Svg));
194-
#[cfg(feature = "decode-from-xbm")]
195-
let input_format =
196-
input_format.or_else(|| input.starts_with(b"#define").then_some(InputFormat::Xbm));
197190
#[expect(clippy::option_if_let_else)]
198191
let image = match input_format {
199192
#[cfg(feature = "decode-from-svg")]
200193
Some(InputFormat::Svg) => decode::from_svg(&input),
201-
#[cfg(feature = "decode-from-xbm")]
202-
Some(InputFormat::Xbm) => {
203-
let decoder = XbmDecoder::new(Cursor::new(input))
204-
.context("could not create new XBM decoder")?;
205-
DynamicImage::from_decoder(decoder).map_err(anyhow::Error::from)
206-
}
207194
format => {
208195
let format = if let Some(f) = format {
209196
f.try_into()

src/cli.rs

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ use anyhow::anyhow;
1515
use clap::{Args, CommandFactory, Parser, Subcommand, ValueEnum, ValueHint};
1616
use clap_complete::Generator;
1717
use csscolorparser::Color;
18-
#[cfg(any(feature = "decode-from-svg", feature = "decode-from-xbm"))]
18+
#[cfg(feature = "decode-from-svg")]
1919
use image::error::ImageFormatHint;
2020
use image::{ImageError, ImageFormat};
2121
use qrcode2::EcLevel;
@@ -580,10 +580,6 @@ pub enum InputFormat {
580580
/// WebP.
581581
#[cfg(feature = "decode-from-webp")]
582582
WebP,
583-
584-
/// X BitMap.
585-
#[cfg(feature = "decode-from-xbm")]
586-
Xbm,
587583
}
588584

589585
impl TryFrom<InputFormat> for ImageFormat {
@@ -620,8 +616,6 @@ impl TryFrom<InputFormat> for ImageFormat {
620616
InputFormat::Tiff => Ok(Self::Tiff),
621617
#[cfg(feature = "decode-from-webp")]
622618
InputFormat::WebP => Ok(Self::WebP),
623-
#[cfg(feature = "decode-from-xbm")]
624-
InputFormat::Xbm => Err(Self::Error::Unsupported(ImageFormatHint::Unknown.into())),
625619
}
626620
}
627621
}
@@ -769,7 +763,5 @@ mod tests {
769763
ImageFormat::try_from(InputFormat::WebP).unwrap(),
770764
ImageFormat::WebP
771765
);
772-
#[cfg(feature = "decode-from-xbm")]
773-
assert!(ImageFormat::try_from(InputFormat::Xbm).is_err());
774766
}
775767
}

0 commit comments

Comments
 (0)