excalidraw/excalidraw

move to `iTXt` png chunks

Aperta

#9269 aperta il 13 mar 2025

 (5 commenti) (1 reazione) (1 assegnatario)TypeScript (14.984 fork)batch import
good first issue

Metriche repository

Star
 (130.414 stelle)
Metriche merge PR
 (Metriche PR in attesa)

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