BigPizzaV3/CodexPlusPlus · error · anyhow::Error

macOS could not convert the Dream Skin image: {message}

Error message

macOS could not convert the Dream Skin image: {message}

What it means

On macOS the import shells out to /usr/bin/sips -s format jpeg; a non-zero exit embeds sips' trimmed stderr in this error. sips is the system image converter and fails on corrupt sources, unsupported color spaces, unreadable files, or I/O errors writing the prepared JPEG.

Source

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

}

#[cfg(target_os = "macos")]
fn prepare_image(
    source: &Path,
    managed_dir: &Path,
    _extension: &str,
) -> anyhow::Result<(PathBuf, String)> {
    let prepared = managed_dir.join(".dream-skin-import.jpg");
    let output = std::process::Command::new("/usr/bin/sips")
        .args(["-s", "format", "jpeg"])
        .arg(source)
        .arg("--out")
        .arg(&prepared)
        .output()
        .context("failed to run macOS image converter")?;
    if !output.status.success() {
        let message = String::from_utf8_lossy(&output.stderr).trim().to_string();
        bail!("macOS could not convert the Dream Skin image: {message}");
    }
    Ok((prepared, "jpg".to_string()))
}

#[cfg(not(target_os = "macos"))]
fn prepare_image(
    source: &Path,
    _managed_dir: &Path,
    extension: &str,
) -> anyhow::Result<(PathBuf, String)> {
    Ok((source.to_path_buf(), extension.to_string()))
}

fn remove_prepared_copy(source: &Path, prepared: &Path) {
    if prepared != source {
        let _ = std::fs::remove_file(prepared);
    }
}

View on GitHub (pinned to f2074595a2)

Solutions

  1. Open the image in Preview - if Preview also fails, the file is corrupt; re-download it
  2. Run 'sips -s format jpeg SRC --out /tmp/out.jpg' in Terminal to see the exact failure
  3. Fix write permissions and free space on the managed dream-skin directory
  4. Re-export from an editor to normalize the color profile, then retry
Defensive patterns

Strategy: try-catch

Try / catch

Catch the error from import_dream_skin_image, test for the 'macOS could not convert' prefix, and surface the embedded sips stderr verbatim - it names the real cause (corrupt file, color profile, permissions). Suggest re-downloading or re-exporting the source.

Prevention

When it happens

Trigger: Corrupted or truncated downloads; CMYK or exotic-profile images sips refuses; unreadable source permissions; the managed directory not writable or the volume full.

Common situations: Half-downloaded messenger images; misnamed PSDs carrying a .jpg extension; sandboxed apps without write access to the state dir.

Related errors


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