{"record":{"id":"5f6eec058e0ac9aa","repo":"tonhowtf/omniget","slug":"escolha-os-quadros","errorCode":null,"errorMessage":"escolha os quadros","messagePattern":"escolha os quadros","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src-tauri/omniget-core/src/core/tools/image_sprite.rs","lineNumber":439,"sourceCode":"\n    super::report(progress, \"img-sprite\", \"done\", total, Some(total), None);\n    Ok(SpriteResult {\n        mode: \"slice\".into(),\n        count: outputs.len() as u32,\n        outputs,\n        frames,\n        sheet: Some(input.to_string_lossy().to_string()),\n        atlas: None,\n        width: sheet.width(),\n        height: sheet.height(),\n        skipped,\n    })\n}\n\nfn pack(opts: &SpriteOptions, progress: &ProgressFn) -> anyhow::Result<SpriteResult> {\n    let files = gather(opts);\n    if files.is_empty() {\n        return Err(anyhow!(\"escolha os quadros\"));\n    }\n    let total = files.len() as u64;\n    let mut images: Vec<(String, RgbaImage)> = Vec::new();\n    let mut skipped = 0u32;\n    for (i, path) in files.iter().enumerate() {\n        super::report(\n            progress,\n            \"img-sprite\",\n            \"progress\",\n            i as u64,\n            Some(total),\n            Some(path.to_string_lossy().to_string()),\n        );\n        match image::open(path) {\n            Ok(img) => {\n                let name = path\n                    .file_name()\n                    .map(|s| s.to_string_lossy().to_string())","sourceCodeStart":421,"sourceCodeEnd":457,"githubUrl":"https://github.com/tonhowtf/omniget/blob/8600b91f4246848bac346874daa9e61c1fc5677a/src-tauri/omniget-core/src/core/tools/image_sprite.rs#L421-L457","documentation":"Empty-input guard in the sprite packer: pack() gathers the input frame files via gather(opts) and, when the resulting list is empty (no frames matched the supplied options/paths), it aborts instead of producing an empty sprite sheet. It fires when the user runs the slice/pack operation without any usable frame images selected.","triggerScenarios":"Calling run() with mode \"pack\" and an input path/pattern that matches no files (empty folder, nonexistent path, extension filter excluding everything).","commonSituations":"User submits the pack form without choosing frames; folder is empty or contains only non-image files; wrong working directory in CLI use.","solutions":["Point SpriteOptions input at a folder or pattern containing at least one image frame.","Check gather()'s accepted extensions and place files accordingly.","Validate non-empty input in the UI/CLI before invoking run().","Treat this error as a prompt-to-select, not a bug report."],"exampleFix":"// before\nlet files = gather(&opts); // empty\nimage_sprite::run(&opts, &progress)?;\n// after\nif gather(&opts).is_empty() {\n    anyhow::bail!(\"selecione os quadros antes de empacotar\");\n}\nimage_sprite::run(&opts, &progress)?;","handlingStrategy":"validation","validationCode":"fn has_frames(opts: &SpriteOptions) -> bool { !gather(opts).is_empty() }\n// call run() only if has_frames(&opts)","typeGuard":null,"tryCatchPattern":"match image_sprite::run(&opts, &progress) {\n    Err(e) if e.to_string().contains(\"escolha os quadros\") => prompt_frames_selection(),\n    other => other?,\n}","preventionTips":["Require at least one selected frame in the UI before submit.","Verify the folder is non-empty and contains image files.","Check extension filters in gather().","Default the input to the last-used directory to avoid empty paths."],"tags":["missing-input","validation","spritesheet","rust"],"backgroundTag":"empty-required-field","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"}