Photoshop's Type tool turns a click inside a closed path into area type
and a click on a path outline into type on the path from that point; a
drag still makes a text box and the Type Mask tools ignore paths. The
path is the active shape layer's, else the work path. Create and fill
share the edit session's coalesce key, so the click is one undo step.
The pointer shows the area-type or path-type cursor over a path, and an
open area-type edit draws the shape's outline.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Main's proxy_document now scales a smart object's placement, perspective and
filter mask with the proxy (#5779). The smart-edit preview still did it again,
so a reduced preview drew the object and its mask at a quarter size
(reduced_preview_scales_placement_stack_and_mask_without_adding_filters).
Only the filter lengths and the mask's feather are left to scale here.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The theme no longer decides the Color panel's layout: Photoshop's themes used to
get the stretched spectrum field, the others a short field with HSB sliders.
The panel menu now picks it, as in Photoshop: Hue Cube (default), Brightness
Cube, Color Wheel, and Grayscale, RGB, HSB, CMYK, Lab and Web Color sliders over
a colour ramp, plus Copy Color as HTML / Hex Code, the ramp choices (RGB and
CMYK Spectrum, Grayscale Ramp, Current Colors) and Make Ramp Web Safe.
- Slider rows: label, gradient track with a triangle thumb, field and unit; the
out-of-gamut and web-colour alerts sit under the chips. Web sliders snap to
web steps and take hex. Typed HSB, CMYK and Lab values are kept while they
still give the colour.
- Ramp: fills the group, white and black boxes at its end; Shift-click cycles
the ramps, Alt-click picks the other colour, right-click opens its menu.
- Color Wheel: HSB sliders over a hue ring and a rotating saturation/brightness
triangle, with an add-to-swatches button.
- The choice is saved in UI state; `ui.set colorPanel` merges and takes `mode`,
`ramp` and `webSafeRamp`.
- Menu strings in all 20 complete catalogs; UI-217-17 done in the scorecard,
ui-parity, gaps and control-protocol docs.
Closes#6000. Closes#2569.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01HJVuULF2tg9pN2x4VJoED1
The skip test compared a too-wide line with the shape's bounding-box
width. In a shape made of separate parts (two side-by-side bubbles, a U,
rows split by holes) a word narrower than the box but wider than every
real span was skipped span after span until it fell off the bottom, and
it and everything after it was hidden. A line now moves only to the
first later span (from the shape's real rows) that holds it; otherwise
it overflows its span, as box text does.
Rows don't depend on the text, so they are found once per plan and
shared by every pass, and a skip jumps straight to the span that fits.
Rows are planned with the paragraph's real metrics, measured on the
unwrapped paragraph (the max over its wrapped lines), so the second
"re-plan" pass is gone; output matches the old re-plan, minus its
0.8 em floor. A per-paragraph budget (32 passes, shared by the tab
loop) bounds the worst case.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Adds TextShape::Area { path } and lays it out: each paragraph is broken
a line at a time with parley's BreakLines, because a line's width
depends on where it lands in the shape (the row's spans at that
baseline), which break_all_lines can't express. Rows are planned with
the first style's metrics and re-planned once with the real ones when a
line is taller, so mixed sizes can leave a little extra gap. Lines align
within their own span (parley aligns per line to the width it was broken
at; no manual alignment needed). Text past the shape is hidden, as in a
text box, and hides later paragraphs too.
A span too narrow for the word that would start it (the narrow top of an
ellipse) is left empty and the word moves on, so lines stay inside the
shape; a word wider than the whole shape overflows its span, as in a box.
BreakLines doesn't report trailing whitespace, so this is checked after
each pass and the paragraph re-broken (at most 64 skips).
PSD has no area type writer yet: an area layer saves as paragraph text
over the path's bounds, so Photoshop opens it wrapping in a rectangle.
Other matches (PSD import, transform box, point/box conversions) get the
arm matching their neighbours.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
An entry's value only has to lie inside the file, so many Exif entries can
point at the same bytes: a 62 KB TIFF with 1,000 such entries made the reader
copy 50 MB (and the block writer copy it again), on every TIFF import and on
export of a document carrying an EXIF block.
read() now has a copy budget shared by IFD0's descriptive tags and the GPS and
Exif directories: at most 4 MiB, and never more than the stream's own length,
since the values of a well-formed stream are distinct bytes of it. An entry
that does not fit is left out and later, smaller ones are still kept; the
small directories are read first so a huge maker note cannot crowd out the
GPS position. Maker notes of 200 KB and 1 MB round-trip as before.
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Rj8vs4QyUES3uwgX6SuGGh
read_plane decodes every segment through par::map and keeps the whole Vec of
decoded tiles until it scatters them into the destination, so the working set
is the sum of the tiles rather than the largest one. Each tile is charged
against Limits on its own just before it decodes (#2925), and max_alloc is a
per-buffer limit by contract, so a file that declares many segments which are
each admissible can still retain far more than any one of them allows.
Charge the sum before any segment decodes: retained_segment_bytes adds up the
decoded size of every segment from its declared geometry, refusing a segment
whose own size overflows rather than wrapping, and stops as soon as the running
total passes max_alloc.
A segment's geometry is declared independently of the image, which is what lets
the total run away. For a well-formed file the segments tile the image, so
their sum is about its own size and limits.check has already bounded it; what
this refuses is a file whose declared tiles are far larger than the image they
belong to.
Test: tiles that each sit far inside the budget are refused once their sum
passes it, more samples a pixel cost proportionally more, an overflowing
geometry is refused rather than wrapping, and an ordinary 6000 x 4000 frame in
512-pixel tiles still passes the default limits.
With documents tiled side by side, a click into the other one moved it
to the first tile, swapping the two, and only the active tile showed
rulers. Each document now keeps its tile (with more documents than
tiles, the shown run slides just enough to include the active one), and
inactive tiles and floating windows draw their own document's rulers.
Guides and the zero point are still dragged in the active view.
The binary-search cut-off y - max_h rounds in f32 and could land above the
lo of an edge that really crosses the row, dropping it and flipping the
winding for the whole row. Add slack; the exact lo <= y < hi test still
filters extras. Also document that inner edges block width conservatively.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
spans sampled rows, so an edge sweeping across x between rows (slanted
holes, bowties, component crossings) was missed. It now takes the inside
intervals at the middle row and subtracts what every edge sweeps in the
band. Edges are indexed by y per component and boolean is a linear merge,
so a query no longer scans every edge. next_row clamps a far-above start,
and coordinates beyond 1e7 are rejected.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Unicode's line-breaking rules allow a break between any two Hangul
syllables, so Korean box text split words (설 / 정이나). Korean is set
with breaks at the spaces between words, as Photoshop does: runs of
Hangul now lay out with WordBreak::KeepAll. Chinese and Japanese keep
breaking between characters.
- the bevel program asks for both fields with B::bevel_fields, so they always come with the
same reach;
- field and bevel_fields share one windowing (fields_in_windows: one window, or bands on wasm),
so wasm pairs them per band instead of taking a separate path;
- compose's bevel_height and bevel_distance_fields share bevel_dists;
- sync_fx recomputes the pair together and returns Unsupported when the two are not over the
same rectangle at the same reach, instead of falling back to one at a time.
Test: paired_bevel_fields_equal_the_fields_one_at_a_time also checks the banded path.
On the GPU canvas a bevel size change recomputes BevelInside and BevelOutside on the CPU, one
distance_field call each, and each call ran sharp_edges (edge pixels and refined normals) on the
same window again; the CPU compositor already shares them (bevel_height). sharp_edges was ~17% of
the CPU time of those size changes.
When both fields are recomputed over the same rectangle at the same reach (a size change, a new
shape), sync_fx now computes them together: compose::effects::bevel_distance_fields finds the
sharp edges once and returns both. Same window, same functions, so both fields are bit for bit
the ones computed one at a time; the chamfer fields, wasm and a single bevel field keep the old
path.
Test: paired_bevel_fields_equal_the_fields_one_at_a_time (reach 3, 9, 40; whole region and two
parts; bit-equal to field() of each kind).
A chisel bevel size change rebuilds the bevel maps of the whole layer region. The distance
fields already run on threads (#2119), but the passes after them still ran on one thread over
every pixel: the chisel height from the two distances, the texture term, the highlight/shadow
shading (once, or twice for emboss styles) and the emboss inside/outside mix.
Each of these computes a pixel from its own inputs only (the height map, the shape, the
distances), so they now go row by row through par_units / par_fill like the fields: the same
arithmetic in the same order per pixel, so the maps are bit for bit the old ones whatever the
thread count. Maps under 65536 pixels and wasm stay on the calling thread.
Test: bevel_maps_do_not_depend_on_the_threads (4 shapes x 5 styles x 3 techniques, with soften
and a texture, 1 vs 2, 5 and 16 threads, every map bit-equal).
An Indexed Color document holds only its colour table's colours, and a
save quantises to them. Interpolating methods showed blended colours on
screen that the saved file then lost. image.imageSize now resamples an
Indexed document with Nearest Neighbor whatever method it is given, and
the dialog offers only Automatic and Nearest Neighbor for one.
* Fix two ui-egui tests broken on main by concurrent landings
- profile_open_tests: #5614 renamed the built-in profile to "(PhotoCraft)" after #5208
hard-coded "(Photocraft)" in the Use-embedded button label.
- smart_object_curves_preview_keeps_its_size_on_a_reduced_proxy (#5779): the reduced
square is in the right place, but its corner pixels are 220/255 after the smart
object's resampling; assert full coverage inside and over half at the corners.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* Web: ship the wasm as compressed parts behind a boot module (#5302)
The release site held the app's wasm as one file, which sits at the 25 MiB
per-file cap of Cloudflare Pages, so the 24 MiB gate failed unrelated PRs.
packaging/web/package.sh now gzips the wasm and cuts it into parts of at
most 20 MiB under app/, and ships the page of a new crate,
apps/photocraft-web-boot. That module fetches the parts in order, has the
browser inflate them (DecompressionStream) and passes the stream to the
app's own wasm-bindgen loader, so the browser still compiles while it
downloads. A failed download is retried twice, then the page says so.
The check is now that no file in the site is over 24 MiB. trunk build in
apps/photocraft-web and the Docker image still give one .wasm.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* Web boot: inflate the parts in the module where the browser can't (#5302)
* Tests: the adjustment-layer drag preview test follows #5778 (#5926)
#5778 caps a live adjustment-layer preview by the view's zoom, so at 100 %
the drag shows full resolution even with Low Resolution Previews on. The
test still expected the reduced copy there. It now checks that at 100 % every
column shows by default, and moves the low-res on/off comparison to 50 %,
where the reduced copy is still used: on, the drag shows only the (inverted)
black columns; off, it matches the committed view.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
---------
Co-authored-by: Brandon Thomas <echelon@gmail.com>
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
In an open menu a plain letter runs the row with that mnemonic. Typing
into Help › Search did too: "S" ran System Info and "A" opened the
ArtCraft website, so only "De" of "Deselect" could be typed. Mnemonics
now wait while a text field in the menu has the keyboard.
A press between pixels snapped both edges outwards, so 10 x 10 selected
11 x 11 and 1 x 1 selected 2 x 2. The near edge now goes to the closest
pixel edge and the far one is the size away. A click without a drag
places the Fixed Size selection, as in Photoshop.
rasterize_warped guarded its size with MAX_PIXELS alone, which says nothing
about bytes. The buffers it keeps live at once are all as deep as the format:
the f32 accumulator and the output surface are both stride deep, a finished
coverage buffer sits beside them for the colour being drawn, and each faux-bold
pass holds a second Coverage and the vector its finish builds. A CMYK bold
render at f32 therefore reserves several times what a plain grey one does for
the same pixel count, and every one of those buffers went through vec! or
Vec::with_capacity, which abort instead of returning.
Admit the peak before reserving any of it: fits_raster_budget derives it from
the stride, the sample size and whether a bold pass runs, refuses an overflowing
size rather than wrapping, and is checked against MAX_RASTER_BYTES (4 GiB, 1 GiB
where usize is 32 bits, so the wasm build keeps room for the document). Coverage
now reserves fallibly and finish returns an Option, and the accumulator goes
through a fallible zeroed(). A refusal returns the empty Rendered the oversized
path already returned, so callers see the existing "too big to draw" result
rather than a crash, and the document and its cached appearance are untouched.
Ordinary text is unaffected: the budget only binds above what MAX_PIXELS
already allowed for narrow formats.
Test: the peak tracks channels, sample width and faux bold against small
injected allowances, an overflowing size is refused, and a buffer that cannot
be served reserves nothing.
Photoshop stores Stroke › Overprint as `overprint` in the FrFX
descriptor. StrokeFx had no field for it, so an edited stroke was
written back without it and a stroke with Overprint on lost it.
Add `StrokeFx::overprint` (serde default, so older .pcraft files load),
read and write `overprint`, accept it in layer.layerStyle.stroke and show
the Overprint checkbox in the Layer Style dialog, as Photoshop does.
Rendering is unchanged.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>