Commit Graph
169 Commits
Author SHA1 Message Date
dotCooCoo 132d2da4a1 Merge main into feat/plugin-api-filter-type-images-symbols 2026-11-25 19:01:04 -08:00
BFlat fc34e27d99 Merge pull request #9110 from dotCooCoo/feat/plugin-api-importers-place
Plug-ins: importers whose manifest sets place also read files for File › Place
2026-11-26 08:49:00 +07:00
dotCooCoo 5099ce5e55 Plug-ins: unknown keys inside a written style's nested attributes are refused
A paragraph style's hyphenation, justification, tab stops and list, and a
character style's stroke dash, now refuse a key they don't read, naming the
field, as the style's own keys already did. A misspelled nested key no longer
leaves that setting unchanged without an error.
2026-11-25 15:10:16 -08:00
dotCooCoo c0fd2170d0 Merge main into feat/plugin-api-filter-type-images-symbols 2026-11-25 13:59:45 -08:00
dotCooCoo 388e1f29ef Merge main into feat/plugin-api-importers-place 2026-11-25 09:46:45 -08:00
dotCooCoo f6bc3d942a Merge main into feat/plugin-api-run-notices 2026-11-25 09:36:45 -08:00
BFlat 9a9bdca382 Merge pull request #9088 from dotCooCoo/feat/plugin-api-document-info
Plug-ins: filters and plug-in commands read document information without a selection
2026-11-25 19:33:17 +07:00
dotCooCoo ee179f34dd Merge main into feat/plugin-api-filter-type-images-symbols 2026-11-25 04:26:13 -08:00
dotCooCoo 9d225ba091 Merge main into feat/plugins-load-on-workers
The Safe Mode choice after a stopped launch moves to main's dialog host and keeps listing every
plug-in that was loading: one name in the sentence, or the list with "Disable Listed Plug-ins and
Continue". Automation requests wait in the queue while plug-ins load, and one past its deadline is
answered as expired. File > Open and opening a file still wait for the plug-ins still loading.
2026-11-24 23:31:07 -08:00
dotCooCoo 3ca2cf7d34 Merge main into feat/plugin-api-document-info 2026-11-24 22:49:15 -08:00
dotCooCoo ccff9efebb Plug-ins: tests fail on a grants read error, check the replaced-file callback ran, and release held loads first
- The grant test accepts only a missing grants file as an empty list; any other read error fails it.
- The same-stamp replacement test asserts that the callback rewrote the file before it checks that
  nothing installed.
- The loader's ordering test binds the job senders after `loads`, so a failing assertion releases
  the held jobs before `loads` waits on them under the manual clock.
2026-11-24 22:46:38 -08:00
BFlat 0ce586a481 Merge pull request #9092 from dotCooCoo/feat/plugin-menu-placement
Plug-ins: a command's manifest can place it in another menu
2026-11-25 11:27:56 +07:00
BFlat bda9d9c11d Merge pull request #8909 from dotCooCoo/fix/plugin-result-limit
Plug-ins: the host refuses a function type past 32 parameters or results before validating code
2026-11-25 11:27:00 +07:00
dotCooCoo 99ffa0ebd8 Plug-ins: a command's menu.after is checked before its spaces are trimmed
A menu.after value with a control character at either end, or longer than 64 characters before its
spaces are trimmed, is refused with the same error as other wrongly shaped values.
2026-11-24 16:59:34 -08:00
dotCooCoo 9a60524d6b Merge main into feat/plugin-menu-placement 2026-11-24 16:21:26 -08:00
dotCooCoo 11e53bfe2e Merge main into fix/plugin-result-limit 2026-11-24 11:13:19 -08:00
dotCooCoo cef8a6d897 Plug-ins: background loads check stored files and ids again before they install
- A stored module's file is read again on its worker thread once the module
  has loaded, whatever the file's modified time, and the install still skips
  a file whose stamp changed since. The UI thread no longer reads the file.
- Stored and folder modules install through registry::install_for_load,
  which checks for an install or removal of the id elsewhere while the
  plug-ins' write lock is held, and records the module's grant in the same
  step. A grant is forgotten only while the plug-in that took that revision
  is still installed (registry::revoke_if_installed).
- A grant that a stored load removed and must put back for a later file is
  written to grants.json first; when that write fails, the module is not
  installed, and a grant put back for a module that then did not install is
  removed again.
- A folder load in which a file found no loader thread is loaded again the
  next time the preferences are applied. A plugin.reload keeps its report as
  the folder last loaded only when no load started after it.
- Loads: a job's time is read while it is marked finished, the deadline check
  reads the clock under the same lock, and only the jobs taken from the queue
  fail when no worker is left. wait() counts outcomes taken with ready() as
  released, so the jobs after them start.
- File › Open checks the path again after waiting for the plug-in loads.
- Tests wait for workers with bounded receives.
2026-11-24 09:27:50 -08:00
BFlat 3049775dee Merge pull request #9156 from dotCooCoo/fix/plugin-compound-member-state
Plug-ins: a filter keeps a compound path's hidden and locked members
2026-11-24 16:07:35 +07:00
BFlat 7d984fc7f3 Merge pull request #8964 from dotCooCoo/feat/plugin-manifest-section
Plug-ins: read the manifest from a custom section before running any code
2026-11-24 16:03:53 +07:00
dotCooCoo 2fbe099c48 Plug-ins: refuse replacing a compound path's members when one isn't a path
A member that is not a path (a compound path inside a compound path) is
not in the input's `path`, so a changed `path` or `type: "path"` deleted
it, together with any hidden or locked members it held. The host now
refuses such an output with an error naming the compound path. A
compound handed back as it was still keeps the member.

docs/plugins.md also says that new members keep the old ids by position
but not their names or live shapes. The test covers a nested compound
member and turning a compound with a guide member into a guide path.
2026-11-22 19:15:57 -08:00
dotCooCoo e4ce03a906 Plug-ins: a filter keeps a compound path's hidden and locked members
A filter that handed a compound path back rebuilt every member from the
returned path, even when the path was unchanged, so its hidden members
were shown and its locked members unlocked after any run.

- A compound path whose path comes back as it was, or is left out, keeps
  its members as they are.
- While a member is hidden, locked or a guide, a changed path or
  `type: "path"` is refused with an error naming the compound path. A
  guide member is allowed when the output also sets `guide`.
- A changed path still replaces the members, one per subpath, keeping
  the old members' ids by position.

Docs: docs/plugins.md.
2026-11-22 17:58:55 -08:00
dotCooCoo 03c1c6c70f Plug-ins: written type keeps one paragraph style per paragraph, and API level 2 filters may leave out an image's opacity
- A read-only image entry may leave out `opacity`, which hosts before API
  level 3 don't give, so a level 2 filter that rebuilds an image entry from
  the fields it knows still matches.
- A `text.paragraphs` list returned as it was given next to changed
  `text.runs` is checked against the new paragraphs: a count that no longer
  matches is refused instead of being dropped.
- Written runs hold at most 4,096 paragraphs, the limit for runs and for
  the paragraphs a filter is given.
- A fill or stroke in a written run's style with a key its `type` doesn't
  read (`tintt`) is refused with the `unknown key` error.
- The font family limit counts the name as given, not the trimmed name.
- The run styles of a type object are indexed once per object, not
  compared with every run's style.
- Character styles loaded from another document are skipped when their
  tracking, kerning, rotation, miter limit, dashes, Small Caps or variable
  font axes are out of range, as `charStyle.new` checks them.
- The plug-in command test's Size command adds a square, since an output
  that changes nothing records no undo step.

Docs: docs/plugins.md, docs/mcp.md, plugin.run params text.
2026-11-22 14:09:03 -08:00
dotCooCoo d5de4b2f6b Plug-ins: errors for filters that write objects are translated in every complete catalog
The messages a filter's `writes` manifest key and its changed type,
images and symbol instances can give have an `@msg` row in each of the
25 complete-message catalogs. The other new errors use messages the
catalogs already translate: "`{key}` must be a string", "`{key}` must
be an object", and "read-only field 'text' changed" for text changes to
an object that is not type.
2026-11-22 08:09:59 -08:00
dotCooCoo c664ce630b Plug-ins: importers whose manifest sets place also read files for File › Place
An importer plug-in with "place": true in its manifest now reads its files
for File › Place as well as File › Open. file.place, file.place.info and
file.place.queue take importer and params; without importer, a file no
built-in format reads goes to the first placing importer by id that lists
its extension. The importer is given at most 128 MiB of the file (a larger
file is refused from its size before it is read) with _context.mode
"place", and its objects, guides left out, become one group named after
the file, as one undo step, embedded. A decline, invalid output, a trap or
Cancel places nothing.

- The Place dialog lists placing importers' extensions under "All
  placeable files" and in a filter named after each importer.
- On the web, a placing importer's file dropped on the canvas is placed.
- A file placed with a named importer skips the text, PDF, DXF and PSD
  import options.
- document.formats and plugin.list mark placing importers with place:
  true; place on any other kind is refused at install.

Docs: docs/plugins.md, docs/mcp.md, docs/gaps.md, docs/target-app-parity.md.
2026-11-22 07:20:07 -08:00
dotCooCoo 9fe9ad658a Plug-ins: paragraph styles follow the paragraphs' text when a filter adds or joins paragraphs
Runs written without text.paragraphs that change the paragraph count at
two separate places gave every paragraph between the first and last change
the first one's style. The host now matches the old and new paragraphs by
their text: an unchanged paragraph keeps its style, changed paragraphs take
the styles of those they replace in order, and an added paragraph takes the
style of the one before it (the next one at the start) without a list
number. Past 262,144 compared pairs the paragraphs are paired in order.
2026-11-22 06:51:52 -08:00
dotCooCoo 945d0a42b0 Plug-ins: check every number in the type styles a filter writes
Type a filter returned went to layout with its character and paragraph
styles only parsed, and a style equal to one of the type's runs was not
checked at all, so a filter could set leading of 1e9, 100,000 tab stops,
a scale of 0 or a Kinsoku set the document does not have.

- The ranges the character and paragraph style commands keep each
  attribute to move to CharStyle::check_ranges and
  ParaStyle::check_ranges in vectorcraft-doc (text/attr_ranges.rs).
  charStyle.new, charStyle.edit, charStyle.setAttrs and the paragraph
  style commands call them, and so does the filter write path, for every
  run and paragraph style, including one the type already has.
- A paragraph style's custom Kinsoku set must name one of the
  document's sets, and takes that set's characters.
- The character style commands now also refuse tracking and kerning
  outside -1000 to 10000, rotation outside -360 to 360, a miter limit
  outside 1 to 500, Small Caps outside 1 to 200, negative dash lengths
  and a variable font axis setting that is not a number.

Each refusal names the object and the field, and the document does not
change. Docs: docs/plugins.md, docs/mcp.md, docs/target-app-parity.md.
2026-11-22 06:24:25 -08:00
dotCooCoo 57be8ca36f Plug-ins: a command's manifest can place it in another menu
At plug-in API level 2 a command may give `menu`: `{"path": [...],
"after"?: label}`. The menus list it in that menu, right after the
built-in item `after` names (either label of an item that switches
between two), or at the end of the menu, with the plug-in's name in
parentheses after its label. Keyboard Shortcuts, the command palette
and `command_list` list it under that menu, and `plugin.list` gives its
`menu` with `after` escaped.

A manifest may name 14 menus of Edit, Object, Type, Select, Effect and
View. File, Window, Help, the application menu and the submenus that
list files, fonts, panels or plug-ins are refused when the module is
installed, as is any other `menu`, an `after` that is not 1-64
printable characters and a repeated `menu`. A command whose label with
the plug-in's name reads like a built-in item or submenu of that menu,
or like a command a plug-in with a lower id places there, stays in its
plug-in's submenu, and `plugin.list` and `plugin.inspect` mark it
`placed: false`. The desktop app and `vectorcraft-cli` give the same
result. Commands of several plug-ins at one spot are listed in plug-in
id order and then manifest order. A plug-in whose commands are all
placed elsewhere is a single item in Object › Plug-ins. At API level 1
the key is ignored, repeated or not.
2026-11-22 04:38:27 -08:00
dotCooCoo 4011ab760b Plug-ins: test modules with no initial pages or a module name build
wat::module and wat::sectioned give a module at least one page of
initial memory, so the first vc_alloc block does not start at 0, which
the host refuses. wat::with_field adds its field after a module's $name
when the module has one, so a named module stays valid WebAssembly text.
2026-11-22 04:25:26 -08:00
dotCooCoo f8bbfae755 Plug-ins: a stored file whose read fails gives back its share of the store's bytes
- crates/engine/src/store.rs: each stored plug-in's load reports how
  much of its file it read. What a failed read did not read goes back to
  the 512 MiB the stored plug-ins may read together, on every platform;
  the permission check before the loads is removed. A file that what is
  left does not cover, but would if earlier reads failed, waits until
  those reads are done, so the files still install in file-name order.
  Disabled files and file stamps are taken once, when the store is
  listed. A file's content is compared with its loaded module at install
  only when the file was modified less than 2 s before the store was
  listed; the clock is read only when a file was listed. A grant the load
  removed goes back for a later file with the same id only when the
  grants file has no entry for the id, and each install turn reads the
  grants file once. At quit, a stored load takes no locks and a folder
  load does not wait for the store's turn or for another window that is
  changing the plug-ins.
- crates/engine/src/cmd/plugin.rs and crates/plugins/src/registry.rs:
  when a folder load turns off the file of a plug-in disabled by its id,
  the disabled list is saved in the same install turn, not only when the
  load ends. A change made in another window while the folder is being
  listed is one the load does not undo.
- crates/ui-egui: an export and File > Open install the plug-ins still
  loading before they look up the formats, and a control request waiting
  for the loads no longer asks for a frame of its own.
- crates/engine/src/file_access.rs: `ScopeHandle::capture` is as on
  `main` again. The new `ScopeHandle::capture_now` keeps the process's
  automation roots in force at capture time, and only the Additional
  Plug-ins Folder's per-file check uses it.
- New tests: a stored file replaced with one of the same length and
  modified time while it loaded is skipped; another window's
  `plugin.list` reports a folder still loading as loading; a grant given
  elsewhere after the load removed one is kept.
- docs/plugins.md: a module whose read and load take 10 s or longer is
  skipped also when it would have finished later, and at quit the app
  waits for the modules already loading, for at most 10 s. File > Open
  waits for the loads. The Loading
  paragraph and the docs/mcp.md lines are rewrapped.
2026-11-22 03:25:30 -08:00
dotCooCoo 891dc8006d Plug-ins: invisible notices are refused, and batch steps show their notice
A filter's `notice` made only of default-ignorable characters that the
host keeps as they are (U+034F combining grapheme joiner, the Hangul
fillers, variation selectors, invisible operators, tags and the like) was
accepted and showed an empty status message. Such a notice now refuses the
output, as one of only zero-width characters already did. The visible
character must also fall within the part the status bar shows: a notice
whose visible text comes after the 200-character cut is refused instead of
showing only the ellipsis. Text with a visible character keeps these
characters, and its bidirectional ones are still escaped.

A painted live effect that returned `notice` was refused and drew its
input unchanged, while the docs said the key is ignored. The painted
decoder now ignores a top-level `notice` and still refuses any other
unknown top-level key; the message and its catalog rows say so.

A plug-in step of an action or a `command.batch` now shows its notice in
the status bar too; when several steps report one, the last shows. The
run's result carries `pluginName`, the name of the plug-in that ran, next
to `notice`, so the status bar names the right plug-in even when a later
step of the batch removes or replaces it. The `plugin.run` and plug-in
command params text lists the new keys.

Docs: docs/plugins.md, docs/mcp.md.
2026-11-22 02:58:47 -08:00
dotCooCoo ed50dd06f4 Plug-ins: filters at API level 3 change type, images and symbol instances
A filter's manifest may list `writes`, the kinds among its `inputs` it
may change, at `api` 3 with `doc.write` in `permissions`. Such a filter
returns those objects with the fields it changes: type's runs and
paragraph styles, an image's transform and opacity, an instance's
transform and symbol (one already in the document), and each one's
name. Every value is checked as the input's limits and a path's paints
are; any other changed field, or a value out of range, refuses the run
naming the object and the field, and the document stays as it was.

The changes of one run are one undo step, and an output that changes
nothing records no undo step for any filter. Images are now also given
with their opacity.

Docs: docs/plugins.md, docs/mcp.md, docs/target-app-parity.md.
2026-11-22 01:24:01 -08:00
dotCooCoo 460678d341 Plug-ins: filters and plug-in commands read the document's settings, artboards, layers and swatches without a selection
A filter, or a live effect with commands, at plug-in API level 3 lists
`context` (settings, artboards, layers, swatches) with `doc.read` in its
permissions. Each filter or command run is then given those parts of the
active document in `_context.document`, whether or not anything is
selected: the document's name without its folder, color mode, units,
active artboard size, bleed and raster effects resolution; every
artboard's id, index, name, rectangle and whether it is active; every
layer and sublayer with its parent, depth, name, visibility, lock,
template, color and whether it is current; and every swatch as
swatch.list lists it. It holds no path, object or write handle, and
live-effect drawing, exporters and importers get none.

More than 10,000 rows or 4 MiB of them fail the run before the plug-in
starts, with the document unchanged, and each row takes 1,000
instructions from the run's budget. The install prompt names the wider
read. API_LEVEL is now 3, so older hosts refuse such a manifest.
plugin.list and plugin.info give `context`, and their params text names
it and API level 3.

The plug-in fuzz tests add hostile `context` manifests, installed and
run with and without a selection.

Docs: docs/plugins.md (Document information), docs/mcp.md,
docs/target-app-parity.md.
2026-11-22 01:02:00 -08:00
dotCooCoo 875bde4841 Plug-ins: a filter or plug-in command can report a notice in the status bar
A filter's output may hold `notice`, one string reporting what the run did.
It needs no permission and no host import. Once the output is applied,
plugin.run and plug-in commands return it as `notice`, and the desktop app
and the web build show it in the status bar as `Plug-in “name”: notice`.
The status bar translates the words around it and never the notice.

The host trims the notice, escapes control, bidirectional and separator
characters, and cuts it at 200 characters, escapes included. A notice that
is not a string or has no visible character refuses the output, and nothing
changes. A run that declines, fails, is refused or is canceled shows none,
and a live effect's notice is ignored.

Docs: docs/plugins.md, docs/mcp.md, docs/target-app-parity.md.
2026-11-22 00:12:07 -08:00
dotCooCoo 1b29256601 Plug-ins: stored and folder plug-ins load on worker threads while the window shows
At launch the desktop app loaded every stored plug-in and every module in
the Additional Plug-ins Folder on the UI thread before the window
appeared, one after the other. A slow or panicking module held up or
ended startup.

- crates/plugins/src/loader.rs (new): `Loads` runs load jobs on up to
  four threads. Each job runs inside `catch_unwind`; a panic or a load
  that takes 10 s or longer fails that job alone, and the others go on.
  Outcomes come back in job order.
- registry::FolderLoad and store::StoredLoad list in one step, load on
  the workers and install in file-name order. A module whose id was
  installed or removed in another window while it loaded is skipped.
- The desktop app loads in the background only during launch; frames
  install the finished loads. Plug-in commands, commands that edit,
  exports, control requests and files opened at launch wait for the
  loads first; view commands and queries do not.
- The launch marker names every plug-in still loading, not only the
  oldest. After a launch that stopped during the loads, the Safe Mode
  choice lists all of them, and Disable Listed Plug-ins and Continue
  turns them all off. `plugin.safeMode` adds `pendingItems`. A module
  whose load panicked is no longer named.

Docs: docs/plugins.md, docs/mcp.md.
2026-11-21 19:09:18 -08:00
dotCooCoo b919dbd66f Plug-ins: read the manifest from a custom section before running any code
A module may carry its manifest in a `vc_manifest` custom section, with
`"abi": 1` in place of the `vc_abi_version` export. When it does,
Plugin::load parses the manifest from the section and does not
instantiate the module: its start function, data segments,
`vc_abi_version` and `vc_manifest` do not run when it is inspected,
installed or loaded at startup. The host checks the imports against the
manifest's permissions, the exports `memory`, `vc_alloc` and `vc_run`
by type, and the initial memory and the tables against the limits a run
has (at most 4 tables of 100,000 elements). A module with more than one
such section is refused, and so is a section over 64 KiB, before its
contents are decoded, and a manifest in the section without `"abi": 1`.
The host uses the section and does not call a `vc_manifest` export.
Modules without the section load as before.

The Desaturate example carries the section and keeps the export, and
its fixture is rebuilt with Rust 1.100.0. build.sh clears RUSTFLAGS:
.cargo/config.toml sets `+simd128` for wasm32, and the host refuses
SIMD instructions. wat::sectioned builds test plug-ins with the section.
2026-11-20 21:39:33 -08:00
dotCooCoo e49a0d628c Plug-ins: storage calls pay instructions for the bytes they move
The settings and cache imports could move up to 1 GiB a run while the
instruction budget charged only for the calls themselves. The bytes they
read or write now cost the run one instruction per 64 bytes, counted
over the whole run so that splitting a transfer into calls costs the
same. A get also pays for the bytes it copies into the module's memory
that the store didn't count, such as a setting answered from memory.

A storage call pays from the store's fuel and from the part of the
budget not yet handed out. The meter it gives the storage holds no more
bytes than those instructions pay for, so a read or write the run can't
pay for doesn't happen, and the run ends with "instruction budget". A
read or write past the 1 GiB still returns -7. Bytes beyond the current
slice are read or written only before the deadline and Cancel, and the
host checks the deadline and Cancel after every storage call, so a run
past either stops after the call instead of at the next slice.

The plug-in fuzz test now also makes writes of up to about 1 MiB on
small instruction budgets.

Docs: docs/plugins.md.
2026-11-20 21:38:22 -08:00
BFlat f593dff00c Merge pull request #8903 from dotCooCoo/fix/plugins-folder-special-files
Plug-ins: the plug-ins folder can't block startup on a special file
2026-11-21 11:02:50 +07:00
dotCooCoo f50b903e4a Plug-ins: the host refuses a function type past 32 results before validating code
Plugin::load validates every function body with wasmparser before wasmi
reads the module, and wasmi's EnforcedLimits::strict() limit of 32
parameters and 32 results per function type applied only after that.
A module whose type has 1,000 results could make the validator hold
1,000 operand entries for each call to it.

check_features now reads the type section first and refuses a function
type with more than 32 parameters or results, with wasmi's message,
before any function body is validated.
2026-11-20 19:25:38 -08:00
dotCooCoo 2adc433f5e Plug-ins: the plug-ins folder can't block startup on a special file
A folder load checked each .wasm path and then opened it with a blocking
open. When a named pipe replaced the file between the two, the open held
the load until something wrote to the pipe, and with it startup or a
prefs.set of the folder. On Unix the file is now opened
without waiting and without making a terminal the controlling terminal,
and the opened file is checked again: anything that is not a regular file,
or is over the module limit, is refused and listed in the folder report.

A folder load still reads at most 1,000 .wasm files, the first by file
name, and now holds only those paths while it lists the folder. The
files past the first 1,000 were dropped and not reported; plugin.reload
and plugin.list now return their count as leftOut. An error while the
folder is listed fails the load, as an error opening the folder does,
instead of dropping the entries after it.
2026-11-20 17:28:22 -08:00
dotCooCoo b0fba57f4a Plug-ins: the host checks the WebAssembly features a plug-in uses
Plugin::load now validates each module with wasmparser and a fixed list
of WebAssembly features before wasmi reads it: mutable globals, sign
extension, saturating conversions, multi-value, bulk memory, reference
types, tail calls, extended constant expressions and floats. A module
that uses any other feature is refused, so a wasmi upgrade, a change to
its defaults or one of its crate features turned on elsewhere in the
build does not change what a plug-in may use. wasmi's Config is set to
the same list for every setter it has in this build.

The list is the set wasmi accepted before, without multi-memory. A
second memory was already refused by the one-memory limit; its error
now says "multiple memories". No module that loaded before is refused.

wasmparser 0.228.0 is the version wasmi 2.0.0 already uses.

A new test loads a plug-in that uses each listed feature and checks
that modules using SIMD, relaxed SIMD, memory64, a second memory,
custom page sizes, wide arithmetic, threads, exceptions, legacy
exceptions, function references or garbage collection are refused with
an error that names the feature.

docs/plugins.md lists the whole set; it named only four of the allowed
features before.
2026-11-20 17:25:01 -08:00
dotCooCoo 621c06bd26 Free Transform: distorted images keep their corners and placement through files, exports and refusals
- A file's corners are kept only when there are exactly four that the
  image can take; a longer list is skipped without decoding it. Corners
  the affine map misses stay a distortion, and a scale past the
  perspective limit leaves the image at its nearest affine placement.
- Distort checks the corners in a frame local to the quad, so a missed
  corner far from the origin is still refused.
- Relink and Unembed refuse a named or selected distorted image before
  searching a folder or writing a file. Create Gradient Mesh lists the
  distorted images it leaves in `skipped`. Place with Replace refuses
  only when the measured image is distorted and the file is not text.
- SVG cuts a distorted image in a scaled symbol instance at the placed
  size. EMF pieces store only the pixels inside their clip. PDF mesh
  pieces of a CMYK image keep a same-corner mask as its soft mask, color
  mask included. Both `.ai` writers write an image at the nesting limit
  at its nearest placement with a warning. DXF warns only when it writes
  the image.
- The canvas cuts the mesh by the view's largest stretch. Warped images
  with a singular placement keep finite corners.
- docs/mcp.md and docs/plugins.md describe the tolerances, the DXF and
  WMF fallback, the partial result of Create Gradient Mesh, and when a
  plug-in sees `corners`.
2026-11-18 17:13:56 -08:00
dotCooCoo 45835405a5 Merge main into feat/distort-images 2026-11-18 01:42:11 -08:00
dotCooCoo 4373826cc6 Free Transform: Perspective Distort and Free Distort put an image's corners on the handles
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.
2026-11-17 08:46:08 -08:00
dotCooCoo 7573744a60 Merge main into feat/plugin-budget-preference 2026-11-16 10:54:07 -08:00
dotCooCoo 620c07848b Plug-ins: Preferences set the instruction budget for object-filter runs (Normal or Large)
Preferences > Plug-ins & Scratch Disks > Plug-in Instruction Budget
(`pluginInstructionBudget`) is a VectorCraft setting. Normal, the default,
keeps the limits a filter run has today. Large gives each object filter run
250 M instructions plus 4,000 per input byte, with the 60 s time budget, Cancel
and the other limits unchanged. An approved heavy filter keeps its 1 G and
300 s with either value; live effects, exporters and importers keep their own
budgets. The next run of an installed filter uses the value in force when the
run is prepared.

prefs.set refuses any value but normal or large; a saved preferences file
with another value reads as Normal and the other preferences load as saved.

Docs: docs/plugins.md, docs/mcp.md, docs/target-app-parity.md.
2026-11-16 03:02:49 -08:00
FredApps 59ddf705b9 fix(codecs): read image sizes from headers for PNG, JPEG and TIFF again
craft_image_codecs::probe_size only reads WebP, EXR and the GIF/BMP/TGA family;
for PNG, JPEG and TIFF it returns Unsupported. The cutover used it for header
sizes, so DXF export left every PNG out (cad tests), plugin objects lost PNG
pixels, and EPS image-mask and SVG import fell back to decoding whole images to
learn their size. vectorcraft_doc::header_size reads PNG's IHDR and a JPEG's
frame through craft-image-codecs and other formats through the image crate's
header readers, as main does, without decoding pixels. The SVG filter's JPEG
size comes from jpeg_info instead of a full decode.
2026-11-15 18:35:21 +01:00
FredApps 5d492ebad2 Merge #7664 (fix/restore-codec-cutover-ci) into feat/cutover-remaining-codecs
Conflicts resolved in favour of main/#7664 in the 13 source files both touched
(doc/cmyk.rs, metafile/dib.rs, pdf images, svg import/files.rs, render paint and
encode tests, trace, engine load.rs), keeping main's newer TIFF/CMYK, DIB and PDF
image fixes. vectorcraft-doc stays on main's version until its CMYK reader moves
to craft-tiff. The image crate keeps its format features, and usvg, tiff,
zune-jpeg, hayro-ccitt and jpeg-encoder stay for the readers not yet moved.
Codec crates pinned to craft-libs d6cd7836d364177661b0ae17f48a0805e83a5f32.

Also fixes the compile errors CodeRabbit flagged (jp2read DecodeOptions,
filters.rs use-after-move) and the encode() arity at d6cd7836d.
2026-11-15 17:35:43 +01:00
dotCooCoo d078e13ad8 Plug-ins: painted live effects refuse gradient stop plates without a spot link
A gradient stop's process plates print beside the tint of the spot swatch
that the stop itself links to. A painted live effect could return a stop
with `plates` and no link, or a link to a process swatch or Registration,
and the result was drawn with plates that no plate ever prints.

- The painted-output decoder refuses `plates` on a stop with no `swatch`
  (absent or null). The gradient's own `swatch` does not link its stops.
- The reference check refuses `plates` on a stop linked to a swatch that
  is not a spot swatch. It runs again on a cached result, so a result is
  refused once its swatch stops being a spot swatch. A missing swatch
  keeps the error that names the swatch.
- Either fault refuses the whole result, and `lastError` names the
  stop's `plates`. Plates on a stop linked to a spot swatch, all-zero
  ones included, are kept. Filter and importer output keep clamping and
  unlinking plates as before.

Docs: docs/plugins.md, docs/target-app-parity.md. The new message has a
row in every complete message catalog.
2026-11-14 16:42:12 -08:00
Dylan M. Taylor 1d6c4dcd14 chore(codecs): cut over remaining image/tiff/ccitt codecs to craft-libs 2026-11-14 21:19:30 +00:00
dotCooCoo 7c40cd2df2 Plug-ins: unlinking a gradient stop's spot swatch also clears its plates
A filter or importer that changes a gradient paint unlinks each stop from
its swatch and resets its tint, but left the stop's process plates. The
PDF and EPS writers read plates only with a spot swatch, so the stop kept
a plates array with no ink, saved with the document and compared in later
edits. Unlinking now clears the plates too, in fills and strokes; a paint
returned unchanged keeps its link, tint and plates.

The plate clamping test now checks the decoded output, before admission.
2026-11-13 19:56:38 -08:00