Main already opens PSD/PSB from the file in bands (4915f0970, #5106) through
psd_to_document_owned, which keeps damaged-file flagging, failed-layer drops,
type-layer setup and the PSD pixel budget; PSD limits are handled in #10778.
This drops the second PSD/PSB stream reader (psd::stream, io::psd_stream),
the seekable PSB writer and atomic stream helpers, the authorized-workspace
seekable open plumbing and the working-memory pre-check that refused
ordinary exports. The flat scanline EXR band decoder and its tests stay and
are wired into main's path open after merging main.
This reverts commit 89ed4cb284 from the
#5332 branch so the GPU viewport streaming lands standalone. The import
work is rescoped separately in #5331 (EXR streaming only).
Merge 655295b2a2. Resolve generated scorecard conflict with exact upstream text only; actual source-bound regeneration and combined validation remain pending.
Keep the PSD memory admission work and upstream's scratch storage
together. Conflicts resolved:
- Cargo.lock: both sysinfo versions are required. 0.40.1 serves
photocraft-io's adaptive import budget; 0.37.2 serves
photocraft-raster's scratch volume and memory supervision. Cargo
metadata resolved the lock with no other changes.
- crates/engine/src/lib.rs: Session keeps pending_preflights and
next_pending_preflight beside scratch_runtime and scratch_epoch.
Session derives Default, so neither set needs a manual initializer.
Upstream: 655295b2a2
The Pen options bar in Path mode only offered Make Selection, so a drawn
path could not become a shape layer. Make Shape now does that, next to
Make Selection, with the shape tools' fill and stroke, as one History
step. A path still being drawn is finished first. The Work Path becomes
the shape's path and is removed; a saved path stays.
New engine command path.toShape, so scripts and agents can do the same.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01EZbgszHyuEuWAzxaamteuU
The automation .pcraft save renders the previews and main's optional
full-size composite before the bundle writer takes its scratch snapshot,
so a tile that failed and recovered in between could be saved as
placeholder pixels. Check the document's scratch health and the read-error
generation around that render, as io's export path already does.
`load_frames`'s single-file path called `file_cmds::import`, which uses default
import options, so the footage command's lowered PSD/layered-TIFF memory limit
never reached a single-page layered TIFF or PSD. Multi-page TIFF pages already
passed their `opts`.
Give the engine import one shared `import_result_with` path and an
`import_with_options` entry that keep the allocation checkpoint, native
`.pcraft` and format dispatch, typed memory refusals and the preview-only
refusal; the existing `import` delegates with default options, so every other
caller behaves exactly as before. The single-file fallback now passes `opts`.
Add a command-level regression: a single-page layered TIFF under a thread-scoped
`psd_max_pixel_bytes` of 1 must reach `file.import.videoFramesToLayers` as a
typed `EngineError::PsdHardBudget` with its name, required and limit fields
intact and the document unchanged, then import as one frame when the limit is
not lowered.
Sliding a turned ratio corner along its diagonal onto a guide went as far
as the crossing was: with the diagonal nearly parallel to the guide, a
guide a few px from the handle is met hundreds of px further along, and
the frame jumped there. The slide now has to stay inside the tolerance box
the handle was snapped in (at most the tolerance on each axis); otherwise
the corner follows the drag unsnapped.
Test: a frame turned -31 degrees, whose bottom-right diagonal runs 1 degree
off horizontal, ignores a horizontal guide 3 px from the handle and ends
as with no guide, in Classic Mode and the default mode. It grew by about
40 % before.
Keep both complete pixel comparisons and the existing New/Current output assertions while bringing the playback test under the cognitive-complexity gate. Production behavior and baseline import/kept-control fixtures are unchanged.
With Delete Cropped Pixels off, Reveal All brings back the turned image
outside the frame (and with it on there is nothing to reveal). The 4°
crop checks the red square's centroid instead of one pixel, which a crop
off by up to about 19 px still covered.
The multi-page TIFF branch of `load_frames` pushed each flattened page
straight into `frames`, bypassing the `keep` closure, so `MAX_FOOTAGE_BYTES`
was never checked for those pages: many large pages could retain more than
the cap without an error. Route every flattened page through `keep`, with the
same file-context error mapping as the single-file and GIF/WebP paths, and
keep typed page admission refusals typed.
Add command-level regressions. A per-thread test scope lowers the footage and
PSD limits, so neither test allocates gibibytes: one proves an over-budget
multi-page TIFF is refused with nothing imported, and one proves a page with
Photoshop layer data reaches `file.import.videoFramesToLayers` as a typed
`EngineError::PsdHardBudget` with its name, required and limit fields intact
and the document unchanged.
Use the explicit cafOutputToCurrentLayer Action Manager binding alongside measured New Layer output. Rectangular sampling remains required; native output may use its proven Current default. Extend existing roundtrip, native-default and pixel/Undo controls without changing renderer or history code. Source-only successor; formatting, compilation and tests remain unrun under native0.
Map the seven-field Rectangular/Default/None/New Layer form to the existing CAF command, retaining source descriptor data only while native settings agree. Keep other enum forms whole and refuse unrepresented native exports. Add focused public regressions, the common round-trip case and supported-form documentation. This is a source-only draft increment: formatting, compilation and runtime validation remain pending under native0.
Extend the existing nested-dialog set-play regression to check the outer action name, single entry and exact Undo/Redo document identity. Production source and the 14 passing public cases are unchanged.
On a turned frame a corner with a ratio (a Shift corner's diagonal or an
options-bar preset) can only slide along its turned diagonal. Handle
snapping moved the handle sideways onto the guide in canvas axes, and the
ratio then put it back off the line: a Shift corner stopped short of the
guide and lost its snap line, and a preset corner grew away from it.
crop_handle now slides the corner along the diagonal onto the nearest line
it reached. Upright frames keep the existing ratio solve.
Tests: a turned frame snapping to a guide with Shift and with an 8:5
preset, in Classic Mode and the default mode; Shift on the top-right and
bottom-left corners, which use the other diagonal.