Commit Graph
759 Commits
Author SHA1 Message Date
aiongg 2b1c6b93c3 Merge main into split-filter-adjust-crop-fx-builders
crop_ui.rs moved to tools/; the PR's builders replace main's Clippy extractions of the same code; #6723's Color Lookup save carried into the moved encoder.
2026-10-28 04:22:40 +00:00
Dylan M. Taylor ab9b27b80d Restore rationale comments dropped by the Clippy refactors 2026-10-28 02:13:42 +00:00
Dylan M. Taylor 163caeb86b Make the PSD size-limit test fail when a size-based PSB promotion happens 2026-10-28 02:13:42 +00:00
Dylan M. Taylor 63eb3eabe4 Drop the unused band_rows export and its dead_code allow from io 2026-10-28 02:13:42 +00:00
Dylan M. Taylor 1a3415608b Restore the PSD frame stroke import after the io refactor 2026-10-28 01:49:51 +00:00
Dylan M. Taylor 2a3135d796 Refactor io for strict Clippy checks 2026-10-27 23:47:06 +00:00
David MannandClaude Opus 5.5 5ccb6fb723 Merge main
Conflicts with main's batch #9880:
- psd file.rs / layer.rs: #5287 (PSB by encoded size, RLE tables widened on
  promotion) against #6583's lazy reader. Main's new widening and length code
  read `.data`, which #6583 leaves empty while the bytes stay in the source;
  it now goes through `encoded()` / `encoded_len()` (also the auto-merged
  lines in `rle_widening`, `encoded_len` and `LayerRecord::write`), and the
  lazy reader sets `write_as_psb: false`. New test
  `a_lazy_psd_promotes_to_the_same_psb_as_an_eager_one`: a lazily read PSD
  writes the same PSB bytes as an eager one; it fails with a `.data` read.
- direct_select.rs / vector_ui.rs: #9321's Type Path and #6353's hidden
  Work Path both kept.
- io tests main.rs: both modules. scorecard.md regenerated (12 of 181);
  ui-parity.md and gaps.md follow it.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-10-27 19:49:42 +01:00
David Mann 8bc71f924b Merge main
# Conflicts:
#	crates/format/src/store.rs
2026-10-27 19:10:28 +01:00
aiongg 0e3a6f7e8d Merge #9421: XML: deeply nested ORA, KRA, Camera Raw XMP, .kys and layer XMP are an error, not a crash (#9419) 2026-10-27 17:44:23 +00:00
aiongg 3e0ec5004c Merge #9398: SVG: an embedded data-URL SVG gets the nesting-depth check (#9397) 2026-10-27 17:44:19 +00:00
aiongg fa86237e63 Merge #7154: Paste: a drawing copied as SVG markup pastes its pixels 2026-10-27 17:44:07 +00:00
aiongg 6e9fb30dbc Merge #6723: Color Lookup: PSD save keeps a .3dl/.look LUT file as loaded (#6544) 2026-10-27 17:44:05 +00:00
aiongg bf825aa490 Merge #6303: PSD: Diffuse, Trace Contour, Crystallize and Pointillize smart filters open and save like Photoshop (#6302) 2026-10-27 17:44:02 +00:00
aiongg 01594f1f25 Merge #5890: PSD: Frame layers keep their stroke (#4381) 2026-10-27 17:44:01 +00:00
aiongg 0c64f0b642 Merge #5287: PSD save: choose PSB by the encoded size, not the raw estimate (#5285) 2026-10-27 17:43:57 +00:00
NetterSilverandClaude Opus 5.5 b23eabf60c Write the PSD merged image and 8-bit layer planes in place
merged_planes scanned each composite band twice on the calling thread
for alpha, encoded every range into per-channel Vecs one push at a time,
then copied them into the planes. The workers now write their slice of
every plane directly, check alpha as they go, and run a loop
monomorphised per sample type. The 8-bit deinterleave of layer pixels
used one thread per channel with a strided iterator; it now splits the
pixels into one band per core and writes each plane's slice in place.
Same arithmetic, same bytes; a test pins merged_planes against the
previous per-band implementation for RGB, Gray, Lab and CMYK at 8, 16
and 32 bits, with and without the matte.

bench_export .psd, 36 MP, 3 layers, 16 interleaved rounds of 7 reps
(median of medians / min), Ryzen 16 threads, Linux:
  709.4 / 413.7 ms -> 540.8 / 318.9 ms  (-24 % / -23 %)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-27 16:42:16 +01:00
David Mann 3a689f217c Merge remote-tracking branch 'origin/main' into HEAD
# Conflicts:
#	crates/engine/src/file_cmds.rs
#	crates/engine/src/retouch_cmds.rs
#	crates/engine/src/vector_cmds.rs
#	crates/io/src/psd_export.rs
#	crates/io/src/psd_import.rs
#	crates/io/src/smart_map.rs
#	crates/psd/src/layer.rs
#	crates/raster/src/lib.rs
#	crates/ui-egui/src/camera_raw_ui.rs
#	crates/ui-egui/src/canvas.rs
#	crates/ui-egui/src/filter_dialog.rs
#	crates/ui-egui/src/gpu_canvas.rs
#	crates/ui-egui/src/panels.rs
#	crates/ui-egui/src/retouch_ui.rs
#	crates/ui-egui/src/transform_tool.rs
#	crates/ui-egui/src/vector_ui.rs
#	docs/gaps.md
2026-10-27 14:26:26 +01:00
dotCooCoo 655a81fc92 Merge main and accept SVG clipboard text after long XML preambles 2026-10-27 06:20:02 -07:00
David Mann 3e15ea9eb9 Merge remote-tracking branch 'origin/main' into HEAD
# Conflicts:
#	crates/compose/src/adjust.rs
#	crates/gpu/src/plan.rs
#	crates/io/src/adjust_map.rs
2026-10-27 14:19:34 +01:00
David Mann 2363c475c0 Merge remote-tracking branch 'origin/main' into HEAD
# Conflicts:
#	crates/compose/src/lib.rs
#	crates/gpu/src/plan.rs
2026-10-27 14:17:25 +01:00
David Mann 80a2fdef92 Merge remote-tracking branch 'origin/main' into HEAD
# Conflicts:
#	crates/io/src/smart_map.rs
2026-10-27 14:15:23 +01:00
David Mann c14a707d2a Merge PR #6583: PSD/PSB open without reading the whole file: channel data read as decoded, in bands into tiles (#5106)
Merged at the fix-up commit before its main merge (362947695d); the
conflicts with the batch are resolved here: psd_import.rs keeps both
sides' tests, tiff_layers.rs takes ImageData::new.
2026-10-27 13:50:37 +01:00
NetterSilverandClaude Opus 5.5 90efa9a114 Add an export benchmark for .pcraft, PSD and flat formats
`cargo run --release -p photocraft-io --example bench_export` builds a
36 MP photo document (the opened photo, a painted layer, a soft
half-transparent layer) and times `photocraft_io::export` for .psd,
.pcraft (with and without the per-document export cache the app's Save
uses), TIFF, PNG and JPEG: median and min of --reps runs. --out DIR
writes each format's bytes so two builds' output can be compared.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-27 12:29:59 +01:00
David MannandClaude Opus 5.5 3dd3bb85f3 Merge main into fix/xml-nesting-cap
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-27 03:08:19 +01:00
David MannandClaude Opus 5.5 f428433ccb Merge main into fix/psd-size-encoded
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-27 02:59:27 +01:00
David MannandClaude Opus 5.5 1aea520792 Merge main into fix/svg-subimage-depth
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-27 02:38:34 +01:00
David Mann 63e2c7d100 Merge PR #9031: fix(io): preserve Halftone Pattern smart filters in PSD/PSB
# Conflicts:
#	docs/file-format-parity.md
#	docs/gaps.md
2026-10-27 02:23:29 +01:00
714b8f304d Integration: the reference application's Halftone Pattern keys HlSz/ScrT (#9031)
The PR read and wrote Halftone Pattern as `Sz  ` and `Ptrn` (enum `HlfT`:
`Dt  `/`Crc `/`Ln  `). The reference application's Filter Gallery uses `HlSz`
for the size and a `ScrT` enum (`ScrD` dot, `ScrC` circle, `ScrL` line), so a
Halftone Pattern saved there still opened as an opaque filter, and one we saved
lost its size and pattern there without a warning. The tests built their fixture
with the same keys as the code, so they passed either way.

Now the keys match, a default Halftone Pattern (HlSz 1, Cntr 5, ScrD) opens as
{size 1, contrast 5, dot} (fails before this commit), and descriptors with the
old keys stay verbatim. The docs no longer claim reopen checks in the reference
application.

Co-authored-by: denstu473 <63150090+denstu473@users.noreply.github.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-27 02:20:49 +01:00
053f0b7198 Integration: level 3 instead of fast() under zlib-rs, io test into tests/it (#7689)
zlib-rs maps level 1 to deflate_quick, which writes static Huffman blocks
only, so every Compression::fast() caller (PDF export and print, brush
presets, PNG Fast) wrote 5-32% bigger streams than miniz's level 1 did.
Level 3 is the lowest level that is never bigger than miniz level 1 on the
docs/images photos, raw and Up-filtered (level 2 was +0.9% on one); it is
0-16% smaller and takes 1.2-3.4 times as long. The new test exports a
noisy-gradient RGB document as PDF and checks the image stream against
miniz level 1 of the same samples: 603007 vs 547315 bytes with fast(),
passes with level 3. The PR's doc no longer says the levels are unchanged.

Main moved the io integration tests into crates/io/tests/it/, so the new
deflate_compatibility.rs moves there and uses crate::common.

Co-authored-by: Rene Leonhardt <65483435+reneleonhardt@users.noreply.github.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-27 02:12:13 +01:00
David Mann cd485b6c2c Merge remote-tracking branch 'origin/main' into pr-7689-fixup 2026-10-27 01:54:27 +01:00
aiongg 9cfb3cc5b0 refactor(io): split smart_map.rs into smart_map/ 2026-10-26 22:54:56 +00:00
aiongg 2aa88b0956 refactor(io): split psd_export.rs into psd_export/ 2026-10-26 22:54:56 +00:00
aiongg 3867f093ac refactor(io): move effects_map.rs tests to effects_map/tests.rs 2026-10-26 22:30:13 +00:00
aiongg b99e48bee6 refactor(io): move psd_import.rs tests to psd_import/tests.rs 2026-10-26 22:30:13 +00:00
aiongg a3f6259491 refactor(io): move adjust_map.rs tests to adjust_map/tests.rs 2026-10-26 22:30:13 +00:00
aiongg 7c22f7bfe8 refactor(io): move svg.rs tests to svg/tests.rs 2026-10-26 22:30:13 +00:00
aiongg 3f92c5d4ac refactor(io): move psd_export.rs tests to psd_export/tests.rs 2026-10-26 22:30:13 +00:00
aiongg 8f78e623e7 refactor(io): move camera_raw_map.rs tests to camera_raw_map/tests.rs 2026-10-26 22:30:13 +00:00
aiongg a56cb885b8 refactor(io): move blocks.rs more_tests to blocks/more_tests.rs 2026-10-26 22:30:13 +00:00
aiongg 8b25e3f81b refactor(io): move blocks.rs tests to blocks/tests.rs 2026-10-26 22:30:13 +00:00
aiongg 893acab66b refactor(io): move smart_map tests to src/smart_map/tests.rs 2026-10-26 22:13:07 +00:00
David Mann 01adff1e5c Merge remote-tracking branch 'origin/main' into HEAD
# Conflicts:
#	crates/io/src/psd_export.rs
#	crates/io/src/tiff_layers.rs
2026-10-26 14:32:07 +01:00
David Mann 7e4ceba5df Merge remote-tracking branch 'origin/main' into HEAD
# Conflicts:
#	crates/cms/src/lutfile.rs
2026-10-26 14:26:50 +01:00
aiongg cece50d513 Merge pull request #9386 from davidmann4/integration-batch-8
Integration batch 8: 37 reviewed community PRs on main
2026-10-25 20:04:41 -04:00
Dylan M. Taylor 3877bb1dbe chore: resolve SonarCloud maintainability issues (#9044)
* chore: resolve SonarCloud maintainability issues

* fix: format imports and fix effect_entry argument type

* fix: restore test closure and wildcard import that broke compilation

* refactor: split composite_to_surface to reduce cognitive complexity
2026-10-25 19:38:31 -04:00
Phil TrinhandClaude Opus 5.5 4915f0970e PSD/PSB open without reading the whole file: channel data read as it is decoded, in bands straight into tiles (#5106)
Opening a 2.14 GB PSD (2000×2000, 109 layers, 821 MB of embedded smart objects) peaked at
7.28 GB and took 6.8 s; it now peaks at 3.00 GB and takes 3.6 s (macOS peak memory footprint,
`cargo run --release -p photocraft-io --example psd_open_mem`).

- photocraft-psd: `PsdFile::from_source` parses from a `ReadAt` source (`FileSource`: pread /
  seek_read in bounded reads). Channel data and the merged image become `Stored` ranges read
  when decoded; the model equals `from_bytes`'s and writes back the same bytes (tests compare
  the two on every generated file, including Lr16/Lr32 layer blocks and truncated files).
- `ChannelData::row_decoder` decodes any band of rows: RLE via its row table (a stored channel
  reads only the band's bytes), raw by offset, ZIP inflated once.
- photocraft-io: `import_file` opens a path; PSD/PSB through `from_source`, other formats read
  whole. Layers decode in bands of whole tile rows (~32 MB) into tiles: no whole-layer plane or
  interleaved buffer. Global blocks move into the document instead of being copied; finding an
  embedded smart object no longer copies every file in `lnk2`.
- photocraft-raster: `Surface::share_uniform_tiles` + `TileInterner`; the PSD import shares
  single-value tiles (backgrounds, fill caches, masks) across layers.
- The background open job and the CLI/MCP (`automation::files::open`) use `import_file`.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-26 02:37:20 +08:00
David MannandClaude Opus 5.5 38609e5615 Merge PR #8885: PSD: spot channels in Photoshop's polarity; PSDs from earlier PhotoCraft versions keep their ink
Merged with our fix-up branch pr-8885-fixup (8f6863f53) on the author's head 996b55eb4.

Conflicts resolved:
- crates/io/src/tiff_layers.rs: #9148's tiff_source (an empty LMsk gets Photoshop's 14 bytes)
  gives way to #8885's tiff_image_source, which writes the same bytes for an empty or short
  LMsk; #9148's test stays.
- crates/io/src/flat.rs: #8776's DDS alpha step and #8885's TIFF channel stamp both run.
- crates/io/Cargo.toml, Cargo.lock: #8402's zune dev-deps and #8885's tiff dev-dep.
- crates/io/tests/it/tiff_layers.rs, docs: unions; docs/scorecard.md kept as is, regenerated at
  the batch gate.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-25 16:28:00 +01:00
David MannandClaude Opus 5.5 14693eb085 Integration: merge main 528491f9a, resolve conflicts
- crates/engine/src/edit_cmds.rs: copy_mask keeps #3297's filter-mask target and takes main's
  clipboard `source` (#8945).
- crates/cms/src/lutfile.rs: #9183's shaper doc comment next to main's UTF-16 decode_text (#9129).
- contributors/people.toml, docs: unions.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-25 16:26:06 +01:00
8f6863f536 Integration: a kept 1053 doesn't hide an earlier PhotoCraft's spot ink (#8885)
Earlier PhotoCraft versions kept the 1053 of a Photoshop file they opened
and wrote it back unchanged, while storing spot channels added there
straight. A transparent Photoshop document carries 1053 = [0], so a white
plate added to it in 0.16.0 or earlier sat behind a 1053, and the rule
read that file in Photoshop's polarity: the added spot opened inverted.

A 1053 that lists fewer channels (non-zero ids; 0 is the transparency's)
than the file has after its transparency now counts as kept, with the
PhotoCraft 1057 and DisplayInfo spot conditions unchanged. Planes the
kept 1053 lists stay in Photoshop's polarity (they are the Photoshop
file's own); the ones after them are read straight. Photoshop and this
version write one id per extra channel, so their files are unaffected.
Known limit, as before: channels reordered there, or as many deleted as
added, can't be told apart from the Photoshop file's own.

The earlier versions are 0.1.0 to 0.16.0, not 0.11.1: every release
since writes the same 1057 and straight spot planes without a 1053.

Co-authored-by: jasallen <615848+jasallen@users.noreply.github.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-25 16:22:13 +01:00
David MannandClaude Opus 5.5 4365c0537d Integration: merge main, resolve conflicts (#8885)
psd_import.rs keeps main's warning for an incomplete merged extra channel
next to the PR's Photoshop spot polarity. people.toml takes main's entries
plus jasallen's own. Docs take both sides' status lines and revision rows;
docs/scorecard.md is regenerated.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-25 16:07:44 +01:00