mirror of
https://github.com/mauriceboe/TREK.git
synced 2026-12-03 09:38:54 +00:00
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:
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user