Commit Graph
3891 Commits
Author SHA1 Message Date
8208034bef Integration: Integrations prefs read leniently, dialog test and restart note (#4097)
- prefs_ui `unimplemented_preferences_are_hidden_from_the_dialog` still asserted the
  Integrations section is hidden, so test (ubuntu/windows) failed (FredApps' review).
  It now asserts both rows are visible; scratchDisks stays hidden.
- `integrations()` parsed the whole preferences file strictly, so one wrong-typed value
  anywhere (`{"interface":{"enableAnimations":"nope"},"integrations":{"allowAgentControl":false}}`)
  reset Allow Agent Control to on while the dialog (lenient load, #6611) showed it off.
  The section is now read on its own, and field by field when it doesn't read as a whole
  (a list like `[false]` reads as a whole, as in the app); a test compares it with the
  app's own load.
- Both rows are read only at launch: they say "Applies at next launch." like System Title Bar.
- Removed the stale "not by these yet" comment in HIDDEN_UNTIL_IMPLEMENTED.

Co-authored-by: Erica Franco <20589100+Erica4fr@users.noreply.github.com>
Co-authored-by: FredApps <153173854+FredApps@users.noreply.github.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-25 12:02:55 +01:00
David MannandClaude Opus 5.5 028d400454 Integration: merge main, resolve conflicts (#5128)
prefs.rs keeps main's demosaic default and the PR's write_xmp_sidecars, and
unhides the Camera Raw Defaults the PR makes live; the raw-open RawOpen built
without the dialog gains main's developed_with/demosaic; i18n and docs as
unions; docs/scorecard.md is regenerated in the fix-up.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-25 12:02:10 +01:00
Matt Van Horn cf1530a5ae Merge commit 'b0622d20' into fix/art-history-brush
# Conflicts:
#	crates/ui-egui/src/i18n/cs.tsv
#	crates/ui-egui/src/i18n/de.tsv
#	crates/ui-egui/src/i18n/el.tsv
#	crates/ui-egui/src/i18n/es.tsv
#	crates/ui-egui/src/i18n/fr.tsv
#	crates/ui-egui/src/i18n/hu.tsv
#	crates/ui-egui/src/i18n/id.tsv
#	crates/ui-egui/src/i18n/it.tsv
#	crates/ui-egui/src/i18n/ja.tsv
#	crates/ui-egui/src/i18n/ko.tsv
#	crates/ui-egui/src/i18n/nl.tsv
#	crates/ui-egui/src/i18n/pl.tsv
#	crates/ui-egui/src/i18n/pt-br.tsv
#	crates/ui-egui/src/i18n/ru.tsv
#	crates/ui-egui/src/i18n/sr.tsv
#	crates/ui-egui/src/i18n/tr.tsv
#	crates/ui-egui/src/i18n/uk.tsv
#	crates/ui-egui/src/i18n/vi.tsv
#	crates/ui-egui/src/i18n/zh-hans.tsv
#	crates/ui-egui/src/i18n/zh-hant.tsv
#	docs/scorecard.md
2026-10-25 03:25:22 -07:00
David Mann 8fd157afef Integration: merge main, resolve conflicts (#4097)
docs/scorecard.md regenerated with cargo xtask scorecard.
2026-10-25 11:15:07 +01:00
Matt Van Horn 9db1c705e4 Art History Brush: clip the source window and fix the tolerance default
Clip each dab's source window to the dab's bounds plus one pixel for
bilinear sampling, so a large brush no longer allocates and copies the
whole tile-plus-halo window for every tile it overlaps. Pixels are
unchanged; a new test stamps with an oversized halo and compares.

Tolerance is a percentage of the channel range, and the default is now
0 (paint everywhere), as in Photoshop. At the old default of 50 a dab
was skipped unless the history state differed by half the channel
range on average, so most strokes painted nothing. The difference
average now leaves alpha out, so an unchanged alpha no longer dilutes
a colour change. A stroke whose every dab falls under the tolerance
returns with no damage and records no history step.
2026-10-25 03:11:53 -07:00
ce6b831c03 Integration: Art History Brush tolerance, source window, History source (#1610)
- Tolerance defaulted to 50 and averaged alpha into the difference, so an
  ordinary edit (e.g. #c03030 -> #d04848) was never painted back, and a stroke
  that wrote nothing still left an empty History step. Photoshop's default is
  0; the difference is now the larger of the mean colour change and the
  alpha change (the Eraser keeps colour and lowers alpha), and a stroke that
  writes nothing is an error instead of an empty step.
- Each tile copied a source window of tile +- halo per dab: a leftward stroke
  or a curl across x = 64 read empty pixels there (seam), and a size-1000 click
  copied ~5e9 floats (11.9 s). The rotated read stays inside the dab, so it now
  samples the source directly; bilinear reads at pixel centres, so an
  unrotated dab copies the history pixel instead of a 2x2 blend.
- The brush used its own history lookup (state 0 by default): it now takes
  the History Brush's source (history.setSource, snapshots, refusal after a
  canvas size change).
- TOOL-213-20 is partial (8 of 10 styles, Area scales spacing); docs follow.

Co-authored-by: Matt Van Horn <455140+mvanhorn@users.noreply.github.com>
Co-authored-by: FredApps <153173854+FredApps@users.noreply.github.com>
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-25 11:11:50 +01:00
David MannandClaude Opus 5.5 87a9e65dfa Preferences: the Generator checkbox reads Enable Generator, as in Photoshop (#9392)
Preferences > Plug-ins derived the label from the key generatorEnabled
("Generator enabled"); Photoshop says "Enable Generator", which our own
Image Assets error already asks for. Override the label in humanize and
rename the catalog row in the 20 catalogs.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-25 10:59:45 +01:00
David MannandClaude Opus 5.5 e22699bb9f Actions: save and read the Lab Lightness channel as Lght (#9384)
Photoshop names a Lab document's Lightness channel Chnl.Lght and rejects
Chnl.Lmnc ("luminance") for Levels, Curves and Apply Image steps. Write
Lght, read Lght, and keep reading the Lmnc that earlier PhotoCraft wrote.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-25 10:40:03 +01:00
David Mann acd7e07252 Merge PR #4573: Interface: Animation Effects follows the system setting, or is on or off
Conflicts with #5547 (Animated Zoom) resolved in wheel_nav.rs, canvas.rs and
panels.rs: the Navigator and canvas pass both Animated Zoom and
!animations_off; with Animation Effects off, the sideways part of an
animated wheel zoom pans by the frame's own events folded by their
modifiers (#4573's unsmoothed scroll) instead of the plain-event raw.x,
so Ctrl + wheel still pans sideways there. #4573's modifier test runs
with Animated Zoom off and on.
2026-10-25 10:30:00 +01:00
David Mann bc0354db5d Merge PR #5547: fix(zoom): Restore smooth wheel zoom
# Conflicts:
#	crates/ui-egui/src/canvas.rs
#	crates/ui-egui/src/wheel_nav.rs
2026-10-25 10:25:30 +01:00
David MannandClaude Opus 5.5 d73c91133b Integration: merge main, resolve conflicts (#1610)
Translation catalogs keep main's strings plus the Art History Brush ones
(fr: main already has Area; hi: added the brush strings). docs/scorecard.md
regenerated.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-25 10:19:42 +01:00
David Mann b712de488d Merge PR #5504: Mode dropdowns for Clone Stamp, Pattern Stamp, History Brush, Healing and Paint Bucket
# Conflicts:
#	crates/ui-egui/src/blend_keys.rs
#	crates/ui-egui/src/distort_ui.rs
#	crates/ui-egui/src/panels.rs
#	docs/ui-parity.md
2026-10-25 10:18:08 +01:00
Vlad Grankovsky aeff534492 channels: bound scalar scratch work to selected regions 2026-10-25 09:02:16 +01:00
Vlad Grankovsky 9d81a15fd2 channels: fuse native tone edits and protect filter replay previews 2026-10-25 08:51:19 +01:00
aiongg 09c3954697 Panels: floating panels open in their own OS windows on the desktop
The desktop build enables craft-ui's native-windows feature; the web build
keeps floating panels in the page. Every floating window gets its own OS
window (Ctrl/Cmd-drag, Float Panel, a drop that floats, restored layouts),
except the Studio themes' Properties card, which stays over the canvas.
Wayland keeps floating windows in the main window by craft-ui's rule.

- window.panel.window {panel, native?} runs as craft-ui's command; the web
  refuses it, and so does the Studio card.
- Keys a panel window forwards run PhotoCraft's shortcuts in the same
  frame, clipboard events included; keys held there count as held.
- While a dialog or other modal is open, the panel windows take no input.
- Files dropped on a panel window open as documents.
- Ctrl+click is a secondary click in panel windows on macOS too.
- The canvas paints no tool cursor while another of the app's windows has
  the pointer.
2026-10-25 06:55:48 +00:00
VoiceLessQ 91e18fa45a paint: 13 more painting tools wrap across the canvas edges in Pattern Preview
Clone Stamp already wraps in Pattern Preview (#4997). Blur, Sharpen,
Smudge, Dodge, Burn, Sponge, Mixer Brush, Color Replacement, Background
Eraser, Pattern Stamp, History Brush, Healing Brush and Spot Healing now
take "wrap": true as well, and the canvas sends it while Pattern Preview
is on (#8883).

The sequential-dab tools run their dabs on WorkTiles, moved into
photocraft_paint::retouch and given a wrap tile: each canvas pixel is kept
once and read and written wherever it repeats, so a live stroke and its
commit still give the same pixels. The composite tools go through #4997's
periodic::Composite via one periodic::stroke helper. Spot Healing centres
its sampling window on the stroke, at most one canvas across.

With wrap off, every command takes the path it took before.
2026-10-25 02:50:50 -02:00
Hector VillarrealandClaude Opus 5.5 6f1164e034 fix(io, engine): Embed Color Profile writes sRGB for an untagged document (#9325)
An untagged document (a new one in the default working space, or a file
opened without a profile) is treated as sRGB (sGray for grayscale), but
Export As, Save As and Save for Web wrote no profile for it, so viewers
had to guess. Photoshop embeds sRGB IEC61966-2.1 for both a new and a
"Don't Color Manage" document when the profile is embedded.

A flat export to a format that carries profiles now tags an untagged
image with the profile assumed for its mode; the codec still leaves it
out when embedding is off, and formats without profiles are unchanged.
Save for Web does the same when Embed Color Profile is on.

Tests that relied on untagged exports carrying no profile (an EXIF
ColorSpace round trip, the Export As proxy-estimate premise, an Affinity
preview fixture, a WebP lossy check) now say so explicitly.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-24 22:40:40 -06:00
aiongg 03b67dae4a Panels: use craft-ui's docking workspace and commands
Repin every craft-libs crate to 2869b8cc. The customized layout is a
craft_ui::docking::Workspace; window.panel.*, window.workspace.* and
ui.dock parse as DockCommand and apply through it. Workspaces saved
before the version field load with their hidden panels, dock-back
places and collapsed groups.
2026-10-25 03:57:20 +00:00
DuBearteandClaude Opus 5.5 58b8308569 feat: type on a path follows its path when the path is edited (#9114)
Type on a path keeps its own path, but nothing could edit it: the path
tools showed and edited the work path it was made from, so the text
stayed put. Its own path is now Photoshop's Type Path: with the type
layer selected, Direct Selection (and the anchor tools) show and edit
it, the path.* commands take it with "name": "layer", path.list names
it "<layer> Type Path", and the type is laid along it again.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-24 23:40:58 -04:00
David MannandClaude Opus 5.5 b3f3146402 Artboards: cover Artboard from Layers / Group in the sampler test (#9302)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-25 03:23:22 +01:00
David MannandClaude Opus 5.5 e76b8d3fd4 Artboards: Color Sampler points follow the document when a board re-bases the canvas (#9302)
A board placed or moved left of / above the origin shifts the whole document
(fit_canvas), but no artboard path moved the Color Sampler points or the
painting symmetry, so they read other pixels afterwards. fit_canvas now returns
its shift and every caller moves both by it, as Canvas Size's sampler map does.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-25 03:13:16 +01:00
David MannandClaude Opus 5.5 e01fa8ba4e Image: Trim (Transparent Pixels) ignores alpha that rounds to 0 at the document's depth (#9299)
Trim tested the float composite's alpha for > 0, so a pixel the 8-bit image stores as
alpha 0 (e.g. alpha 1/255 on a 40 % layer) still counted as content and kept a margin.
Judge alpha against half a step of the document's depth (8/16 bit); 32 bit is unchanged.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-25 03:04:21 +01:00
David MannandClaude Opus 5.5 617d40d268 Address CodeRabbit review: only the exact own resolution passes, and keepPrintSize with it keeps the pixels (#9260)
An out-of-range value that merely rounded to the document's resolution as f32
was accepted, and keepPrintSize with an own resolution below 1 ppi resampled
the canvas against old.max(1.0), shrinking it to 1 x 1.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-25 02:30:33 +01:00
David MannandClaude Opus 5.5 46ac4fc8f3 Crop: refuse an invalid explicit rectangle instead of cropping to the selection (#9279)
image.crop built an explicit rectangle only when x, y, width and height were
all integers with width and height above 0; anything else fell back to the
selection's bounds, so width 0, a negative or string size, or only some of
the four keys cropped to the selection and reported success. A rectangle
that is passed (any of the four keys non-null) but incomplete or empty is now
a bad-params error and the document is unchanged; {} still crops to the
selection.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-25 02:28:59 +01:00
dotCooCoo a120492156 Smart objects: closing a document forgets its missing files, and updateChanged drops an older look
Session::close now forgets which of the document's linked files were
missing, so a document reopened with the same id lists none until the
next look. layer.smartObjects.updateChanged drops a look still running
on a worker thread, which stamped the files earlier and could clear a
missing file the command had just found.
2026-10-24 18:21:00 -07:00
Khawar Zamman Wani 066321f7dd fix(ui-egui): Path Operations review fixes from the RC
- Dragging every component with Path Selection moves the whole path
  (`shape.edit` move), so a live rectangle or ellipse stays live instead of
  losing its corner-radius widgets through `path.moveAnchors`.
- Esc and switching tools end a Pen draft with `pen_end`: a refused commit
  (a locked layer) keeps the path as the Work Path instead of retrying
  `shape.create` and the error on every frame. Return still keeps the draft
  to commit again.
- The first component always draws as Combine: `path.setOperation` leaves
  it alone (naming only it is refused), and the menu and + / - neither add
  a History step for it nor show another operation.
- Only Path Selection, which shows the component selection, changes the
  selected components; the Pen tools set the next path's operation.
2026-10-25 06:45:34 +05:30
skylartaylor 14c059c971 M0.37: migrate PhotoCraft to egui 0.37
Reconcile main 486afd82cc while preserving reviewed lifecycle, capture, IME and settings migrations. Include canonical dependency pins and the generated lockfile.

All nine CI stages passed: 11,580 passing test executions, zero failures and 91 ignored across 93 summaries. Native/browser acceptance and paired app performance remain open.
2026-10-25 02:14:31 +01:00
David MannandClaude Opus 5.5 d1353e90a7 Image Size: a document's own out-of-range resolution still passes (#9260)
An imported file can carry a resolution outside 1..30000 ppi (PNG pHYs 1 px/m, PSD 0, TIFF in
cm), and the Image Size dialog sends it back unchanged on OK; refusing it would block a plain
resize that worked before.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-25 02:05:42 +01:00
Vlad Grankovsky 15bf0873ba channels: support editing selected color channel sets 2026-10-25 02:02:10 +01:00
David MannandClaude Opus 5.5 9b84eebad8 Image Size: refuse a resolution outside 1..30000 ppi instead of clamping it (#9260)
`image.imageSize` read `resolution` as `as f32` and clamped it to 1..10000, so 1e39 (inf) silently
became 10000 ppi, -5 and 0 became 1 ppi, a string was ignored, and a valid 20000 ppi (allowed by
File > New, Bitmap and the dialog's own field) dropped to 10000. Parse it once like `image.crop`:
non-finite, non-number or outside 1..=MAX_RESOLUTION is an error and the document is untouched;
the keepPrintSize path uses the same value.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-25 02:50:06 +02: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
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 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 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
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
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
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
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
VladimirPozdnyakov d16841f2fb Merge remote-tracking branch 'upstream/main' into qol-type-hanging
# Conflicts:
#	crates/text/src/layout.rs
#	docs/scorecard.md
#	docs/ui-parity.md
#	scorecard/type.toml
2026-10-24 22:05:31 +03:00
Federico Olivares 2fdce3931a Merge main into the integration batch
Main split photocraft-cli into modules, so PR #8807's skip of Deselect with nothing selected is applied in document.rs and batch.rs, with its two tests in tests/it/cli.rs.
2026-10-24 15:43:40 -03:00
Federico Olivares cef6f786ea Address review of the integration batch
Reject invalid UTF-8 in a picked Variable Data Sets file, keep a bare + command in a Windows shortcut set, make the Solid Color preview, thumbnail and OK agree on CMYK inks, and composite Define Pattern a band of rows at a time.
2026-10-24 15:40:04 -03:00
aiongg 14a4ab9b3f Merge pull request #9167 from aiongg/cli-batch-7071
CLI integration batch: clap for photocraft-cli and the desktop app (#7071)
2026-10-24 14:31:21 -04:00
Hector VillarrealandClaude Opus 5.5 8ebb04999d Gradient Fill layer: default to Foreground to Transparent (#8708)
Layer › New Fill Layer › Gradient… without colours made an opaque
foreground-to-background gradient, so a new gradient fill hid everything
below it behind the background colour. Photoshop's Gradient Fill starts
from Foreground to Transparent: the foreground at both ends, its opacity
going from 100% to 0%. With no `to` colour the command now builds that
(colour stops plus transparency stops); an explicit `to` still makes a
two-colour gradient.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-24 11:54:24 -06:00
David MannandClaude Opus 5.5 cd047a3ddc Package: copy a linked file only when it is an image PhotoCraft can open
File › Package copied every linked file into Links and only then
relinked the packaged document, so a link to a file that can't be
placed left its copy behind and the package failed. Such a link is now
listed as missing and not copied, like the PSD export rule.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-10-24 19:12:31 +02:00
David MannandClaude Opus 5.5 e279d5c824 PSD export: keep linked and embedded copies of the same contents apart in the cache
Duplicates share a contents identity, so a linked and an embedded copy
of the same bytes shared one cached conversion: whichever was written
first decided for both. The cache key now includes whether the bytes
came from a link.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-10-24 18:58:09 +02:00
IvanandClaude Opus 5.5 f540d3f5e3 refactor(cli): parse photocraft-cli values into types at the boundary (#7071)
Step 3 of the issue: handlers get values that are already checked, so
a bad one is a clap usage error naming its flag (exit 2) and the
"bad --x" errors (exit 1) are gone.

- --quality is a u8 in 1..=100; --tga-bits, --dpx-bits and
  --dds-compression parse to photocraft_io's TgaBits, DpxBits and
  DdsCompression through their from_bits/from_name, and --tiff-compression
  and --jpeg-format to photocraft_codecs' TiffCompression and JpegFormat,
  refusing a bad one with a typed ValueError; serve --port is a u16. export_opts becomes `impl From<&ExportArgs> for ExportOptions`,
  which can't fail.
- run's --new and --params parse to serde_json::Value, so JSON that
  doesn't parse is a usage error; whether it is an object is still the
  command's to say (exit 1). The --cmd/--params pairing keeps using
  ArgMatches::indices_of, now over typed Step values.
- Paths are PathBufs (convert, info, run, batch, the control token
  file and automation roots), and run hands the OsStrings to clap
  instead of refusing non-Unicode up front: a Latin-1 file name works
  as a path (#1108), and one given as text is clap's usage error.
  load_actions_file takes a &Path, and photocraft_engine's same_file
  takes any AsRef<Path>, so convert's #7437 check compares the PathBufs.
- Rules live in the types: run needs exactly one of <FILE> or --new
  (ArgGroup "source") and a --cmd or --out ("work"); batch's --actions,
  --in and --out are required; --control-token conflicts with
  --control-token-file. The runtime checks and their messages are
  deleted. The automation crate's own token check stays, as it also
  sees PHOTOCRAFT_CONTROL_TOKEN(_FILE).

Tests changed for this: run_errors, quality_outside_1_to_100_is_refused,
dpx_converts_both_ways_with_the_bits_asked_for,
dds_converts_both_ways_with_the_compression_asked_for,
tga_bits_choose_the_targa_depth, jpeg_format_chooses_the_scans
(exit 2, the error names the flag) and
the #1108 test, now
a_non_unicode_path_is_taken_and_non_unicode_text_is_a_usage_error:
convert reads and writes such a file name end to end, while info opens
through the automation layer, whose paths must still be UTF-8, and
refuses it (exit 1). either_or_flags_are_usage_errors is new.

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-24 19:45:26 +03:00
IvanandClaude Opus 5.5 da11e381ba refactor(cli): reject repeated flags, use clap's --version (#7071)
The behaviour changes decided in step 0 of the issue:

- A repeated single-value flag is a usage error (exit 2) instead of
  the last one winning: args_override_self is gone, and with it the
  argument scan that found repeats for mcp and serve (#8035). --cmd and
  --params stay repeatable.
- A value starting with '-' was already written --out=-image.png or
  ./-image.png since the clap port (a flag can't be a value since
  #8035); this pins it, and that `--filter -1` still works and
  `--quality -1` is still refused by its range.
- The bare `version` subcommand is gone; clap's version flag prints
  the same `photocraft-cli <long version>` line for --version and now
  -V too. `help <subcommand>` stays.

clap's version wants a &'static str, so build_info gains
long_version_static, long_version worked out once in a OnceLock, next
to long_version. The desktop app will need the same in step 5.

flag_value_forms_and_repeats and top_level_help_version_and_no_arguments
now pin the new behaviour; a_value_starting_with_a_dash_is_written_with_equals
is new.

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-24 19:45:26 +03:00