diff --git a/TODO.md b/TODO.md index 8214036..66c51c7 100644 --- a/TODO.md +++ b/TODO.md @@ -22,6 +22,22 @@ Running list of deferred work. Detailed specs for the larger items live in flow currently renders the selected-layer dashed outline in the output. Add `body.exporting` (or similar) state that strips selection chrome before the raster snapshot. +- **One-click JPEG export (skip the PDF round-trip).** Today the + flow is: print → user saves PDF → user re-picks PDF → PDF.js + converts to JPEG. We can't cache the PDF in between — `window + .print()` doesn't expose the generated bytes to JS. Instead, + write a direct canvas rasterizer that walks the layer model + (image / text / shape / color / qr / pixelart) and draws each + layer onto an off-screen canvas at the artboard's design dims, + then `toBlob('image/jpeg')`. Same approach the pixel-art PNG + export already uses, generalised. CORS-tainted remote images + (cross-origin host without `Access-Control-Allow-Origin`) would + break the direct path — fall back to the existing PDF round-trip + for those with a one-line "this image needs the PDF route" toast. + Most modern image hosts (CDNs, Blossom blobs) send CORS so the + fallback should be rare. ~300–500 LoC of layer-by-layer drawing + code; reuses `renderShapeIntoElement` etc. as references for + geometry but writes to canvas instead of DOM. - **Independent-axis corner-node resize.** Corner resize handles currently lock the aspect ratio (or scale both axes together). Behaviour should follow the actual drag vector: dragging mostly