The links.unembed params text and docs/mcp.md now say that a distorted
image from a PSD or PSB file keeps its clip group when Unembed writes it
in the format it is stored in (PNG, or TIFF for a CMYK file), and that
Relink and Update Links to the written file keep it too. A path that
converts the image writes no clipping path, and the clip group becomes a
plain group.
- Test: tests_psdread::unembed_keeps_the_clipping_path_of_a_distorted_psd
adds an Update Links step on the written file and an Unembed to a .jpg
path.
The loader change that read the clipping path a PNG or TIFF keeps also
changed File > Open and File > Place of plain images. It is now #8561,
with its tests, params text and docs, and this branch reads files as
main does.
For a distorted image, Relink and Update Links now read the new file's
clipping path from the PNG or TIFF it is stored as when the reader gives
none, as they already do for the old file. Unembed of a distorted image
from a PSD or PSB file, with or without a folder, therefore keeps the
clip group of that file's clipping path, and so does a later Relink to
the written file.
- Test: tests_psdread::unembed_keeps_the_clipping_path_of_a_distorted_psd
(RGB file kept as PNG, CMYK file kept as TIFF, path and folder).
- Docs: docs/mcp.md, links.unembed params text, the progress-doc line.
Relink with `preserve` on an image changed by Perspective Distort or
Free Distort keeps the image's corners and now adds a `warnings` entry
naming the images the value was not applied to.
The params text of Update Links now says how it handles a distorted
image's corners and clipping path, and the docs/mcp.md paragraph is
rewrapped. docs/mcp.md says that Open also reads a PNG or TIFF written
by Unembed with its clip group.
New tests cover Update Links and Relink of a distorted image with a
PSD or DCS clipping path, Relink with scope all of a distorted image in
an opacity mask, and Open of a file written by Unembed.
An image changed by Perspective Distort or Free Distort was refused by
Relink, Embed and Unembed. Each now keeps the image's corners in one
undo step:
- Relink puts the new file's pixels between the corners, as Update
Links does, whatever `preserve` or the image's Placement Options say.
- Embed keeps the file's pixels in the document between the corners,
reading the file first when the image shows its saved preview.
- Unembed writes the pixels to the file and links the image to it with
the same corners. Unembed into a folder keeps the corners too.
Relink and Update Links also follow the clipping path a PSD, PSB or DCS
file names for a distorted image: the path is drawn through the corners,
a clip group of the old file's path takes the new file's, and it becomes
a plain group when the new file names none.
Unembed of an image from a PSD or PSB file took away the clip group of
the file's clipping path, plain images included: the PNG or TIFF it
writes keeps the path, but the file was read without it. A PNG or TIFF
that keeps the path now comes with it when it is read, so Unembed, and a
later Place, Relink or Update Links of the written file, keep the clip
group.
The params text of Relink, Embed and Unembed, docs/mcp.md and the
progress-doc line describe the new behavior.
- Create Gradient Mesh refuses a distorted image with the same message as
the other commands, so the complete-message catalogs translate it.
- Link Info gives a distorted image's scale and rotation at its middle,
where Image info measures its resolution.
- Update Links scales a distorted image's transform to the new pixel size,
so a placement by the transform keeps the image's size.
- Place with Replace refuses only the clip group shape that Replace
measures as its image.
- New test: Weed Box and Lines measure a distorted image by its corners.
The image-and-path distort test now moves the shared edge.
Docs: docs/mcp.md, docs/target-app-parity.md.
Perspective Distort and Free Distort (`object.distort`) used to give an image
only the warp's affine approximation at its center, so its corners did not
follow the handles and it drifted away from paths warped with it.
- An image's four corners now go exactly where the warp takes them, alone or
in a mixed selection. A parallelogram stays in the image's transform; any
other shape is kept in the new `image_quad` field of the native file, which
older files do not have and still open as before.
- Corners that would fold the image over, fall on one line, cross the warp's
horizon or lie too close together for a perspective map are an error, and
nothing changes. A file whose corners break these rules opens with the image
placed by its transform. A drag is one undo step, and a distort that leaves
the corners where they are records none.
- Bounds, hit testing, transforms, Transform effects, blends, the Eyedropper,
Outline view, the Color Theme Picker and Weed Box and Lines follow the
corners. Image info measures the resolution at the image's middle, and
plug-ins get the corners.
- The canvas, printing and every exporter draw a distorted image as a mesh of
affine image pieces through the shared mesh warp, clipped by the corners.
In files and print the mesh aims to stay within 0.05 pt with cells of at
least 2 pt; the canvas cuts it for the zoom, within a quarter of a pixel
with cells of at least 4 pixels. Pieces reach into their neighbors (0.5 pt,
or 2 pixels on the canvas), so the image stays opaque at every zoom. The
mesh has at most 64 by 64 cells and no more cells across than the image
has pixels on its longer side (at least 8). No warped copy of the pixels is
stored. DXF and WMF write the nearest parallelogram and warn.
- Crop Image, Image Trace, Relink, Embed, Unembed, Create Object Mosaic,
Create Gradient Mesh and Place with Replace refuse a distorted image with an
error that names the distortion. Update Links puts a changed file's pixels
between the same corners, without applying Placement Options. Mask follows
the corners. Rasterize makes a plain image of it.
- The new error messages have rows in every complete-message catalog.
Docs: docs/mcp.md, docs/plugins.md, docs/target-app-parity.md.
Object › Transform › Rotate Bounding Box… asks for an angle and turns the
bounding box of the selected objects by it, leaving their art where it
is. Reset Bounding Box squares it again.
- object.rotateBoundingBox {angle, absolute?}: by default the box turns
by angle from the angle the selected objects share (0 when theirs
differ); absolute: true turns it to angle. Objects with different
angles get one shared angle, and the objects inside a group or a
linked opacity mask turn with it and keep their relative angle. A path
of a compound path selected on its own turns only its own box, the
same objects the transforms move. An angle within 1e-6° of 0 is
stored as 0. One undo step, none when every box is already at the
angle. A missing or non-numeric angle is an error. changed counts
every box that turned, as object.resetBoundingBox counts the boxes it
squares.
- object.resetBoundingBox squares only the box of a compound path's
path selected on its own, instead of the whole compound path.
- Menu labels in every catalog.
Docs: docs/mcp.md, docs/target-app-parity.md.
Part of #5954.
When two File objects held changes to the same file, copy, length, a
new open of the file and a withdrawn grant wrote them in no fixed
order, so the copy or the file could end up with the older object's
bytes. They now write them in the order the objects were opened, as
the end of the run does.