Commit Graph
11425 Commits
Author SHA1 Message Date
Finn Newick 90841daaf7 Merge branch 'main' of https://github.com/storytold/photocraft into fix/codec-plausible-dims
# Conflicts:
#	crates/codecs/src/codecs/jpeg.rs
2026-10-25 01:49:12 +01:00
Federico Olivares c53d7d3984 Keep every pattern a render uses, add wasm limits and finish the legacy text style keys
A pattern past the per-call budget is converted under one lock and shared while in use, with a one-time warning, and the desktop budget keeps every pattern a call uses (1 GiB). The web build caps a pattern's working copy at 128 MiB and a call at 256 MiB, and the pattern readers reserve their memory fallibly on every target. The legacy text restyle writes and compares BaselineShift, FontCaps, FontBaseline, UnderlinePosition, StrikethroughPosition and the ligatures per run, keeps an automatic leading's own value, and import reads the legacy AutoKern; a corpus test edits the size in psd-tools' text.psd and checks the rest of the legacy object is unchanged.
2026-10-24 21:47:59 -03:00
Khawar Zamman Wani 154f7b377e Merge pull request #1 from aiongg/modal-wide-angle-9061
Adaptive Wide Angle is modal too
2026-10-25 06:17:37 +05:30
aiongg b4a297fe99 Merge pull request #9195 from aiongg/craft-jpeg-adopt
JPEG: open 12-bit and arithmetic-coded files through craft-jpeg (#4934, #5003)
2026-10-24 20:45:42 -04:00
DuBearteandClaude Opus 5.5 b13274419f feat: Artboard from Layers takes a size of your own (#9087)
layer.new.artboardFromLayers takes width and height: the board gets
that size from the layers' top left (0 or none keeps their bounds), and
Layer > New > Artboard from Layers... opens a dialog with Name,
Background, Color, Width and Height instead of running at once.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-24 20:41:22 -04:00
David Mann 0e2fe0e2d3 Merge remote-tracking branch 'origin/main' into fix/crop-drag-tool-switch 2026-10-25 02:40:21 +02:00
David MannandClaude Opus 5.5 60cd5002c4 Address CodeRabbit review: a tool switch mid-drag ends the crop gesture as a release would
A box drawn over the untouched default frame, or that frame resized by a handle, kept
`default_frame` set when another tool's key ended the drag, so leaving dropped the edit
instead of committing it. The release logic is now one function both paths run.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-10-25 02:40:19 +02:00
David MannandClaude Opus 5.5 42ec692355 Scale Effects and Image Size scale Bevel & Emboss Texture's scale (#9254)
Multiply BevelTexture::scale by the effects factor in scale_effects, as
Pattern Overlay's and a pattern Stroke's scale already are.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-25 02:34:00 +02:00
David MannandClaude Opus 5.5 79f9ff4cde Scale Effects and Image Size scale Bevel & Emboss Texture's scale (#9254)
scale_effects scaled Pattern Overlay's and a pattern Stroke's scale but left
Bevel & Emboss › Texture at its old size, so a texture aligned with the
overlay drifted after Scale Effects, Image Size or Crop W x H.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-25 02:28:49 +02:00
David MannandClaude Opus 5.5 5edb842c28 Merge main into fix/9137-control-click-coord-range
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-10-25 02:28:14 +02:00
Hector VillarrealandClaude Opus 5.5 41669ae873 fix(ui): a swatch click recolours selected type and shapes with any tool (#9238)
A swatch recoloured the selected type layers only with a Type tool, and
shape fills only with a shape or Pen tool. Photoshop 2025 recolours both
whatever the tool (measured with the Move and Brush tools); its Color
panel keeps to the tool-based rule, which is unchanged here.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-24 18:25:45 -06:00
David MannandClaude Opus 5.5 573579a322 Image Rotation: a flip reverses an Angle gradient fill's sweep (#9243)
An Angle gradient sweeps clockwise from its angle, so a mirror turns the sweep
anticlockwise: map_fill mirrored the angle and the centre offset but left
Reverse alone, and Flip Canvas showed the fill mirrored about the other axis.
Toggle Reverse for Angle gradients under any map with a negative determinant.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-25 02:21:53 +02:00
David Mann c09ecd2166 Merge remote-tracking branch 'origin/main' into HEAD 2026-10-25 02:12:05 +02:00
David MannandClaude Opus 5.5 42f3b0a567 Merge main into fix/5532-blend-separators
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-10-25 02:05:47 +02:00
David MannandClaude Opus 5.5 85eec7afaa Address CodeRabbit review: size_limit_psb off keeps Multichannel, Indexed and Bitmap as PSD
The layerless exporters took a plain limit and always ran fit_psd_size, so
an export with size_limit_psb off could still be promoted to PSB by size.
They now take an optional limit, None when the option is off.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-25 02:04:24 +02:00
David Mann 3e107e23f1 Merge remote-tracking branch 'origin/main' into HEAD 2026-10-25 02:00:26 +02:00
aiongg 3d0c176e80 JPEG: a craft-jpeg frame without scan data is refused before decoding 2026-10-25 00:00:01 +00:00
David MannandClaude Opus 5.5 5988587b22 Crop: check each key event's own Shift, so control-channel keys are covered (#9232)
Synthetic keys from the control channel carry their modifiers on the event
only; the frame's modifier state doesn't see them.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-25 01:49:50 +02:00
aiongg 703bc4c821 raster: a translated surface shares one rebuilt tile however many threads build it (#9230)
Workers that missed the shared-tile memo at the same time each built
and kept a copy, so the number of copies grew with the thread count and
translated_shares_tiles_rebuilt_from_shared_sources failed on machines
with 16 or more threads. Each worker now takes the tile stored first.
2026-10-24 19:49:00 -04:00
David MannandClaude Opus 5.5 239f5604a0 Crop: Shift+H, Shift+P and Shift+I switch tools again (#9232)
egui's consume_key ignores an extra Shift, so the Crop tool's plain H/P/I
checks also took Shift+H/P/I before the tool-switch loop saw them.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-25 01:31:26 +02:00
David MannandClaude Opus 5.5 1e75581a96 Crop: a tool switch during a frame drag ends the drag (#9223)
A tool key pressed while dragging the crop frame left crop.drag set when
the new tool's handler takes every event before the Crop tool's (Perspective
Crop, Ruler, Slice, Frame, Artboard), so the frame was neither committed on
leave nor cancelled. tool_event now ends the gesture before any handler runs.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-25 01:24:01 +02:00
aiongg ae368d5a61 JPEG: lossless and 12-bit progressive files are unsupported, not damaged 2026-10-24 23:20:40 +00:00
Federico Olivares 2475b10143 Merge main into the integration batch 2026-10-24 20:16:55 -03:00
Federico Olivares 11ae3d026c Address the maintainer's review of the pattern work
Align measures shape extents at the document's own sample type, a render keeps two of the largest patterns converted per call instead of rebuilding the second for every tile, a pattern too large to paint is named by every command that would use it, by pattern.list and by a PSD open warning, and a style-only edit restyles the older Photoshop's legacy text objects too, checked against the real psd-tools text.psd.
2026-10-24 20:13:56 -03:00
David MannandClaude Opus 5.5 b2b402939a Crop W x H budgets the hidden pixels it resamples (#9212)
image.crop's target size, Image Size and Bitmap's Output resolution budgeted
only the new canvas, but resample_doc scales every surface's whole content,
including the pixels a non-deleting crop kept outside the canvas. A 20 px
frame of a 2000 px image resampled to 2000 px tried to allocate 160 GB.
resample_doc now refuses, before touching the document, when the largest
surface it scales would pass the budget (at that surface's own bytes per
pixel). A failed compound (the turned crop) also rolls back the painting
symmetry its rotation moved.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-25 00:56:48 +02:00
David MannandClaude Opus 5.5 841af396b7 Crop: switching documents leaves the old document's view turned (#9202)
In default mode a turned crop frame turns its document's view. When
another document became active, cancel_stale's cancel turned only the
newly active view upright, so the old document kept the crop's turn
with no crop on it. Turn the crop document's own view upright first.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-10-25 00:36:15 +02:00
aiongg 48166f6ab3 Pin craft-jpeg to storytold craft-libs 6e7f285 2026-10-24 22:28:39 +00:00
aiongg 4198b9fa3b JPEG: follow craft-jpeg's review fixes (non_exhaustive Limits) 2026-10-24 22:06:38 +00:00
Hector VillarrealandClaude Opus 5.5 464715183d Font menu: reveal the current family without animating
CodeRabbit (discussion_r4368613885): the reveal pass used scroll_to_me,
which starts egui's default scroll animation, so a deep current family
stayed outside the popup for a moment after the menu opened. The reveal
now jumps (ScrollAnimation::none()); arrow steps keep the animation.

Test: open_menu_shows_the_current_family_without_animating turns a slow
scroll animation back on in the harness, which otherwise disables it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-24 16:01:25 -06:00
aiongg 486afd82cc Merge pull request #8994 from FinnNk/fix/cpu-canvas-centred-previews
fix(ui): centre size-changing filter previews on the CPU canvas
2026-10-24 17:56:16 -04:00
bfentyandbfenty 155d1eac36 ui: highlight menu rows while dragging with the button held (#9112)
Response::hovered is false while the primary button is down, so a
press-drag through a menu never moved the highlight and it desynced
from the cursor. Hit-test with contains_pointer, which keeps answering
while a button is held.

Closes #8887

Co-authored-by: bfenty <1398236+bfenty@users.noreply.github.com>
2026-10-24 17:55:20 -04:00
denstu473 fa253cb372 fix(ui): keep repeated Tab presses in text editing (#8889) (#9030)
egui queues focus navigation before the type tool consumes Tab. Removing the
key event leaves that navigation queued, allowing menu focus to block later
Tabs and ordinary text input. Cancel the queued move when inserting a tab.

Add a full-app input regression that fails on the second Tab before the fix
and verifies three Tab presses, caret positions, and subsequent typing.
2026-10-24 17:54:55 -04:00
aiongg be82b40e25 Merge pull request #9194 from 1Git2Clone/fix/cli-review-round
fix(cli): help after a mistake, and mcp/serve option notes in --help (#7071)
2026-10-24 17:53:00 -04:00
dotCooCoo 289cbc6ce0 Layers panel: the filter row lists linked, missing or embedded smart objects
The filter-type dropdown gains Smart Object, with three toggles: smart
objects linked to a file, linked to a file that was not there when the
app last looked, and embedded. Like the Kind toggles, the filter applies
once a toggle is on, and the panel lists the smart objects that match any
toggle that is on.

The two-second look at linked files now also records which files were
not there, and Session::missing_links returns them for the active
document. ui.set {layerFilter} takes by: "smartObject" and a smart list.
2026-10-24 14:49:50 -07:00
skylar taylor-barrick 1c5343d5f7 codecs: say what the second extra-plane check guarantees
The first comment claimed the check covers the Lab re-type, which happens later
in `write_image`. Say instead what the check actually adds: the planes are
validated in the sample type they now hold after `converted`, and a plane that
`Image::convert` took but could not rebuild arrives here empty rather than
retyped.
2026-10-24 15:43:33 -06:00
Davit MatchakhelidzeandClaude Opus 5.5 32d1563e6c Text: macOS's .SF Georgian among the Georgian fallback families
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01YMTAbGNRxnMEzRvYnQGphF
2026-10-25 01:42:35 +04:00
Hector VillarrealandClaude Opus 5.5 97ffc03c81 fix(ui): the font menu opens on the current family's recent row (#9160)
The open font menu marked the current family's alphabetical copy, even
when it also headed the recent group, and opened scrolled to the top
whatever the family, so the mark could be far out of view. As in
Photoshop, the current family is now marked in the recent group when it
is a recent one, the menu opens showing it (the recent group at the top,
else the family's row at the top of the view), and the arrows walk on
from the marked row. Applies to the options bar and the Character panel.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-24 15:33:56 -06:00
skylar taylor-barrick e2ecad7442 codecs: refuse TIFF extra samples that are not one sample per pixel
The public `ExtraSample` contract is one sample per pixel in the image's sample
type, but the writer only stopped when a requested slice was missing, so an
oversized plane was silently truncated and a short one was dropped mid-image.
`Image::convert` leaves a plane whose length does not match the image alone
(deliberately: importers drop such a plane with a warning), so encoding a Lab
F32 image also reinterpreted a wrong-sized plane at the file's 16 bits.

Check every plane against width * height * sample.bytes(), with checked
arithmetic, at both ends: on the source image before `converted` brings it to
the plan's sample type, and on the image actually written, which the Lab path
re-types. A plane of any other length is a CodecError::Encode naming the plane,
its length and the length the image needs.

Regressions: too long, too short and empty planes at 8 bits, and a 7- or 9-byte
plane for a two-pixel Lab F32 image, which the U16 conversion used to accept.
2026-10-24 15:32:54 -06:00
aiongg 16d355def4 Adaptive Wide Angle blocks other menu commands like the other full-window workspaces 2026-10-24 21:31:56 +00:00
skylar taylor-barrick b6835441dc Merge main into the TIFF extra-samples branch
Resolve the contributors/people.toml append conflict by keeping both sides:
main's three new entries and this branch's entry.
2026-10-24 15:29:53 -06:00
Federico Olivares 9f92ddd75b Hold large patterns at their own depth, return the batch to the pre-8000 code and fix the review blockers
Return the pattern code to the state before the earlier 8000 x 8000 attempts. A pattern that fits the compositor's 256 MiB cap is expanded as before; a larger 8-bit or 16-bit one is held as straight RGBA8 or RGBA16, exactly its values at 4 or 8 bytes a pixel, so Define Pattern's 8000 x 8000 paints at 8 bits. Define Pattern refuses an area the compositor could not hold with its limit, patterns whose RGBA32F texture passes 256 MiB paint on the CPU, shape bounds for Align keep full alpha precision, Define Pattern judges opacity on the stored samples, and a Halftone Gallery stack with an unknown setting beside its effect list stays verbatim.
2026-10-24 18:23:24 -03:00
aionggandMichael Higgins 7cf4e6eca0 JPEG: open 12-bit and arithmetic-coded files through craft-jpeg (#4934, #5003)
Arithmetic-coded frames (SOF9-SOF11) and SOF0/SOF1 frames whose precision
isn't 8 bits go to craft-jpeg; everything else stays on zune-jpeg. 12-bit
files open as 16-bit images. PhotoCraft's own marker scan still supplies
ICC, EXIF, XMP, resolution and Photoshop resources, and damaged or truncated
entropy data adds the Truncated warning. A truncated scan too short for the
frame it declares is refused, as on the zune-jpeg path.

craft-jpeg is pinned to the aiongg fork until it lands on storytold.

Co-authored-by: Michael Higgins <mhiggins217@gmail.com>
2026-10-24 21:19:48 +00:00
IvanandClaude Opus 5.5 9c56f5b9ca refactor(cli): type the mcp/serve option refusals (#7071)
The checks parse() runs after clap built their messages from a const
and two format! calls. ServerOptionError holds them as thiserror
variants beside ValueError, each with the clap ErrorKind it reports
as: the PHOTOCRAFT_CONTROL_PORT host:port refusal, bridge roots, and a
token flag without its transport. The output is unchanged.

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-25 00:16:23 +03:00
xsvm 6719f1813e Segmentation: anti-aliasing the full-resolution mask skips runs far from its edge (#8554)
* Segmentation: anti-aliasing the full-resolution mask skips runs far from its edge

Select Subject, Object Selection and Select Sky finish with antialias_u8
over the whole full-resolution mask, which read nine neighbours through a
bounds-checked closure for every pixel: 171-185 ms of an 800 ms first
Select Subject on 24 MP (ubuntu-latest, 4 cores). A run of 64 pixels whose
3x3 neighbourhood holds one value has no edge pixel, so it is only compared
now; other runs take the per-pixel rule as before. The output is byte for
byte the same, checked against the per-pixel rule over widths around the run
length, single rows and columns, discs, noise and stripes. Part of #211.

* Segmentation: the mask's anti-aliasing and its test share one per-pixel rule

The 3x3 rule moves into edge_value, which antialias_u8 calls for spans that
are not uniform and the test calls for every pixel, so the test checks only
that skipping never misses an edge pixel instead of keeping a second copy of
the rule. A small case pins the rule's values.
2026-10-24 17:13:24 -04:00
IvanandClaude Opus 5.5 487e18d726 fix(cli): help after a mistake, and mcp/serve option notes in --help (#7071)
The review round of the #7071 stack, which #9167 merged without
(it took the pre-review heads):

- A bare --help or -h before `--` is help after any parse error, not
  only after a missing value: `mcp stray.psd --help` and
  `serve --port abc --port 1 -h` print the subcommand's help.
- mcp and serve --help carry #8035's rules: what the automation roots
  grant, that bridge roots are refused, and that the token flags need
  --bridge or --port (or PHOTOCRAFT_CONTROL_PORT).
- check_server takes the subcommand and whether a transport is set;
  the bridge-roots check moves next to the other mcp checks.
- The server tests match clap's "a value is required for" text, and
  mcp.md in the book and docs names PHOTOCRAFT_CONTROL_PORT.

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-25 00:08:14 +03:00
Federico Olivares 66466d5dc7 Paint very large 8-bit patterns on the CPU and keep the GPU path as it was
The GPU path keeps its RGBA32F pattern textures and shader, and declines a pattern whose texture would pass 256 MiB so the CPU compositor, which holds an 8-bit pattern at 4 bytes a pixel, paints it. Add tests for the fallback, the pattern id staying the same when read in bands, and the paintable limits.
2026-10-24 17:19:09 -03:00
VladimirPozdnyakov 90bc4e0ca6 Two follow-ups from the re-review: the kerning runs once in the hung arms, and justify-all counts the growth once
- The hung center/right arms add kern_align back: their slack already
  deducts the line's kerning (each mark's trim carries the kern that
  moved it), so base's shift applied the kerning twice and parked hung
  lines left of centre on lines with manual/tab/optical kerning
  (hanging_centers_a_kerned_line_exactly).
- The justify-all slack is the drawn width once: extra already carries
  the horizontal-scale growth, so scaling adv counted it twice and left
  a 150% last line short of the box edge
  (justify_all_spreads_to_the_edge_exactly).
2026-10-24 23:07:36 +03:00
VladimirPozdnyakov 6143f8901e Merge main into the overflow-port branch; validate TextEdit initializations 2026-10-24 22:54:37 +03:00
Federico Olivares 43afacaecc Address the second review of the integration batch
Define Pattern accepts 8-bit patterns up to 8000 x 8000: an 8-bit pattern is held at 4 bytes a pixel by the compositor and the GPU, read in bands, and what is paintable follows the working-copy bytes. Shape bounds for Align keep full alpha precision, Define Pattern judges opacity on the stored samples, and a Halftone Gallery stack with an unknown setting beside its effect list stays verbatim.
2026-10-24 16:53:47 -03:00
Hector VillarrealandClaude Opus 5.5 0bf1d577bb Re-run CI
The Windows integration job aborted in photocraft-gpu::it
parity::fills_and_dissolve on the runner's software Dx12 driver; this PR
doesn't touch the GPU crate.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-24 13:44:31 -06:00