Commit Graph
62 Commits
Author SHA1 Message Date
FredApps 450d21647c Merge main preserving Unicode and vector regression modules 2026-11-18 18:34:41 +01:00
FredApps 7edb6b154a Merge pull request #3898 from FredApps/fix/786-psd-fixed-adjustments
psd: share fixed-binary adjustment readers
2026-11-18 22:05:40 +07:00
Dylan M. Taylor 292313f2a1 Merge pull request #3774 from storytold/cutover/shared-psd-packbits
psd: cut over recovery PackBits decoding to craft-psd
2026-11-18 09:13:46 -05:00
FredApps 1d823a01a1 psd: share fixed-binary adjustment readers 2026-11-18 15:12:01 +01:00
FredApps 67e6e27fa7 psd: share Unicode layer-name record framing 2026-11-18 14:27:17 +01:00
Dylan M. Taylor 47384980a4 psd: cover the shared PackBits row-limit error mapping
The recovery wrapper maps every non-decompress failure to Error::Invalid so a
limit refusal is never reported as truncated data. That arm had no test, which
left the changed lines under the coverage gate.
2026-11-18 07:44:01 -05:00
FredApps 82cf1b5c5e psd: align vector fixtures with fixed-size chunk lint 2026-11-18 13:39:15 +01:00
FredApps c149bb513f psd: read vector mask records through craft-psd 2026-11-18 13:19:34 +01:00
FredApps 49170cdf18 fix(psd): surface unsupported modern placements at import boundary 2026-11-18 09:43:01 +01:00
FredApps cb3f66e06c fix(psd): align local warp bounds with shared numeric contract 2026-11-18 09:36:47 +01:00
FredApps a1c1288b13 #3779: pin bounded PSD placement fixes and test app boundaries 2026-11-18 05:59:44 +01:00
FredApps cc5c5cb732 #3779: integrate reviewed shared PSD adapters with current main 2026-11-18 04:13:58 +01:00
Dylan M. Taylor d9ebc75707 Merge remote-tracking branch 'origin/main' into HEAD
# Conflicts:
#	Cargo.lock
#	Cargo.toml
2026-11-16 23:08:50 -05:00
FredApps 3bc3adb4e0 psd: parse descriptors and placed layers with craft-psd
Pin only craft-psd to craft-libs main 9fc471fc (includes #1887
parse_prefix and #1885 PackBits recovery). Mid-stream descriptor
reads use Descriptor::parse_prefix, mapped back to the public
effectcraft Descriptor/DValue types. SoLd/SoLE/PlLd placements come
from craft_psd::smart::SmartObject, including quiltWarp, and
render_placed bakes through craft_psd::FloatImage.

Pixel decode stays local until a follow-up can check unmatte parity
on composite_f32.
2026-11-16 16:15:25 +01:00
Dylan M. Taylor 9da73e9cf3 psd: delegate ZIP prediction reversal with budgeted scratch 2026-11-16 09:47:19 -05:00
Dylan M. Taylor d020ebd460 Integrate merged PSD writer and linked-file cutovers 2026-11-16 09:41:37 -05:00
FredApps ed8811d2d8 psd: parse linked files with craft-psd and pin past #1845
Repin only craft-psd to craft-libs main e836b6fd (includes #1845).
lnk2 / lnkD / lnk3 / lnkE records come from craft_psd::smart::linked_files;
payload ranges are shifted from the block back into the document bytes.
is_linked_layer_key is the deferral predicate.

Descriptors, placed objects, and pixel decode stay local until
craft-libs#1887 (parse_prefix) and #1885 (PackBits recovery) are on main.
2026-11-16 14:55:09 +01:00
Dylan M. Taylor 4b658873b7 psd: delegate bounded recovery PackBits rows to craft-psd 2026-11-16 08:34:11 -05:00
FredApps 4edbd480fb Merge remote-tracking branch 'upstream/main' into onee/i786-psd-writer-craft-psd 2026-11-16 14:20:51 +01:00
FredApps 7311b6574c psd: rustfmt write.rs to the workspace style
The previous commit had been formatted without rustfmt.toml
(use_small_heuristics = "Max"), so cargo fmt --check failed on the gate.
2026-11-16 13:30:21 +01:00
FredApps 952918aa02 psd: keep finite 32-bit color samples outside 0..1
Integer depths are still clamped. NaN and infinities use the same
mapping as the reader.
2026-11-16 12:59:44 +01:00
FredApps 7f9f0bc489 psd: record stray leading bytes before the layer block check, use craft-psd's long-length keys 2026-11-16 12:31:10 +01:00
FredApps 00bf6a06c9 psd: keep the luni block's bytes so exported files are unchanged 2026-11-16 12:30:10 +01:00
FredApps e9690b2c02 psd: walk top-level global blocks for the layer block repair 2026-11-16 12:17:28 +01:00
FredApps e51a805f4e psd: recover layers from a length-prefixed or fallback Lr16/Lr32 block 2026-11-16 12:04:22 +01:00
FredApps 49abf0b402 psd: write 32-bit layers in Lr32, wide RLE rows raw 2026-11-16 11:57:54 +01:00
FredApps 50f8cc3397 psd: write fixtures with craft_psd 2026-11-16 11:45:48 +01:00
FredApps 59671cfd29 psd: keep layers past a damaged resource, report an unreadable Lr16 block 2026-11-16 11:41:54 +01:00
FredApps 1cc80e7443 psd: read the document structure with craft_psd
Psd::parse reads the header, colour mode data, layer records with their
additional information and the global blocks with
craft_psd::PsdFile::from_source. Channel data and the merged image stay in
the document as ranges, and the linked-file blocks are left in the source.
A damaged layer section still opens as the merged image. The local 8BPS
section, record and block walkers are removed (storytold/craft-libs#786).
2026-11-16 11:33:33 +01:00
Dylan M. Taylor fd1df348c0 Formats: move EffectCraft format codecs to craft-libs 2026-11-12 05:33:48 +00:00
Dylan M. Taylor c6d5c62d5a PSD: bounded zip errors, budgeted prediction row, row-bounded PackBits, channel checks before the result (#2987)
* PSD: bounded zip errors, budgeted prediction row, row-bounded PackBits, channel checks before the result

A failed inflate was formatted with Debug, which prints the whole partial
output; only the status is kept. The 32-bit ZIP prediction scratch row was
allocated outside the decode budget; it is charged now. PackBits packets
were appended whole even past the row's end, growing the reserved plane;
they are cut at the row. The composite and layer decodes allocated the
document-sized result before checking that the channel data exists; the
compression and raw/RLE lengths are checked first.

* address review: check short ZIP composite data and the layer mask channel before allocating the result

* address review: drop the channel prechecks that rejected PSDs the lenient decode accepts; keep the allocation bounds
2026-11-11 14:39:19 -05:00
Brandon ThomasandClaude Opus 5.5 dc1f9eab74 Batch fixes: rustfmt, is_multiple_of in the Vegas test, drop a Swedish row #2718 retired
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-31 11:20:24 -04:00
Brandon ThomasandClaude Opus 5.5 5802cdc6a4 Follow-up to #2714: a thin bake isn't refused for triangle rounding
A 16384x1 output stacks every grid row onto one pixel row, so a sane warp
visits ~100x its pixels; allow each triangle about two grid cells (CodeRabbit).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-31 10:58:30 -04:00
marshiyar 4f8f4ff56e psd: cap the smart-object warp bake's rasterising work 2026-10-30 20:26:50 -07:00
Dylan M. Taylor 388ebc10ac Refactor psd for strict Clippy checks 2026-10-28 06:09:21 +00:00
aiongg 5c6375c7ea refactor(psd): move limits, model, parsing and pixel decoding out of lib.rs 2026-10-26 21:49:11 +00:00
aiongg 80453e8673 refactor(psd): move the test counters module to counters.rs 2026-10-26 21:49:11 +00:00
aiongg 140b8d911c refactor(psd): move tests_<topic>.rs files to src/tests/ 2026-10-26 21:49:11 +00:00
skylar taylor-barrick 69b9ce2bd1 M0.37: reconcile shared docking and qualify migration follow-up 2026-10-26 06:47:07 +01:00
skylar c16a628849 chore(deps): refresh safe dependency bumps
serde_json 1.0.154, proptest 1.12.0, objc2 0.6.5, winresource 0.1.34, pollster 1.0.1, miniz_oxide 0.9.1, linesweeper 0.5.0, lz4_flex 0.14.0, muda 0.21.2.
2026-10-25 16:36:21 -06:00
Brandon ThomasandClaude Opus 5.5 900b921dbf PSD: the optimisation tests use the reference decoder once #1137 and #1139 land together
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-13 04:47:52 -04:00
Brandon ThomasandClaude Opus 5.5 eb2b734059 PSD: take the integration branch's adapted non-finite test and psd_import formatting (#1149)
The six PSD PRs merged one by one leave #1131's test calling samples()/to_rgb(), which #1139
replaced; vangel76's integration draft #1149 has the adapted version.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-13 04:47:27 -04:00
vangel76andClaude Sonnet 5.5 02c412b835 PSD: release_bytes takes the buffer by value (clippy ptr_arg)
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-13 04:47:27 -04:00
vangel76andClaude Sonnet 5.5 5f4b3aee86 PSD integration test: deep groups + NaN text, damaged layer section, huge header under a small budget, on a 2 MiB stack
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-13 04:47:27 -04:00
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 b438cdd702 Merge pull request #1135 from vangel76/fix-psd-lenient-layer-section
# Conflicts:
#	crates/engine/src/psd_import.rs
#	crates/engine/src/tests_vector_import.rs
#	crates/psd/src/tests.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
Brandon Thomas e02c60c08a Merge pull request #1131 from vangel76/fix-psd-nonfinite-and-panic-paths
# Conflicts:
#	crates/psd/src/tests.rs
2026-10-13 04:28:31 -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