thumbnail: Support jxl and plumbing for future formats. (#1058)

* add plumbing for additional thumbnailers

* remove bad logging and fmt

* fix bad logging message

* add decoding ram limits

* add configuration for thumbs

* cleanups

* fix rebase fails
This commit is contained in:
Mitchel Stewart 2025-07-30 17:45:53 -04:00 committed by GitHub
parent edca40058b
commit 293350092c
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
6 changed files with 338 additions and 40 deletions

View file

@ -166,6 +166,7 @@ pub struct Config {
pub app_theme: AppTheme,
pub dialog: DialogConfig,
pub desktop: DesktopConfig,
pub thumb_cfg: ThumbCfg,
pub favorites: Vec<Favorite>,
pub show_details: bool,
pub tab: TabConfig,
@ -220,6 +221,7 @@ impl Default for Config {
app_theme: AppTheme::System,
desktop: DesktopConfig::default(),
dialog: DialogConfig::default(),
thumb_cfg: ThumbCfg::default(),
favorites: vec![
Favorite::Home,
Favorite::Documents,
@ -289,6 +291,23 @@ impl Default for DialogConfig {
}
}
}
#[derive(Clone, Copy, Debug, Eq, Hash, PartialEq, CosmicConfigEntry, Deserialize, Serialize)]
#[serde(default)]
pub struct ThumbCfg {
pub jobs: NonZeroU16,
pub max_mem_mb: NonZeroU16,
pub max_size_mb: NonZeroU16,
}
impl Default for ThumbCfg {
fn default() -> Self {
Self {
jobs: 4.try_into().unwrap(),
max_mem_mb: 2000.try_into().unwrap(),
max_size_mb: 64.try_into().unwrap(),
}
}
}
/// Global and local [`crate::tab::Tab`] config.
///