{"record":{"id":"1643dd241c416467","repo":"tinyhumansai/openhuman","slug":"failed-to-read-image-file-e","errorCode":null,"errorMessage":"Failed to read image file: {e}","messagePattern":"Failed to read image file: (.+?)","errorType":"exception","errorClass":"anyhow::Error","httpStatus":null,"severity":"error","filePath":"src/openhuman/tools/impl/browser/image_info.rs","lineNumber":178,"sourceCode":"            Ok(p) => p,\n            Err(msg) => return Ok(ToolResult::error(msg)),\n        };\n\n        let metadata = tokio::fs::metadata(&resolved)\n            .await\n            .map_err(|e| anyhow::anyhow!(\"Failed to read file metadata: {e}\"))?;\n\n        let file_size = metadata.len();\n\n        if file_size > MAX_IMAGE_BYTES {\n            return Ok(ToolResult::error(format!(\n                \"Image too large: {file_size} bytes (max {MAX_IMAGE_BYTES} bytes)\"\n            )));\n        }\n\n        let bytes = tokio::fs::read(&resolved)\n            .await\n            .map_err(|e| anyhow::anyhow!(\"Failed to read image file: {e}\"))?;\n\n        let format = Self::detect_format(&bytes);\n        let dimensions = Self::extract_dimensions(&bytes, format);\n\n        let mut output = format!(\"File: {path_str}\\nFormat: {format}\\nSize: {file_size} bytes\");\n\n        if let Some((w, h)) = dimensions {\n            let _ = write!(output, \"\\nDimensions: {w}x{h}\");\n        }\n\n        if include_base64 {\n            use base64::Engine;\n            let encoded = base64::engine::general_purpose::STANDARD.encode(&bytes);\n            let mime = match format {\n                \"png\" => \"image/png\",\n                \"jpeg\" => \"image/jpeg\",\n                \"gif\" => \"image/gif\",\n                \"webp\" => \"image/webp\",","sourceCodeStart":160,"sourceCodeEnd":196,"githubUrl":"https://github.com/tinyhumansai/openhuman/blob/749120085864ce16e0f273c7b86fac7740b39c5b/src/openhuman/tools/impl/browser/image_info.rs#L160-L196","documentation":"Wrapped IO error in image_info: tokio::fs::read failed while loading the image bytes, after metadata succeeded and the size check passed. {e} is the OS-level read error (permissions changed, file removed mid-flight, I/O error).","triggerScenarios":"Thrown at src/openhuman/tools/impl/browser/image_info.rs:178 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Confirm the file is still present and readable","Check {e} for the OS error cause","Retry after fixing permissions or the file state"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"749120085864ce16e0f273c7b86fac7740b39c5b","analyzedAt":"2026-08-17T21:21:45.363Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}