The ink compositor skipped a layer with no tiles in the rect whose default
pixel was all zeros, reading the last value as alpha. A CMYK layer without
an alpha channel defaults to no ink, which is opaque blank paper, so under
an adjustment (Threshold, Invert, ...) its untouched pixels composited as
transparent. Skip only surfaces with an alpha channel and a transparent
default, as `empty_in` does.
Skipping with_icon on .app bundles let eframe substitute its default glyph once
the window opened; pass IconData::default() so the bundle .icns stays in the Dock.
Co-authored-by: Cursor <cursoragent@cursor.com>
A complete catalog of 4,227 entries: every plain UI string, @id
command, @msg template, @plural pair and disambiguation context in the
key union, written from the meaning of the English labels in standard
Danish (Microsoft/Apple style, informal du, accented imperatives:
Installér, Annullér, Duplikér). Photo vocabulary follows Danish
Photoshop conventions: lag, pensel, markering, lærred, maske, kurve,
farveprøve.
One/other plural rule, as in German. The mixer-brush Flow reads
Gennemstrømning and bit depths hyphenate (8-bit), where the strict
coverage tests demand a visible difference from English. Registered in
the language list (21 -> 22) with da-DK locale matching.
transformed_text_lands_where_resvg_draws_it returned early, and passed
without checking anything, when the import found no font: it relied on
system fonts, and photocraft_text::CRAFT_FONTS is empty unless the build
sets CRAFT_FONTS_DIR. With the system fonts hidden it passed in 0.00 s.
It is now a unit test in src/svg.rs that parses through parse_with with
a font database holding only the bundled Inter Regular (always compiled
in), and renders its resvg reference from the same parse, so both sides
use the same face. An empty import is now a failure. It fails with the
#5334 fix reverted, and passes with the system fonts hidden.
Raised in review of #5334 by tanish2k09.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
#6462 left Mean, Variance, Standard Deviation, Skewness and Kurtosis 5–15%
slower than the old serial loop on one thread. The cause: `stat` matched on
the mode three times per pixel inside one shared loop. `combine` now picks
the statistic once and hands `combine_with` a closure with a constant mode,
so each statistic gets its own loop with the match folded away. The sample
buffers are sized to the layer count and filled by index instead of `push`,
which re-checked the capacity per sample.
Every output is bit for bit the same (121 hashes match main).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01FUAqfMqVHdoeDa2y68KQQw
On Windows 11 (winspool.drv 10.0.26100.9444) the custom_print_paper
test binary died with STATUS_ACCESS_VIOLATION. Its three tests open
the Print dialog at once, and each one lists printers: file.printers
calls craft_print::printers(), which opens each printer's PrintTicket
provider (PTOpenProvider). winspool creates a process-wide cache
without a lock the first time PTOpenProvider is called for a printer
whose provider is PrintConfig.dll. When two threads do this together,
winspool can leave its pointer to the cache on a freed object, and the
next caller enters that object's deleted critical section. The app can
make the same calls from two threads: the Print dialog on the UI
thread and a print job's worker.
print_cmds::with_spooler holds a process-wide lock around every call
PhotoCraft makes into craft-print that lists printers or reaches the
spooler or a driver: craft_print::printers and submit, and rgb's
printers, default_printer, page, print and settings_dialog. A panic
inside the lock does not block later callers. While a print job is
being handed to the spooler, File › Print waits for it before the
dialog opens.
Session::printer_source supplies the printers that file.printers,
file.print.printers and the Print dialog list, in place of the
spooler's. The tests that open Print or list printers set it, so they
no longer query the system's printers or load their drivers.
print_cmds::system_printer_listings counts the real listings, and the
dialog and print job tests assert that it stays 0. The app leaves
printer_source unset and lists the spooler's printers as before.
New tests: printer_listings_enter_the_spooler_one_thread_at_a_time
(eight threads list printers at once; it fails without the lock) and
a_panic_inside_the_spooler_does_not_block_later_callers.
Reveal in Finder on Linux opens the linked file's parent with xdg-open,
which launches whatever it is given. A link stored as `tool.jar/a.png`
names a file as its parent, so Reveal launched that file. Reveal now
refuses a parent that is not a folder.
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
With a single type offered the portal reports no filter, and the dialog opens on the stem (services::dialog_file_name), so accepting the name as shown returned a bare path: Swatches became a file named "Swatches" instead of "Swatches.aco" for the Swatches and preset-export flows. The sole filter's extensions are now used when the answer names no type this dialog offered; several types with no pick still add nothing, and an extension the user typed stays their own (with_chosen_type keeps one it recognises).
Tests: the mock portal answers the bare stem for a single filter and gets back Swatches.aco; chosen_type is also checked directly, so the rule is covered where no dbus-daemon exists to run the portal test.
open seeds width and height from the document, and open_layer replaced only the internal __w/__h, so the dialog showed and edited the document's size while the export used the layer's trimmed pixels: a 10x6 layer in a 40x30 document opened at 40x30, and editing one side started from the wrong value. In scale mode the fields now follow the layer's trimmed size; a remembered exact pixel size stays, because that is a size the user asked for.
Test: a 10x6 layer in a 40x30 document opens at 10x6, a remembered 50 percent at 5x3, and remembered pixels are untouched.
PHOTOCRAFT_PRESENT_MODE, PHOTOCRAFT_FRAME_LATENCY, PHOTOCRAFT_STROKE_TRACE, PHOTOCRAFT_IN_WINDOW_MENUS and the two automation roots are documented as the equivalent of the per-launch flags, and a per-launch flag makes a launch keep its own process. A launch that sets only variables left launch_options empty, so it handed its files to the running instance (or merely raised its window) and exited before any override was read. Those variables now count as the flags they stand for; empty and 0 mean off, as with PHOTOCRAFT_NEW_INSTANCE.
Test: each variable maps to its flag, a value that means off maps to nothing, and skip_reason names the flag.
`damage_since` had a case for the Image > Adjustments dialog but none for the
Properties panel's `live_adjust` preview, so every parameter change returned no
damage and recomposited the whole document — `gpu-full` at 24.0 MP.
That is what made #5778 a latency regression at 100 % zoom: it correctly stops
CPU-compositing a 1.5 MP proxy, but the full-size GPU composite replacing it is
per-pixel work and 24 MP of it costs more. The Properties path now gets what the
dialog had: a session-tagged key, the layer's area as damage, and of that only
what the view shows, catching up as the view moves.
Intel UHD P630, 24 MP document, 12 changes, medians:
v0.9.0 70.3 ms 1.5 MP CPU proxy
main 203.1 ms gpu-full, 24.0 MP
this 47.8 ms gpu-rect, 1.10 MP
Byte-identical to the full-refresh base on all 12 changes and across a pan.
25 % zoom and PHOTOCRAFT_CPU_COMPOSE are unchanged.
`live_region` does not narrow by the layer's mask: a reveal-all mask keeps its
coverage in the default pixel and reports empty content bounds, which emptied
the damage and froze the preview. Every adjustment layer has one.
- The worker thread shares its latest answer with the UI as a plain
Option<bool> behind a mutex, instead of a byte that needed encode and
decode helpers.
- Finding the user's config directory is its own small function.
- In freedesktop.rs, the two dense one-liners in without_portal are split
into named steps, and the parsers are pub(super) (ini_value private): only
the animations module uses them.
No change in behaviour.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Brings in 20 commits from main. Two conflicts, both in dependency lists:
- apps/photocraft-web/Cargo.toml: main added the web-sys DomRect feature; the
list is main's plus this branch's MediaQueryList.
- Cargo.lock: main's, with cargo adding back this branch's one line (the
desktop app's direct windows dependency).
docs/scorecard.md is regenerated; it differs from main only in UI-217-10.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
`compose::flatten` returns an empty buffer for canvases over MAX_RENDER_PIXELS.
Trim (Top Left) indexed `px[0]` of it and Duplicate › Merged Layers Only fed it
to `write_region`'s length assert: both panicked; Trim's other modes reported
"nothing to trim to". Both now return a "too large to flatten" error first.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The Type tools' drag box and the Move tool's layer marquee were drawn as
an upright screen rectangle through two mapped corners, while the
release creates a document-axis box (the text box, layer.selectInRect).
In a rotated view the preview and the result disagreed; at 45 degrees a
dragged square previewed as a sliver. Map the four document corners to
the screen instead, as the selection marquee does since #2512.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Testing on a 6000 × 4000 document found the proxy's sampling state computed
per pixel against every stroke segment: each stroke got slower, and an undo
tested 1.7 M pixels × 3000 segments on the UI thread, blocking it for over a
minute. The proxy is now painted as the engine paints the full-resolution
mask: the option's area and the fill area are sampled once at the proxy's
pixel centres (set_base), and each stroke is painted over them in order,
visiting only its own pixels (paint, restate_all), so a dab costs its segment
and a rebuild costs the strokes' areas.
Also from the same review:
- `edit.contentAwareFill {"ui": …}` with the workspace closed is an error
instead of a fill with the defaults (an agent polling the state after an
Esc added a fill per poll).
- The view sends one Down per press: the press is the stroke's first point
and the frames before egui's drag threshold are its next ones, instead of
drag_started() beginning the stroke over (the lasso lost its first points
the same way; the Zoom tool zoomed on every frame the button was held).
- The preview texture is box-averaged to the device's max_texture_side when
the plan's rectangle exceeds it (a 17000 px wide plan gave a validation
error every frame).
- A preview that fails counts as shown for that state (Preview::finish), so
it is reported once instead of restarting on every repaint.
- The view shows the document's visible layers composited (an Apply to a new
layer shows); the engine's limits on strokes, lasso edits and points hold
at the brush with a message instead of failing Apply; the footer is
Photoshop's reset, OK, Apply, Cancel on every platform; a leftover
`let _ = i;` is gone.
Tests: strokes painted once and equal to the engine's sampling area; `ui`
with the workspace closed; the first points of a stroke and a lasso through
egui_kittest; the preview texture at a 2048 limit; a failing preview
reported once; the view after Apply to a new layer; the limits at the brush.
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
When a type layer's text changed, build_txt2 replaced the layer's object in
Photoshop's own Txt2 block with a bare `<< /0 << /0 text /6 runs >> >>`:
no paragraph runs (/5), no view (/1, which names the object's frame) and none
of the style keys. Photoshop 27.10 quits while opening such a file
(layer_effects.psd after type.edit), as it refused stripped objects in #2374.
An edited object now starts from the file's object at its slot: the text is
replaced, the paragraph runs are remade one per paragraph of the new text,
and every other run array of the model (style runs, ...) is cut or extended
to the new length before the auto-kern modes are applied. The view and other
keys are kept; only the old text's glyph pen positions (/21) are dropped.
An object whose run arrays aren't shaped as Photoshop writes them still falls
back to a fresh one.
Test: text edited_text_keeps_the_files_txt2_object.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The hue2 block holds a colorize triplet at byte 4 and a master triplet at
byte 10. The writer copied the active triplet into both, so a Colorize hue of
200 also landed in the master slot (outside its -180..180 range) and toggling
Colorize in Photoshop showed the wrong values.
Write the active triplet at its own offset and Photoshop's defaults in the
other (colorize 30/25/0, master 0/0/0), with the colorize hue stored signed as
Photoshop does (200 -> -160). The reader maps a negative colorize hue back to
the model's 0..360.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
`liquify_ui::commit` discarded the results of
`layer.smartFilter.setParams` and `filter.liquify`. `PhotocraftApp::run`
showed a failed command's error in the status bar, but the control
channel answered `filter.liquify {"ui": {"commit": true}}` with
`{"committed": true}`. `commit` now returns the command's result, and
the control channel returns the error, as `gallery_ui::commit` does. The
dialog closes on OK whether or not the command succeeds, as the Filter
Gallery's does.
Two tests send OK through the control channel, one after the smart
filters are cleared and one after the layer is deleted. Each checks
that the dialog closed, the status bar shows the error, no history step
was added, and the control channel returned the error.