BigPizzaV3/CodexPlusPlus · error
unsupported Dream Skin image format
Error message
unsupported Dream Skin image format
What it means
Thrown by supported_image_extension when a Dream Skin image path has no file extension at all (or the extension is not valid UTF-8 / non-string). The extension is needed to decide how to process/copy the image (and on macOS, whether Core Graphics conversion is required).
Solutions
- Rename the file so it has a proper image extension (e.g. wallpaper.png)
- Re-export/download the image in PNG or JPG format
- Verify the extension is plain ASCII/UTF-8 (avoid non-Unicode bytes in filenames)
Example fix
// before
mv wallpaper wallpaper.png
// after (import with a recognized extension)
prepare_dream_skin_image_for_directory(Path::new("wallpaper.png"), ...) Defensive patterns
Strategy: validation
Validate before calling
fn has_supported_image_extension(path: &std::path::Path) -> bool {
path.extension()
.and_then(|e| e.to_str())
.map(|e| {
let e = e.to_ascii_lowercase();
matches!(e.as_str(), "png"|"jpg"|"jpeg"|"heic"|"tif"|"tiff"|"webp")
})
.unwrap_or(false)
} Type guard
fn valid_extension(path: &std::path::Path) -> Option<String> {
path.extension()?.to_str().map(|e| e.to_ascii_lowercase())
} Prevention
- Only pass files with recognized image extensions into Dream Skin APIs
- Re-download images that arrive without extensions instead of renaming blindly
- Validate user-selected paths before invoking prepare_dream_skin_image_for_directory
When it happens
Trigger: prepare_dream_skin_image_for_directory receiving a Path with path.extension() == None — e.g. a file named 'wallpaper', a dotfile like '.hidden', or a path whose extension bytes are not valid Unicode.
Common situations: Picking a downloaded file that lost its extension; macOS screenshots or assets renamed without extension; importing an image via drag-and-drop from an app that strips extensions.
Understand the failure class
Background: "Invalid ... format", "must be in format X", "does not look like a ..." — invalid argument format errors across CLI tools and libraries — this error's family across 17 libraries.
Related errors
- built-in Dream Skin theme cannot be deleted
- built-in Dream Skin theme is read-only
- current Dream Skin theme cannot be deleted
- Dream Skin theme name is empty
- 无效的主题市场相对路径
AI-assisted analysis of BigPizzaV3/CodexPlusPlus@b1ed92e5e4 (2026-09-19).
Data as JSON: /api/errors/1c510268a493d317.
Report an issue: GitHub.
Appendix: source
Thrown at crates/codex-plus-core/src/dream_skin.rs:131
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 b1ed92e5e4)