{"record":{"id":"350aeeb0ac46d1a8","repo":"earendil-works/pi","slug":"unknown-image-type-mimetype","errorCode":null,"errorMessage":"Unknown image type: ${mimeType}","messagePattern":"Unknown image type: (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"packages/ai/src/api/bedrock-converse-stream.ts","lineNumber":1283,"sourceCode":"\nfunction createImageBlock(mimeType: string, data: string) {\n\tlet format: ImageFormat;\n\tswitch (mimeType) {\n\t\tcase \"image/jpeg\":\n\t\tcase \"image/jpg\":\n\t\t\tformat = ImageFormat.JPEG;\n\t\t\tbreak;\n\t\tcase \"image/png\":\n\t\t\tformat = ImageFormat.PNG;\n\t\t\tbreak;\n\t\tcase \"image/gif\":\n\t\t\tformat = ImageFormat.GIF;\n\t\t\tbreak;\n\t\tcase \"image/webp\":\n\t\t\tformat = ImageFormat.WEBP;\n\t\t\tbreak;\n\t\tdefault:\n\t\t\tthrow new Error(`Unknown image type: ${mimeType}`);\n\t}\n\n\treturn { source: { bytes: base64ToBytes(data) }, format };\n}\n\nfunction base64ToBytes(data: string): Uint8Array {\n\tconst binaryString = atob(data);\n\tconst bytes = new Uint8Array(binaryString.length);\n\tfor (let i = 0; i < binaryString.length; i++) {\n\t\tbytes[i] = binaryString.charCodeAt(i);\n\t}\n\treturn bytes;\n}\n\n/**\n * Decodes a stored redacted payload. The AWS SDK hands the blob over as bytes, but a\n * persisted session carries it as base64. A hand-edited or externally produced session\n * can hold a signature that is not base64; drop that block instead of failing the","sourceCodeStart":1265,"sourceCodeEnd":1301,"githubUrl":"https://github.com/earendil-works/pi/blob/4af9d21d3b4d664e4a29fcabfec85171077248e3/packages/ai/src/api/bedrock-converse-stream.ts#L1265-L1301","documentation":"Error \"Unknown image type: ${mimeType}\" thrown in earendil-works/pi.","triggerScenarios":"Thrown at packages/ai/src/api/bedrock-converse-stream.ts:1283 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Use a supported image MIME type such as image/png or image/jpeg for Bedrock."],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"4af9d21d3b4d664e4a29fcabfec85171077248e3","analyzedAt":"2026-08-24T13:07:14.692Z","schemaVersion":2},"datasetVersion":"2026-08-24T17:17:21.512Z"}