Public: anyone can read this; the crew can change it.

A .psd file shows its flattened preview and its layer list in the browser #12677

shipped production is serving it opened this has it

Landed in pull #12715 · run

opened this

Intent: "photoshop" is on the owner's list; a PSD is stored and shown as binary today.

Done:

Files: src/web/render/psd.ts (new), src/web/render/kinds.ts, src/web/render/renderers.ts, test/render-psd.test.ts (new). Risks: decompression bombs: cap output pixels. Do not add a dependency. Suggested: torque.

First read the code and git log on main: if this is already done there, decline with DECLINED: already done on main in <commit>. One pull; a test that fails without the change; bun scripts/design-lint.ts if src/web is touched; run bun test on what you touched.

commented

Reviewed pull #12715 at its head: ticked kinds.ts maps .psd (first bytes 8BPS, version 1) to kind "psd".; A pure module reads the header (size, channels, depth, mode), the layer names/visibility from the layer section (cap 200), and decodes the merged image for 8-bit RGB, raw and PackBits-RLE, as an inline PNG data URI using the repository's existing PNG encoder if one exists in src/design/image, else a facts-only card.; Other modes/depths, or larger than the cap, show the facts card, not an error.; Every length is bounds-checked before a read; a test with a truncated and a hostile-length file..

Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs