Commit Graph
8 Commits
Author SHA1 Message Date
Brandon Thomas fc54b5debc Merge pull request #1139 from vangel76/fix-psd-decode-memory-budget
# Conflicts:
#	crates/psd/src/lib.rs
#	crates/psd/src/placed.rs
2026-10-13 04:28:42 -04:00
Brandon Thomas ac9d4eb72f Merge pull request #1137 from vangel76/psd-optimise
# Conflicts:
#	crates/psd/src/lib.rs
2026-10-13 04:28:40 -04:00
Brandon Thomas a55af3b235 Merge pull request #1134 from vangel76/psd-simplify-dedupe
# Conflicts:
#	crates/psd/src/tests.rs
2026-10-13 04:28:39 -04:00
vangel76andClaude Sonnet 5.5 4a08f8fdf4 PSD: a memory budget for one decode and a capped smart-object bake (#1138)
The 2^28 pixel limit applied per image; one composite or layer decode kept
the ZIP output, a Vec<f32> per channel and the result alive together, and the
bake size came from the file's quad. A decode now charges every buffer
against a byte budget (4 GiB, 1 GiB on 32-bit), checks its whole expected peak
before allocating, writes channels straight into the result and returns an
error when over budget. Bakes are at most 4x the document across and 2^24
pixels.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-12 23:06:55 +02:00
vangel76andClaude Sonnet 5.5 35c5ff5fa1 PSD: avoid redundant plane copies, per-pixel mask tests and repeated quad solves (#1136)
Raw channels are borrowed, ZIP planes are un-predicted in place in the inflated buffer,
the 32-bit un-predictor uses one scratch row, the layer mask tests the rect per row
instead of per pixel (and skips a constant factor of 1.0), and a placed-layer bake
solves the quad once and hoists per-triangle invariants. Output is bit-identical;
tests compare against the replaced implementations and count the avoided work.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-12 23:03:35 +02:00
vangel76andClaude Sonnet 5.5 cf22417c1a PSD: share the duplicated decode, placed-transform and writer helpers (#1133)
One decode_plane for raw/RLE/ZIP (decode_channel and composite), placed::eight and
quad_from for the SoLd/PlLd transforms, the writer's big-endian and UTF-16 helpers
from descriptor.rs, one delimiter const in engine_data.rs, and the dead binding in
write.rs. No behaviour change; adds ZIP and RLE composite tests.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-12 22:58:31 +02:00
vangel76andClaude Sonnet 5.5 130bcb2385 PSD: drop non-finite values from descriptors, EngineData and 32-bit samples; no panic in Warp::apply or Rect::new (#1130)
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-12 22:57:27 +02:00
Brandon ThomasandClaude Opus 5.5 7b0a449c5f M13.6: PSD smart objects apply perspective quads and placed-layer warps
nonAffineTransform and the warp descriptor (named styles with bend / distortion, custom
envelope quilt meshes via ObAr meshPoints) are baked as placed over the placed bounds
(SourceLayer::placed), at up to 4x resolution.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-03 07:21:00 -04:00