Commit Graph
10641 Commits
Author SHA1 Message Date
FredApps 5ae31d3de2 fix(pdf): preserve editable import fidelity and bound caches 2026-11-08 16:58:06 +01:00
Triwarr 51174ad04e PDF: review fixes for shape caches and font registration
- Render each shape cache clipped to its own bounds instead of the full
  page clip.
- Copy embedded font bytes before locking the shared text engine and take
  the lock per font, not for the whole registration loop.
- Track seen font content keys in a HashSet instead of scanning the font
  list for every glyph; hash glyph text for fake-bold pairing instead of
  cloning strings.
- Update the module and `pdf-editable` feature docs to describe text and
  accepted no-op clips.
- Poll the cancellation watcher every 20 ms; Device callbacks only cover
  paints, so a single long path still needs the watcher.
2026-11-08 14:34:23 +01:00
Triwarr d39fc3f9cd PDF: fifth review round on editable import
- Accept explicitly closed page-sized clip rectangles (m l l l l h).
- Pair fake-bold strokes through a text/font/order index instead of a
  full scan, keeping the comparison cap and cancellation checks.
- Tests: solid zero-length stroke stays editable, explicit clip
  rectangle.
2026-11-08 11:29:05 +01:00
Triwarr bf21e370f4 PDF: fourth review round on editable import
- Count actual fake-bold comparisons toward the cap instead of the
  product of glyph and stroke counts.
- Fall back for any dashed zero-length subpath (open or closed); test
  covers a stroked line followed by a closed point.
- Handle invisible glyphs before the soft-mask check so hidden text
  does not rasterise the page.
2026-11-08 09:54:52 +01:00
Triwarr 0692a3cf47 PDF: third review round on editable import
- Bound fake-bold glyph/stroke pairing by comparison count and check
  cancellation during the scan.
- Keep both knots when a closing curve returns to its start; fall back
  for a dashed single-point subpath.
- Skip inkless runs (zero-width/format characters) instead of treating
  an empty cache as a render failure.
- Track soft masks and reject the page only when paint happens while one
  is active.
- Tests: fake-bold mismatch across a path, closing curve loop.
2026-11-08 08:21:19 +01:00
Triwarr b17c98f595 PDF: second review round on editable import
- A text cache that renders empty now falls back the page instead of
  leaving blank text.
- Fake-bold strokes pair only with fill glyphs at the same paint order.
- Retain single-point closed subpaths (round-cap dots) without emitting
  duplicate phantom points; test added.
- Device methods documented; paint-order test covers text on both sides
  of a path.
2026-11-08 07:17:09 +01:00
Triwarr a3778b4476 PDF: address editable-import review findings
- Colours: AlphaColor components are straight, not premultiplied; use
  them directly instead of dividing by alpha (the opacity test now
  checks RGB, not just alpha).
- Text: key families by font content key, not PostScript name, so two
  faces with one name cannot share a family. Keep text layers at the
  path index where their glyphs were painted instead of appending them
  after all paths.
- Correctness: reject bow-tie clip paths, start a new subpath after
  close, fall back on unparseable/unsupported glyph mappings, truncated
  content, failed font registration, and shape-cache budget exhaustion.
- Cancellation: check between text-cache renders as well as between
  objects.
- Include Bezier control points in the cache-size estimate; cache the
  content hash per Hayro font identity.
- Docs: ImportOptions/CLI help now describe editable text and the
  embedded-font caveat. Tests: text cache is not blank, paint order,
  bow-tie clip, line after close, cancellation between objects.
2026-11-08 06:14:24 +01:00
Triwarr d91ea1911e PDF: content-key embedded font aliases
- Always suffix an embedded face's alias with a hash of its bytes, so the
  same PostScript name from different documents cannot collide in the
  process-wide shared engine; a face imported twice reuses its entry.
  Registration is skipped when the alias or an installed full family is
  already present.
- Release the shared text engine lock between layers so a text-heavy
  import does not block the UI's layout for the whole cache loop.
- Test: two documents with one font name but different bytes get
  distinct aliases and both families are present in the shared engine.
2026-11-08 05:02:23 +01:00
Triwarr d1e95f57a8 PDF: share embedded fonts and tighten text checks
- Register imported fonts in photocraft_text::shared() so the app can
  re-lay text after edits or DPI changes. Prefer an installed full
  family, and register an embedded face under its PostScript name
  (key-suffixed when two faces share it) so a subset cannot shadow it.
- Warn that text using PDF-embedded fonts may change font when edited or
  reopened; the document format does not carry the bytes yet.
- Reject mirrored text and b == -c matrices; scale the tolerance by the
  em size so 90-degree text stays editable. Tests for rotated and
  mirrored text.
- Use pdfcer's 0.30 em line tolerance.
2026-11-08 05:02:23 +01:00
Triwarr a18268d0d3 PDF: editable text pass and review fixes
- Text: build one TextLayer per line/style run from the Device's glyph
  draws. Derive the family from the PostScript name (subset tag, style
  suffix, MT/PS, camel spacing); italic from the font flags/attributes
  or name; bold from the weight or name; pair fill+stroke glyphs as fake
  bold (Tr 2/6) instead of a second run.
- Require an embedded font with a PostScript name; standard-14/Type 1
  substitutes and Type 3 text fall back to the raster page.
- Register embedded font bytes in the text engine, use the family the
  font reports, and render text caches on import. Tests compare the
  text composite with the raster page.
- Review fixes: accept a page-sized no-op clip; draw zero-width strokes
  as 1 px hairlines and use 1 px as the dash base; reject non-uniform
  stroke transforms; repeat odd dash arrays and keep zero dashes;
  ExtGState ca/CA already reach the colour alpha (tested); note that
  catch_unwind only guards unwinding profiles.
2026-11-08 05:02:23 +01:00
Triwarr 80a254050b PDF: editable import step 1 - paths as shape layers
Add an experimental, opt-in PDF path importer on craft-pdf's interpret
Device. Fills and strokes become ShapeLayers in document pixels with
their real colours, widths and dash patterns; text, images, clipping
paths, transparency groups, patterns, soft masks and annotations keep
the raster page with a warning, so a page is never half imported.

- ImportOptions::pdf_editable (off by default) and --pdf-editable.
- pdf-editable Cargo feature in photocraft-io; the CLI enables it.
- Shape caches are rendered within a 256 MiB page budget.
- Cancellation is forwarded through a 5 ms watcher; hostile pages are
  caught and fall back instead of panicking.

Tests cover fill/stroke colours and dashes, composite parity with the
raster page, text fallback and cancellation.
2026-11-08 05:02:23 +01:00
FredApps aae9b7ea61 Merge pull request #11647 from Triwarr/pdf
PDF: import pages as artboards, export a page per artboard (+ recursive group export)
2026-11-08 05:01:46 +01:00
Triwarr 2d16a609ea Merge remote-tracking branch 'origin/main' into pdf
# Conflicts:
#	docs/scorecard.md
2026-11-08 03:48:47 +01:00
David Mann e04ecbdaa3 Merge pull request #10448 from qvest-ssels/feat/export-last-folder-10192
Export dialogs start in the last exported folder (#10192)
2026-11-08 03:45:55 +01:00
David Mann fda05f7b02 Regenerate docs/scorecard.md (merge queue)
On main + #10448, so main's gate stays green after the merge.
2026-11-08 03:45:37 +01:00
David Mann 62776f4b58 Merge branch 'main' into feat/export-last-folder-10192 (merge queue) 2026-11-08 03:45:33 +01:00
David Mann 420a9364e6 Merge pull request #10222 from aethelisdev/fix-wayland-drag-and-drop
ui-egui: support native file drag and drop on Wayland
2026-11-08 03:44:16 +01:00
David Mann b30c5c8095 Merge pull request #12142 from hectorviov/fix/star-tool
Toolbar: Star Tool in the shape slot between Polygon and Line (#11377)
2026-11-08 02:56:14 +01:00
David Mann ed893ea812 Merge pull request #12188 from davidmann4/fix/11909-bg-eraser-tolerance-field
Background Eraser: Tolerance takes whole numbers 1-100 with an alert, bar tooltips (#11909)
2026-11-08 02:54:43 +01:00
David Mann f28cf95c88 Merge pull request #11921 from davidmann4/fix/11733-color-sampler-context-menu
Color Sampler: right-click menu on the canvas (#11733)
2026-11-08 02:51:57 +01:00
David Mann 02abef5983 Merge pull request #11920 from davidmann4/fix/11907-bg-eraser-digit-keys
Background Eraser: number keys set the Tolerance (#11907)
2026-11-08 02:50:02 +01:00
David Mann 4a7d746c0a Merge pull request #11823 from davidmann4/fix/11812-brush-opacity-minimum
Brush: opacity minimum 1 % and "00" sets 100 % (#11812)
2026-11-08 02:49:28 +01:00
Triwarr 3ef91ec45a PDF: widen the dense-page cancellation margin
Raise the synthetic page to a million strokes so the 45 ms watcher
threshold keeps a wide margin on an optimised test build, and record why
the importer keeps one RenderCache per page.
2026-11-08 02:41:37 +01:00
David Mann 4da02a98a6 Merge pull request #9975 from ljkx/feat/cli-metadata-option
CLI: --metadata none|all leaves document XMP out of convert, run --out and batch exports (#9466)
2026-11-08 02:40:35 +01:00
Triwarr 1df674997b PDF: cancel dense pages, complete page labels, isolate artboards
- render_page: forward Interrupt to craft-pdf through an owned flag and a
  scoped 5 ms watcher, so dense vector pages stop mid-render.
- Warn when craft-pdf reports a substituted font (the backend does not emit
  the flag yet).
- /PageLabels: emit an entry for every page, start at 0, and write no tree
  when every artboard name is empty.
- Export budget: charge retained page data plus the largest page's two f32
  buffers instead of the whole document canvas, saturating on overflow.
- Render each artboard from a document holding only its group, so
  overlapping boards no longer paint on each other's pages. One document
  shell is cloned and reused.
- Tests: dense-page cancellation, labels with an empty middle name and all
  empty, overlapping artboard pixels, sparse 9000x9000 canvas, seven US
  Letter pages.
2026-11-08 02:34:58 +01:00
David MannandClaude Opus 5.5 caae1c8a1f Address CodeRabbit review: close the sampler menu when its sampler changes
The Color Sampler menu kept only the sampler's index. If a control
command deleted an earlier sampler while the menu was open, the index
named another sampler and Delete removed that one. The menu now also
remembers the active document and the sampler's position; when either
no longer matches, Delete greys out and the menu closes.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-08 02:19:35 +01:00
David Mann f27b78a75c Merge pull request #12080 from davidmann4/fix/cmyk-ref-rounding-tie
CMYK: the test reference keeps the source ink over nothing (#12079)
2026-11-08 01:52:54 +01:00
David Mann 9ac3fa22b2 Merge pull request #9280 from davidmann4/fix/crop-invalid-rect
Crop: refuse an invalid explicit rectangle instead of cropping to the selection (#9279)
2026-11-08 01:50:23 +01:00
David Mann 940b352ca0 Merge pull request #9256 from davidmann4/fix/scale-effects-bevel-texture
Scale Effects and Image Size scale Bevel & Emboss Texture's scale (#9254)
2026-11-08 01:50:08 +01:00
David Mann 2e9a1d267e Merge pull request #9233 from davidmann4/fix/crop-shift-letter-keys
Crop: Shift+H, Shift+P and Shift+I switch tools again (#9232)
2026-11-08 01:49:51 +01:00
David Mann 0059bd597e Merge pull request #3498 from davidmann4/feat/auto-219-8-panel-command-check
xtask: check that every panel button routes through a command id (#3495)
2026-11-08 01:48:45 +01:00
David Mann ce517049a7 Merge pull request #11221 from yoriswind/codex/transform-hit-zones-11097
Use whole-edge Free Transform handles and consistent rotate cursors
2026-11-08 01:41:27 +01:00
David Mann 5c1b628973 Merge pull request #9970 from ljkx/feat/photo-filter-last-settings
Photo Filter opens at its last settings (#9879)
2026-11-08 01:40:42 +01:00
50b877645f Merge origin/main into feat/cli-metadata-option (#9975)
Conflicts with main's --no-maximize-compatibility (#8064) in the CLI
export args, output mapping and dev-dependencies, and in the
file-format parity status line and revision history: both sides kept.

Co-Authored-By: ljkx <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-08 01:26:47 +01:00
Triwarr 0525197133 Merge remote-tracking branch 'origin/main' into pdf
# Conflicts:
#	docs/scorecard.md
2026-11-08 01:09:29 +01:00
David MannandClaude Opus 5.5 4750447f23 Floor an imported brush's opacity at 1 % when it is selected
Importing an .abr with select picked its first brush without the 1 %
opacity floor, so a preset saved at 0 % showed 1 % but painted nothing
(#11812).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-08 01:03:17 +01:00
David MannandClaude Opus 5.5 6547fadccd Floor a restored brush's opacity at 1 %
A brush remembered at 0 % opacity (saved before the 1 % floor) read back
at 0: the options bar showed 1 % but strokes painted nothing. Restoring
now floors opacity at 1 %, like tools.setBrush (#11812).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-08 01:24:18 +00:00
David Mann 1d9c654b3a Merge remote-tracking branch 'origin/main' into fix/11812-brush-opacity-minimum 2026-11-08 00:57:07 +00:00
David Mann 3aa1d9f432 Merge pull request #12164 from ElNeMeR70/fix/patch-sample-all-layers-default-on-12125
Patch tool: start Content-Aware Sample All Layers on (#12125)
2026-11-08 00:41:59 +01:00
Hector VillarrealandClaude Opus 5.5 fe13a8acc3 Star Tool test: the star layer keeps the tool's fill and stroke (maintainer suggestion)
Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-07 17:41:12 -06:00
Hector Villarreal de9e11df9b Toolbar: Star Tool in the shape slot between Polygon and Line (#11377) 2026-11-07 17:32:45 -06:00
47e14b5da2 Photo Filter keeps only Preserve Luminosity from its last OK (#9970)
#9970 reopened Image > Adjustments > Photo Filter... at the filter, colour,
density and Preserve Luminosity of its last OK. Measured in the reference
application: after OK at 60, 70 and 74 %, with a preset or with Color and a
custom colour, it reopens every time at Warming Filter (85), the orange
swatch and 25 %; only Preserve Luminosity carries over (off after an OK with
it off, on after an OK with it on). Opening now starts from the neutral
settings and takes just that one value from the last OK; Alt still reopens
at all the last settings (#8900). Tests and the ui-parity row follow the
measured behaviour.

Co-Authored-By: ljkx <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-08 00:30:59 +01:00
David Mann 153fcff8c3 Merge pull request #7121 from texjer/feat/camera-raw-sidecars
Camera Raw: Done saves the raws' settings to their sidecars without opening them
2026-11-08 00:30:42 +01:00
David Mann 36a754da5c Merge pull request #12173 from hectorviov/fix/sampler-drag-gestures
Color Sampler: a new point lands where the drag ends, markers follow the pointer, a click on a point moves it, Escape cancels (#11729)
2026-11-08 00:30:07 +01:00
David Mann 15be79be5e Merge pull request #9058 from Gotya-OFFCIAL/raw-hasselblad-3fr
raw: decode Hasselblad 3FR/FFF (X2D II 100C, uncompressed)
2026-11-08 00:29:05 +01:00
David Mann be26364ebc Merge pull request #12093 from yoriswind/codex/count-psd-resource-11759
Preserve Count groups in PSD resource 1080
2026-11-08 00:28:20 +01:00
David MannandClaude Opus 5.5 e6992a855d Background Eraser: a Tolerance set elsewhere wins over an interrupted edit (#11909)
The typed-text draft remembers the setting it was stored with and is only
used while that setting is unchanged, so a value set meanwhile (a tool
preset while the options bar was hidden) shows from the first frame.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-08 00:17:09 +01:00
David Mann 2da9714b74 Merge origin/main into feat/photo-filter-last-settings
# Conflicts:
#	crates/ui-egui/src/panels/smart_ui.rs
#	docs/ui-parity.md
2026-11-08 00:16:29 +01:00
David Mann 49eabafbcb Merge pull request #11238 from NaufalDzz/layer-filter-find-layers
Select › Find Layers opens the Layers panel's Name filter (#10884)
2026-11-08 00:13:30 +01:00
David Mann 5525dc41ae Merge pull request #9306 from FartmanAndBurps/contrib/work-path-live-preview
Smooth live preview for Work Path dragging
2026-11-08 00:12:23 +01:00