excalidraw/excalidraw

move to `iTXt` png chunks

Open

#9269 aperta il 13 mar 2025

Vedi su GitHub
 (4 commenti) (1 reazione) (1 assegnatario)TypeScript (13.649 fork)batch import
good first issue

Metriche repository

Star
 (123.243 star)
Metriche merge PR
 (Merge medio 5g 7h) (18 PR mergiate in 30 g)

Descrizione

When encoding scene data to PNGs (see https://github.com/excalidraw/excalidraw/blob/master/packages/excalidraw/data/image.ts)

turns out tEXt chunks support latin1 only, but we're encoding the data as utf8. Browsers don't care, but it may throw off other PNG decoders.

Instead, we should use iTXt chunks which support utf8.

https://www.npmjs.com/package/png-itxt png-chunk-itxt

We still need to keep tEXt support for backwards compat.

Guida contributor