With a free ratio, Shift on a crop corner kept the proportions by letting
the larger relative extent win, so (-100, -50) on an 800 x 500 frame gave
720 x 450. Photoshop projects the pointer onto the frame's diagonal through
the dragged corner and gives 706 x 441. Do the same, with and without Auto
Center Preview and on a turned frame. A ratio preset, Alt+Shift and edge
handles keep today's rule.
Conflict only in docs/file-format-parity.md: main's status line with this PR's Camera Raw crop entry first (Last updated 2026-11-02), and both revision-history rows, this PR's redated to 2026-11-02 above main's 2026-10-30 YCbCr TIFF row.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* TIFF: open YCbCr images as RGB (#10316)
Scanners often write JPEG-compressed YCbCr TIFFs with 2x2 chroma
subsampling. The tiff crate decodes and upsamples them but returns raw
YCbCr samples, which the decoder rejected with "colour type YCbCr(8)".
The new tiff/ycbcr.rs converts them to RGB after decoding: JPEG data
uses the JFIF full-range BT.601 conversion (as libtiff does), other
compressions honour ReferenceBlackWhite and YCbCrCoefficients with the
TIFF defaults as fallback. 8 and 16-bit. YCbCr with extra samples, or
in other sample formats, fails with a clear unsupported error.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* Contributors: add Yuki-init's display name
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* TIFF YCbCr: test that YCbCrCoefficients set the luma weights
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* TIFF: YCbCr tags with the wrong value count use the defaults
tag_f64s now returns None unless the tag holds exactly n values, so a
YCbCrCoefficients or ReferenceBlackWhite tag with extra values falls
back to the TIFF defaults instead of being truncated.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Lrgj5pnShYtsSnrsZq5iRn
* TIFF YCbCr: tests for tiled JPEG with ICC, big-endian 16-bit and planar
Covers the layouts the review asked for: a tiled 4:2:0 JPEG file with an
embedded profile (checked against an independent JPEG decoder), a
big-endian 16-bit file, and planar data in both byte orders.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Lrgj5pnShYtsSnrsZq5iRn
* TIFF YCbCr: cite the formula sources and pin the green-channel choice
Documents where the conversion comes from: TIFF 6.0 Section 21
(YCbCrCoefficients, pp. 90-91) and libtiff's tif_color.c
(TIFFYCbCrToRGBInit, TIFFYCbCrtoRGB). Red and blue follow the spec;
green follows libtiff and adds Y unscaled, which matches the spec only
when the luma weights sum to 1. The module doc records this as a
deliberate compatibility choice, and a new test pins it: with weights
0.25/0.25/0.25, mid gray stays (128, 128, 128).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Lrgj5pnShYtsSnrsZq5iRn
* Codecs README: YCbCr TIFFs with three 8- or 16-bit samples decode to RGB
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Lrgj5pnShYtsSnrsZq5iRn
* Format tiff_ycbcr tests with rustfmt
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* test(tiff): compare grouped YCbCr decoding and update support notes
* style(tiff): align grouped decode call with test formatting
* style(tiff): apply repository rustfmt to grouped YCbCr regression
---------
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Co-authored-by: FredApps <153173854+FredApps@users.noreply.github.com>
Co-authored-by: FredApps <FredApps@users.noreply.github.com>
Delete Cropped Pixels clips pixel layers, fill caches and video frames only. When a layer mask,
channel, the quick mask, the selection, type, a shape or a smart object holds the hidden pixels
over the budget, the refusal now says so instead of pointing to an option that can't clear it.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A crop with Delete Cropped Pixels off now turns the Background into a
normal layer named "Layer 0", as in Photoshop, within the crop's one
history step: straight, extending and turned crops, and crops with a
target W x H x Resolution. The pixels past the canvas stay on every
layer, and the area an extending crop adds is transparent on every
layer instead of taking the background colour. A turned crop converts
the Background before the turn, so it turns like the other layers and
keeps its overhang.
Delete Cropped Pixels on is unchanged. Image > Reveal All keeps its
current result (the Background stays, its extension takes the
background colour) by calling the inner crop with a keep-Background
flag. Content-Aware crop fill with Delete off was not measured and is
left as it is.
Adds crates/engine/tests/it/crop_delete_off_background.rs. The #7086
test now locks the cropped layer back into a Background, the state
documents saved before this change still hold.
The work path folds each subpath into everything before it, so a Ring
drawn over a rectangle in Path mode kept its hole as a subtracted subpath
and cut the rectangle where the hole overlapped it. Photoshop 2025 adds a
custom shape as one shape component: a ring placed with Combine over a
rectangle leaves the rectangle whole under the hole (checked by making a
selection from the work path).
The subpaths after a custom shape's first now join it, with holes wound
against it so the fill rule cuts them. Where the joined form would cover
a different area (an intersect or exclude subpath, or a cut reaching past
the shape, like the Crescent Moon's) the shape is appended as before.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
With no work path yet, Path mode started one with the default non-zero
rule and appended the outline's subpaths, so an even-odd custom shape
(shape.presets.new reads fillRule) lost its rule: a pentagram's middle
filled. The new work path now takes the outline's fill rule.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Path mode appended the outline with path.set's "op": "combine", which
sets every appended subpath's operation, so a Custom Shape's subtracted
subpaths (the Ring's hole, the Fish's eye) became combined ones. The
outline is now appended to the work path as it is and the whole path set
in one step, so each subpath keeps its own operation, as in Photoshop.
Dropping "op" alone, as suggested, would replace the work path instead
of adding to it.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
windows-latest unit failed in photocraft-compose's proptest the_split_route_agrees_with_the_exact_path, which this PR doesn't touch; main's CI is green.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A Path-mode click skipped the Create dialog but fell through to
finish_shape, so a press and release a fraction of a pixel apart (still
a click) rounded to a 1 x 1 px box and added a speck of a subpath to the
work path. A click in Path mode now ends there, for every Shape tool.
Test: a_path_mode_click_that_moved_a_little_adds_no_subpath
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
CodeRabbit on #9456 (outside-diff comment, canvas.rs 6814): in Path mode
a click on Rectangle, Ellipse, Triangle or Polygon still opened the
Create dialog, whose OK makes a shape layer; Path mode never draws one.
The dialog now opens in Shape mode only.
Test: a_path_mode_click_opens_no_create_dialog
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
CodeRabbit on #9456 (inline 4372132651): with a shape layer selected,
Path Selection and Direct Selection reach the same options bar, and in
Path mode they lost Fill and Stroke and stopped editing the shape's
radius. They now always show their paint controls and keep main's fixed
Shape menu; only the six Shape tools follow Path mode.
Test: selection_tools_ignore_the_shape_tools_path_mode
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
CodeRabbit on #9456: with a shape layer active, the Radius field in Path
mode read and edited that layer. In Path mode the options bar now has no
selected-shape target, so Radius only sets the next outline's radius.
Test: path_mode_radius_leaves_the_active_shape_layer_alone
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
CodeRabbit on #9456: Path mode hid the whole shape options bar, including
Rectangle Radius, Polygon Sides, Line Weight and the Custom Shape picker.
Path mode now hides only Fill and Stroke, as Photoshop's Path tool mode does.
Test: path_mode_keeps_the_geometry_options_and_hides_paint
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The Shape tools' mode dropdown offered only Shape, so a rectangle or an
ellipse could only become a shape layer. Photoshop's Shape tools have
Shape, Path and Pixels modes; Path adds the outline to the Work Path
and makes no layer.
The dropdown now offers Shape and Path (a tool option of its own,
`shape_mode`, Shape by default; the Pens keep their own mode). In Path
mode a drag adds its outline, custom shapes included, to the work path
as one more subpath, the preview shows the outline only, and the
fill/stroke options are hidden.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The filter-type dropdown row now reads Kind, Name, Mode and Color, the other five missing; status
line and revision history updated. No percentage changed; the scorecard has no row for it
(`cargo xtask scorecard` leaves docs/scorecard.md as it was).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The Layers panel's filter row gains Color after Kind, Name and Mode. Like
Photoshop's, it filters at once (by no colour at first) and lists the layers
whose label is the chosen colour; the colour menu is None plus the label
colours in Photoshop's order. ui.set's layerFilter takes "by": "color" and a
"color" label id.
Fixes#5898
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* Format: take the .pcraft envelope from craft-pcraft-format
The manifest envelope, TileRef, Hash, FORMAT_VERSION, EXTENSION, the
entry names, tile_path and blob_path, is_valid_hash, the manifest
nesting and item checks and the migration runner now come from
craft-libs' craft-pcraft-format. photocraft-format re-exports them, so
callers do not change. Manifest is craft_pcraft_format::Manifest<DocM>.
Saved bundles keep the same bytes. A save still checks only the nesting
and the item count of its manifest, not its size, and the manifest
nesting limit is still computed from photocraft_doc::MAX_GROUP_DEPTH.
Tests: a save, load and save again gives the same bytes in every color
mode and depth, with and without previews; MAX_GROUP_DEPTH equals
craft_pcraft_format::MAX_GROUP_DEPTH.
* Format: pin craft-pcraft-format from storytold/craft-libs
* Format: read manifests with craft-pcraft-format's read_manifest_with
Pins craft-pcraft-format to dca870a0, the head of craft-libs #407.
Loading reads the manifest with read_manifest_with, which runs the
limit check, the version check, the migration steps and the envelope
read in one path; the layers are still decoded one at a time after the
rest of the document. A save builds the manifest with Manifest::new and
tile references with TileRef::new, and the bundle's directory names and
the .zst suffix come from the crate's constants. Saved bytes and error
messages are unchanged.
* Format: pin craft-pcraft-format to craft-libs #407's head 04dd1bd
04dd1bd changes only the crate's docs and a test, so photocraft-format
builds the same code.
* Format: pin craft-pcraft-format to craft-libs main at b8f7d93
craft-libs #407 merged as b8f7d93. Its read_manifest also refuses a
thumbnail other than thumb.png and a composite other than
composite/preview.png, the only names photocraft-format writes.
Saving an action whose Equalize step has `selectedAreaOnly: "true"` wrote
a bare Equalize event, although the command refuses the string. Export
now accepts only the boolean `true` for that setting.
The Equalize dialog records the document it was opened for. OK while
another document is active leaves the dialog open and runs nothing.
Status lines and the prefs count follow main: 9 of 183 preferences do nothing with Column Size.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>