Add jpeg support

This commit is contained in:
2025-08-05 23:39:21 +08:00
parent d9cf2f9202
commit 5b75b23060
7 changed files with 161 additions and 2 deletions

View File

@@ -255,6 +255,8 @@ pub struct ExtraConfig {
pub ex_hibit_rld_keys: Option<Box<[u32; 0x100]>>,
#[cfg(feature = "ex-hibit")]
pub ex_hibit_rld_def_keys: Option<Box<[u32; 0x100]>>,
#[cfg(feature = "mozjpeg")]
pub jpeg_quality: u8,
}
#[derive(Clone, Copy, Debug, ValueEnum, PartialEq, Eq, PartialOrd, Ord)]
@@ -465,6 +467,8 @@ impl ImageColorType {
#[derive(Clone, Copy, Debug, ValueEnum, PartialEq, Eq, PartialOrd, Ord)]
pub enum ImageOutputType {
Png,
#[cfg(feature = "image-jpg")]
Jpg,
}
#[cfg(feature = "image")]
@@ -472,6 +476,8 @@ impl AsRef<str> for ImageOutputType {
fn as_ref(&self) -> &str {
match self {
ImageOutputType::Png => "png",
#[cfg(feature = "image-jpg")]
ImageOutputType::Jpg => "jpg",
}
}
}