{"record":{"id":"35ef01efb0b94d56","repo":"BigPizzaV3/CodexPlusPlus","slug":"dream-skin-source-image-exceeds-50-mib","errorCode":null,"errorMessage":"Dream Skin source image exceeds 50 MiB","messagePattern":"Dream Skin source image exceeds 50 MiB","errorType":"validation","errorClass":"anyhow::Error","httpStatus":null,"severity":"error","filePath":"crates/codex-plus-core/src/dream_skin.rs","lineNumber":59,"sourceCode":"    destination_stem: &str,\n) -> anyhow::Result<PathBuf> {\n    if destination_stem.is_empty()\n        || !destination_stem\n            .bytes()\n            .all(|byte| byte.is_ascii_alphanumeric() || matches!(byte, b'-' | b'_'))\n    {\n        bail!(\"invalid Dream Skin destination name\");\n    }\n    let metadata = std::fs::symlink_metadata(source)\n        .with_context(|| format!(\"failed to read image metadata {}\", source.display()))?;\n    if !metadata.file_type().is_file() || metadata.file_type().is_symlink() {\n        bail!(\"Dream Skin image is not a file\");\n    }\n    if metadata.len() == 0 {\n        bail!(\"Dream Skin image is empty\");\n    }\n    if metadata.len() > DREAM_SKIN_SOURCE_LIMIT {\n        bail!(\"Dream Skin source image exceeds 50 MiB\");\n    }\n\n    let extension = supported_image_extension(source)?;\n    std::fs::create_dir_all(destination_dir).with_context(|| {\n        format!(\n            \"failed to create Dream Skin theme directory {}\",\n            destination_dir.display()\n        )\n    })?;\n\n    let (prepared_path, prepared_extension) = prepare_image(source, destination_dir, &extension)?;\n    let prepared_metadata = std::fs::metadata(&prepared_path).with_context(|| {\n        format!(\n            \"failed to read prepared image metadata {}\",\n            prepared_path.display()\n        )\n    })?;\n    if prepared_metadata.len() == 0 {","sourceCodeStart":41,"sourceCodeEnd":77,"githubUrl":"https://github.com/BigPizzaV3/CodexPlusPlus/blob/f2074595a281bc057525c748175c8eb9805b0673/crates/codex-plus-core/src/dream_skin.rs#L41-L77","documentation":"The source image exceeds DREAM_SKIN_SOURCE_LIMIT (50 MiB) per symlink_metadata. This pre-conversion cap bounds imports; on non-macOS the file is copied as-is into the managed theme dir, so the limit also bounds the stored asset.","triggerScenarios":"Importing uncompressed TIFF-class files, 100-megapixel photos, or lossless wallpapers downloaded at full resolution.","commonSituations":"4K/8K wallpapers exported losslessly; RAW-to-TIFF exports from photo tools; generative-art PNGs with huge dimensions.","solutions":["Re-encode as JPEG or compressed PNG and retry","Downscale the image - dimensions drive the byte size, not format alone","Enforce a 50 MiB cap at selection time in your own UI"],"exampleFix":null,"handlingStrategy":"validation","validationCode":"fn within_source_limit(path: &std::path::Path) -> bool {\n    std::fs::symlink_metadata(path)\n        .map(|m| m.len() <= 50 * 1024 * 1024)\n        .unwrap_or(false)\n}","typeGuard":"fn within_source_limit(path: &std::path::Path) -> bool {\n    std::fs::symlink_metadata(path)\n        .map(|m| m.len() <= 50 * 1024 * 1024)\n        .unwrap_or(false)\n}","tryCatchPattern":null,"preventionTips":["Pre-compress wallpaper-grade images to JPEG before import","Enforce the 50 MiB cap in the picker so users get an actionable message early"],"tags":["dream-skin","file-size-limit","image","rust"],"backgroundTag":"file-size-limit-exceeded","analyzedSha":"f2074595a281bc057525c748175c8eb9805b0673","analyzedAt":"2026-08-23T12:52:24.489Z","contentChangedAt":"2026-08-23T12:52:24.489Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}