{"record":{"id":"b8329af0d8b69168","repo":"santifer/career-ops","slug":"unsupported-profile-photo-data-url-expected-base6","errorCode":null,"errorMessage":"Unsupported profile photo data URL (expected base64 PNG, JPEG, WebP, or GIF)","messagePattern":"Unsupported profile photo data URL \\(expected base64 PNG, JPEG, WebP, or GIF\\)","errorType":"validation","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"build-cv-html.mjs","lineNumber":132,"sourceCode":"}\n\nasync function prepareCandidatePhoto(candidate) {\n  const c = candidate && typeof candidate === 'object' ? { ...candidate } : {};\n  const photo = typeof c.photo === 'string' ? c.photo.trim() : '';\n  const style = c.photo_style || c.photoStyle || 'rounded';\n\n  if (!PHOTO_STYLES.has(style)) {\n    throw new Error(`Unsupported profile photo style: ${style} (expected rounded, circle, or square)`);\n  }\n  c.photo_style = style;\n  if (!photo) {\n    c.photo = '';\n    return c;\n  }\n\n  if (photo.startsWith('data:')) {\n    if (!IMAGE_DATA_URL_RE.test(photo)) {\n      throw new Error('Unsupported profile photo data URL (expected base64 PNG, JPEG, WebP, or GIF)');\n    }\n    c.photo = photo;\n    return c;\n  }\n\n  if (/^https?:\\/\\//i.test(photo)) {\n    c.photo = photo;\n    return c;\n  }\n\n  if (/^[a-z][a-z0-9+.-]+:/i.test(photo)) {\n    throw new Error(`Unsupported profile photo URL scheme: ${photo.split(':', 1)[0]}`);\n  }\n\n  const photoPath = isAbsolute(photo) ? photo : resolve(__dirname, photo);\n  const mime = PHOTO_MIME_BY_EXT.get(extname(photoPath).toLowerCase());\n  if (!mime) {\n    throw new Error(`Unsupported profile photo format: ${photo} (expected PNG, JPEG, WebP, or GIF)`);","sourceCodeStart":114,"sourceCodeEnd":150,"githubUrl":"https://github.com/santifer/career-ops/blob/e7abd431fce9348a95261acac9e0c14779c35df8/build-cv-html.mjs#L114-L150","documentation":"Photo validation in the CV HTML builder: the photo field starts with \"data:\" but does not match IMAGE_DATA_URL_RE — it is not a well-formed base64 data URL for PNG, JPEG, WebP, or GIF. Common faults: an SVG or other unsupported MIME type, a missing \"base64\" marker, or truncated/corrupted base64 payload.","triggerScenarios":"Thrown at build-cv-html.mjs:132 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Re-encode the photo as a base64 PNG/JPEG/WebP/GIF data URL","Reference the image by absolute/relative file path or an https:// URL instead of a data URL","If the image is SVG, convert it to PNG first — SVG avatars are not accepted"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"e7abd431fce9348a95261acac9e0c14779c35df8","analyzedAt":"2026-09-16T06:35:29.214Z","contentChangedAt":"2026-09-16T06:35:29.214Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}