{"record":{"id":"20c2f97545b0a102","repo":"tonhowtf/omniget","slug":"nenhum-quadro-p-de-ser-aberto","errorCode":null,"errorMessage":"nenhum quadro pôde ser aberto","messagePattern":"nenhum quadro pôde ser aberto","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src-tauri/omniget-core/src/core/tools/image_sprite.rs","lineNumber":468,"sourceCode":"            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())\n                    .unwrap_or_else(|| format!(\"quadro_{:03}\", i));\n                images.push((name, img.to_rgba8()));\n            }\n            Err(e) => {\n                tracing::warn!(\"[img-sprite] {}: {}\", path.display(), e);\n                skipped += 1;\n            }\n        }\n    }\n    if images.is_empty() {\n        return Err(anyhow!(\"nenhum quadro pôde ser aberto\"));\n    }\n\n    let sizes: Vec<(u32, u32)> = images.iter().map(|(_, i)| i.dimensions()).collect();\n    let cols = if opts.pack_cols > 0 {\n        opts.pack_cols\n    } else {\n        near_square_cols(images.len() as u32)\n    };\n    let (w, h, positions) = pack_layout(&sizes, cols, opts.padding);\n    let mut sheet = RgbaImage::from_pixel(w, h, image::Rgba([0, 0, 0, 0]));\n    let mut frames = Vec::with_capacity(images.len());\n    for ((name, img), (x, y)) in images.iter().zip(&positions) {\n        imageops::overlay(&mut sheet, img, *x as i64, *y as i64);\n        frames.push(SpriteFrame {\n            name: name.clone(),\n            x: *x,\n            y: *y,\n            w: img.width(),","sourceCodeStart":450,"sourceCodeEnd":486,"githubUrl":"https://github.com/tonhowtf/omniget/blob/8600b91f4246848bac346874daa9e61c1fc5677a/src-tauri/omniget-core/src/core/tools/image_sprite.rs#L450-L486","documentation":"Thrown by pack after the per-file loading loop when none of the gathered frame files could be decoded into an RgbaImage (all failed and were skipped with a warning). Some files existed, but every open/decode attempt errored, so there is nothing to pack.","triggerScenarios":"Calling run() with mode \"pack\" where every file in the input list fails image::open — corrupted images, unsupported formats (missing image-crate features), truncated files, or unreadable permissions.","commonSituations":"Folder of images in a format the binary wasn't built to decode (e.g. avif/heic); zero-byte files from failed downloads; permission-restricted files on shared drives.","solutions":["Check the tracing::warn! logs — each skipped file's path and decode error is logged there.","Verify the image crate build features cover your formats (png, jpeg, webp, ...).","Open one failing file with `file`/a viewer to confirm it is a valid image.","Fix file permissions or re-export the corrupted images, then rerun pack."],"exampleFix":"// before\nfor path in files { /* open errors only warn+skip */ }\nif images.is_empty() { return Err(anyhow!(\"nenhum quadro pôde ser aberto\")); }\n// after\n// surface the first decode error to the user instead of a generic message:\nreturn Err(anyhow!(\"nenhum quadro pôde ser aberto; primeiro erro: {}\", first_error));","handlingStrategy":"validation","validationCode":"fn all_decode(files: &[std::path::PathBuf]) -> Result<(), std::path::PathBuf> {\n    for f in files {\n        if image::open(f).is_err() { return Err(f.clone()); }\n    }\n    Ok(())\n}","typeGuard":null,"tryCatchPattern":"match image_sprite::run(&opts, &progress) {\n    Err(e) if e.to_string().contains(\"nenhum quadro pôde ser aberto\") => {\n        // inspect tracing warnings for per-file decode errors\n        eprintln!(\"nenhuma imagem pôde ser decodificada; verifique os formatos\");\n    }\n    other => other?,\n}","preventionTips":["Pre-flight decode one file from the batch to detect format/feature issues early.","Enable needed image-crate features at build time.","Watch tracing::warn! output for skipped files.","Validate file sizes > 0 and permissions before batch operations."],"tags":["image-decode","image-crate","all-files-failed","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"}