{"record":{"id":"a41dedd37e94fa1e","repo":"musistudio/claude-code-router","slug":"invalid-png-file","errorCode":null,"errorMessage":"Invalid PNG file.","messagePattern":"Invalid PNG file\\.","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"packages/electron/src/main/ipc.ts","lineNumber":745,"sourceCode":"    }\n    return image.resize({ height, width }).toPNG();\n  } catch (error) {\n    console.warn(`[export] Failed to resize exported PNG fallback: ${formatError(error)}`);\n    return undefined;\n  }\n}\n\nfunction sanitizePngOutputDimension(value: unknown): number | undefined {\n  if (typeof value !== \"number\" || !Number.isFinite(value)) {\n    return undefined;\n  }\n  const rounded = Math.round(value);\n  return rounded > 0 && rounded <= 4096 ? rounded : undefined;\n}\n\nfunction decodePngPixels(png: Buffer): DecodedPngPixels {\n  if (png.length < 33 || !png.subarray(0, pngSignature.length).equals(pngSignature)) {\n    throw new Error(\"Invalid PNG file.\");\n  }\n\n  let offset = pngSignature.length;\n  let width = 0;\n  let height = 0;\n  let bitDepth = 0;\n  let colorType = 0;\n  let interlaceMethod = 0;\n  const idatChunks: Buffer[] = [];\n\n  while (offset + 12 <= png.length) {\n    const length = png.readUInt32BE(offset);\n    offset += 4;\n    const type = png.toString(\"ascii\", offset, offset + 4);\n    offset += 4;\n    const data = png.subarray(offset, offset + length);\n    offset += length + 4;\n","sourceCodeStart":727,"sourceCodeEnd":763,"githubUrl":"https://github.com/musistudio/claude-code-router/blob/99f24806c6a2c660b16e53e95211c517448a6c90/packages/electron/src/main/ipc.ts#L727-L763","documentation":"Error \"Invalid PNG file.\" thrown in musistudio/claude-code-router.","triggerScenarios":"Thrown at packages/electron/src/main/ipc.ts:745 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"99f24806c6a2c660b16e53e95211c517448a6c90","analyzedAt":"2026-08-27T04:11:01.184Z","schemaVersion":2},"datasetVersion":"2026-08-27T08:17:20.692Z"}