fix(studio): load a large book's photos a few at a time for the PDF export

Every printed photo got its src at once, off screen in the editor and again
in the print frame, so a journey with a few hundred photos asked for every
original in parallel and the browser failed with insufficient resources.

The print markup now holds the source back, and the print view hands it over
four at a time, retries a failed photo once, gives up on one that never
answers and shows the progress on the Save button.

Closes #3102
This commit is contained in:
Maurice
2026-11-16 10:30:32 +01:00
parent 24bc132476
commit aa8d041a33
6 changed files with 181 additions and 5 deletions
+2 -2
View File
@@ -2,7 +2,7 @@ import { photoLookOf, type BookFrame, type BookPhotoElement, type BookShapeId, t
import type { CSSProperties, ReactNode } from 'react';
import { fontStack } from './bookFonts';
import { photoSrc } from './bookRender';
import { PRINT_SRC_ATTR, photoSrc } from './bookRender';
import { usePaintId } from './paint/usePaintId';
import { pictureFilter, silhouetteShadows, svgFilterMatrices, zoomPlacement } from './photo/photoLook';
import { photoClip } from './shapeOutline';
@@ -172,7 +172,7 @@ function Picture({
const zoom = zoomPlacement(look.zoom, el.focalX, el.focalY);
const img = (
<img
src={photoSrc(photoId, big)}
{...(print ? { [PRINT_SRC_ATTR]: photoSrc(photoId, big) } : { src: photoSrc(photoId, big) })}
alt=""
draggable={false}
// Lazy on the canvas, where a long book scrolls past; eager in print,