BigPizzaV3/CodexPlusPlus · error

unsupported Dream Skin image format

Error message

unsupported Dream Skin image format

What it means

Thrown by supported_image_extension when the managed Dream Skin image path's extension (lowercased) matches none of the supported formats. The skin pipeline can only process the known image formats; the offending input is the extension of the image path passed by prepare_dream_skin_image_for_directory, and the guard fires before any image copying/conversion runs.

Source

Thrown at crates/codex-plus-core/src/dream_skin.rs:130

pub fn is_managed_dream_skin_image(path: &Path, state_dir: &Path) -> bool {
    if !is_managed_image_name(path) || !path.is_file() {
        return false;
    }
    let Ok(path) = std::fs::canonicalize(path) else {
        return false;
    };
    let Ok(root) = std::fs::canonicalize(state_dir.join(MANAGED_THEME_DIR)) else {
        return false;
    };
    path.parent().is_some_and(|parent| parent == root)
}

fn supported_image_extension(path: &Path) -> anyhow::Result<String> {
    let extension = path
        .extension()
        .and_then(|value| value.to_str())
        .map(str::to_ascii_lowercase)
        .ok_or_else(|| anyhow::anyhow!("unsupported Dream Skin image format"))?;
    #[cfg(target_os = "macos")]
    let supported = matches!(
        extension.as_str(),
        "png" | "jpg" | "jpeg" | "heic" | "tif" | "tiff" | "webp"
    );
    #[cfg(not(target_os = "macos"))]
    let supported = matches!(
        extension.as_str(),
        "png" | "jpg" | "jpeg" | "webp" | "gif" | "bmp"
    );
    if !supported {
        bail!("unsupported Dream Skin image format: {extension}");
    }
    Ok(extension)
}

#[cfg(target_os = "macos")]
fn prepare_image(

View on GitHub (pinned to f2074595a2)

Solutions

  1. 将图片转换为支持的格式(如 png)后重试
  2. 确认文件扩展名拼写正确且未被省略
  3. 在 UI 侧限制上传文件的类型
  4. 扩展 supported_image_extension 支持更多格式
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at crates/codex-plus-core/src/dream_skin.rs:130 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of BigPizzaV3/CodexPlusPlus@f2074595a2 (2026-08-23). Data as JSON: /api/errors/1c510268a493d317. Report an issue: GitHub.