{"record":{"id":"3afa19f6e04f47f6","repo":"tonhowtf/omniget","slug":"n-o-abri","errorCode":null,"errorMessage":"não abri {}: {}","messagePattern":"não abri (.+?): (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src-tauri/omniget-core/src/core/tools/image_sprite.rs","lineNumber":346,"sourceCode":"        \"frames\": serde_json::Value::Object(map),\n        \"meta\": {\n            \"app\": \"OmniGet\",\n            \"image\": sheet,\n            \"format\": \"RGBA8888\",\n            \"size\": { \"w\": w, \"h\": h },\n            \"scale\": \"1\"\n        }\n    }))\n    .unwrap_or_else(|_| \"{}\".into())\n}\n\nfn slice(opts: &SpriteOptions, progress: &ProgressFn) -> anyhow::Result<SpriteResult> {\n    let files = gather(opts);\n    let input = files\n        .first()\n        .ok_or_else(|| anyhow!(\"escolha o spritesheet\"))?;\n    let sheet = image::open(input)\n        .map_err(|e| anyhow!(\"não abri {}: {}\", input.display(), e))?\n        .to_rgba8();\n    let grid = Grid {\n        cols: opts.cols,\n        rows: opts.rows,\n        cell_w: opts.cell_w,\n        cell_h: opts.cell_h,\n        margin: opts.margin,\n        spacing: opts.spacing,\n    };\n    let cells = grid_cells(sheet.width(), sheet.height(), &grid);\n    if cells.is_empty() {\n        return Err(anyhow!(\"a grade não cabe nessa folha\"));\n    }\n\n    let stem = if opts.name.trim().is_empty() {\n        input\n            .file_stem()\n            .map(|s| s.to_string_lossy().to_string())","sourceCodeStart":328,"sourceCodeEnd":364,"githubUrl":"https://github.com/tonhowtf/omniget/blob/8600b91f4246848bac346874daa9e61c1fc5677a/src-tauri/omniget-core/src/core/tools/image_sprite.rs#L328-L364","documentation":"Thrown by slice when image::open fails on the gathered spritesheet input. The error carries the input path and the underlying image::ImageError, e.g. the file does not exist, is not a decodable image, or has an unsupported format.","triggerScenarios":"Calling run() with mode \"slice\" where the first gathered file is missing, corrupted, has a wrong extension, or is an unsupported image format for the `image` crate.","commonSituations":"Corrupted downloads; files with misleading extensions (e.g. a .png that is actually a webp variant not compiled in); locked files on Windows; images with features disabled in the image crate build (no jpeg/webp feature).","solutions":["Confirm the file exists and is a valid image (try opening it in a viewer or with `file path`).","Enable the corresponding image crate feature (jpeg, webp, etc.) if the format is unsupported.","Re-download or re-export the corrupted file.","Read the wrapped image::ImageError in the message to distinguish NotFound vs Unsupported vs Decode errors."],"exampleFix":"// before\nlet sheet = image::open(input).map_err(|e| anyhow!(\"não abri {}: {}\", input.display(), e))?;\n// after\nif !input.exists() {\n    return Err(anyhow!(\"arquivo não encontrado: {}\", input.display()));\n}\nlet sheet = image::open(input).map_err(|e| anyhow!(\"não abri {}: {}\", input.display(), e))?;","handlingStrategy":"validation","validationCode":"fn readable_image(p: &std::path::Path) -> bool {\n    p.is_file() && image::image_dimensions(p).is_ok()\n}\n// check readable_image(input) before run()","typeGuard":null,"tryCatchPattern":"match image_sprite::run(&opts, &progress) {\n    Err(e) if format!(\"{e}\").contains(\"não abri\") => {\n        eprintln!(\"arquivo inválido ou formato não suportado: {e:#}\");\n    }\n    other => other?,\n}","preventionTips":["Verify the file opens in a viewer or image::image_dimensions before processing.","Re-download corrupted files.","Enable the image-crate feature for your formats (jpeg, webp, ...).","Check file permissions, especially on network drives."],"tags":["file-not-found","image-decode","image-crate","rust"],"backgroundTag":"file-open-failed","analyzedSha":"8600b91f4246848bac346874daa9e61c1fc5677a","analyzedAt":"2026-09-12T14:29:19.317Z","contentChangedAt":"2026-09-12T14:29:19.317Z","schemaVersion":2},"datasetVersion":"2026-09-15T23:17:13.987Z"}