Skip to content

Commit

Permalink
fix bug with producing images
Browse files Browse the repository at this point in the history
  • Loading branch information
gracetxgao committed Sep 15, 2024
1 parent c1dacb5 commit 99406fd
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions frontend/src/pages/RecordPage/RecordPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ const RecordPage = () => {
console.log('result:', result);

setLatex(result.latex_code);
setImg(result.img_binary);
setImg(result.img_base64);

}

Expand Down Expand Up @@ -131,11 +131,9 @@ const RecordPage = () => {
value={latex || ''}
readOnly
/>
<img src={`data:image/png;base64,${img}`} alt="Equation Preview" className="mt-4" />
{img ?
<img src={`data:image/png;charset=utf-8;base64,${img}`} alt="Equation Preview" className="mt-4" />
:
<p>hi</p>

{img &&
<img src={`data:image/png;base64,${img}`} alt="Equation Preview" className="mt-4" />
}
</div>
</div>
Expand Down

0 comments on commit 99406fd

Please sign in to comment.