Commit Graph
897 Commits
Author SHA1 Message Date
FredApps d2b8ebfd95 Merge origin/main into feat/cutover-remaining-codecs 2026-11-16 01:57:11 +01:00
BFlat 87b936d80a Merge pull request #7970 from dotCooCoo/feat/ai-save-wrapped-area-type-live
.ai save: area type wrapped by plain paths, compound paths or groups stays type
2026-11-16 06:55:50 +07:00
FredApps 721d7bf4d8 refactor(eps): read CCITTFaxDecode through craft-stream-codecs
EPS fax images decode with craft_stream_codecs::decode_ccitt_raw instead
of hayro-ccitt directly. With EndOfBlock the rows end at the end-of-block
code whatever Rows says (rows 0), as before. Needs craft-libs#1772
(rows on bytes exactly as EncodedByteAlign says).
2026-11-16 00:21:12 +01:00
dotCooCoo ec9c558456 .ai save: area type wrapped by plain paths, compound paths or groups stays type
Area type with wrap shapes was always written as outlines in the editing
data for other apps. It is now written as type when the reader works the
same wrap out again from the objects above it: each wrap object is a path
of one subpath, a compound path of visible members, or an unclipped group
of such objects, with no paint, or a solid fill, a plain solid stroke or
both, without effects, art style, opacity mask or clipping, with an
offset within -1000 to 1000 pt; the type's stored shapes match the ones
those objects give it; and the shapes of all area type stay within the
2,000,000 anchors the reader copies. Each frame of a thread is checked on
its own. When art is left out at the object limit, such type is written
as outlines again. Other wrapped area type stays outlines.

The reader recomputes the wrap with resolve_wrap after reading
(resolve_text_wrap in crates/eps/src/import/native/build.rs) and reads the
options with text_wrap in crates/eps/src/import/ai/read/document.rs; the
round-trip tests check the reopened characters, frame, wrap shapes and
wrap objects. resolve_wrap's layer walk is shared through a new
wrap_sources so the check follows the same traversal.
2026-11-15 12:56:22 -08:00
dotCooCoo c0db7a8426 .ai save: envelopes on a large canvas stay editable
The editing copy of a large canvas wrote every envelope as its drawn
art. It now writes warp, mesh and top object envelopes live at 1/10 of
their size with the rest of the art, under the same checks as on a
normal canvas, and the reader opens them at their size from the editing
data alone or beside the PDF part.

Read from the editing data alone, a Large Canvas copy also gets:
- an envelope's saved box size compared with its contents at the
  declared scale, so a bounds margin kept with Distort Appearance is no
  longer lost;
- every path's stroke weight, dashes and dash offset at the declared
  scale, not at 1/10.
2026-11-15 10:33:11 -08:00
FredApps b652c6697c fix(codecs): keep main's behaviour where the cutover changed it
- EPS CCITTFaxDecode goes back to hayro-ccitt (main's filters.rs and data.rs):
  craft-stream-codecs decodes /K -1 /Columns 70 data to other rows
  (eps import::tests_images::ccitt_fax_images_draw). DCTDecode is main's again.
- The AI editing writer decodes through the image crate again: going through
  RGBA8 lost 16-bit sources, so their 8-bit warning disappeared
  (ai_editing::tests::sixteen_bit_images_are_written_at_eight_bits).
- Crop Image refuses an image over its allowance by header size again, with
  main's "an image of W × H pixels is too large to draw" message.
- Test fixes: colorized_images writes its gray PNGs gray again, and the PDF
  16→8-bit test expects rounding, as the 8-bit copy is made.
2026-11-15 19:01:25 +01: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 31658546a8 fix(codecs): build the cutover against craft-libs d6cd7836d
- Test files whose image→craft-image-codecs rewrites didn't compile against
  main's newer tests go back to main's versions (engine fileio/tests.rs,
  tests_tiffbmp.rs, tests/menucmds.rs, eps tests.rs); they still use the image
  crate, which keeps its format features.
- craft_jxl::encode, craft_image_codecs::encode and Image::icc at d6cd7836d.
- jp2read and pdf export pass DecodeOptions, not Limits.
- EPS DCTDecode: grey JPEGs no longer use the image after moving it, and keep
  main's one-channel output.
- svg keeps its direct usvg dependency for main's image href code; pdf keeps
  jpeg-encoder for CMYK JPEGs.
- clippy -D warnings and rustfmt clean.
2026-11-15 18:05:45 +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
BFlat bd67a010f6 Merge pull request #7827 from dotCooCoo/feat/ai-export-writes-kinsoku-kinsoku-shori-type
.ai export: paragraphs keep Kinsoku, Kinsoku Shori Type, Burasagari and Bunri-Kinshi
2026-11-15 22:45:05 +07:00
BFlat 9c2f6ec53d Merge pull request #7838 from dotCooCoo/feat/ai-save-nested-envelope-editable
.ai import: an envelope straight in another envelope's contents block opens live inside it
2026-11-15 22:44:56 +07:00
BFlat b389d3e5bc Merge pull request #7830 from dotCooCoo/fix/a-symbol-instance-written-as-its-art-reads-back
.ai save: live art written as a group keeps wrapping type by its bounds
2026-11-15 20:45:41 +07:00
dotCooCoo 6fc0ef4596 .ai import: an envelope straight in another envelope's contents block opens live inside it
An envelope record that lies in an outer envelope's AIDeformArtKey
block (X= ... X+) with no group around it now opens as a live envelope
inside the live outer one, and an object's own dictionary there (its
name) applies to it. Each envelope is still compared with its own drawn
art: an inner one that doesn't match keeps its drawn art as the outer
envelope's contents, and an outer one that doesn't match keeps its own.

- An envelope record in an opacity mask's art reads as part of the
  mask; its block's X+ no longer ends the mask's art, which failed the
  import.
- Envelopes still waiting for their XP when a dictionary ends keep
  their drawn art, so a stray XP in a later container cannot take them.
2026-11-15 04:54:40 -08:00
BFlat 8138a6e973 Merge pull request #7814 from dotCooCoo/feat/editing-one-anchor-copies-the-whole-anchor-list
Paths: editing one anchor of a long path keeps one chunk of anchors for undo
2026-11-15 17:31:01 +07:00
dotCooCoo c1b756e633 .ai save: the bounds rectangle of live art written as a group goes below its art
The unpainted rectangle that carries the text wrap options of a symbol
instance, blend, mesh, repeat, placed document, intertwine or envelope
written as a group of its art is now the group's first member. Area type
below the object still wraps by its bounds after reopening, and area type
in the art itself is not wrapped by the rectangle, so art that holds area
type no longer keeps the options on its group and wraps by its members.
2026-11-15 02:02:29 -08:00
dotCooCoo 028c8b5e99 Merge main into feat/ai-export-writes-kinsoku-kinsoku-shori-type 2026-11-15 01:41:30 -08:00
dotCooCoo 8183b4054a Merge main into fix/a-symbol-instance-written-as-its-art-reads-back 2026-11-15 01:41:25 -08:00
BFlat 0d277bc12e Merge pull request #7808 from dotCooCoo/fix/image-codes-created-inside-a-rolled-back-node
EPS: art left out at the page limit releases the images it encoded
2026-11-15 16:39:29 +07:00
BFlat c93b96ba1b Merge pull request #7783 from dotCooCoo/fix/opacity-mask-art-inside-symbols-pattern-tiles
.ai editing data: opacity mask art in symbols and pattern tiles keeps live effects
2026-11-15 15:46:39 +07:00
dotCooCoo 5de563faf1 .ai save: live art written as a group keeps wrapping type by its bounds
A symbol instance written as its art, and a blend, mesh, repeat, placed
document, intertwine or envelope written as a group of its art, wrapped
area type below it by its bounds before saving but by the members of
that art after reopening, because the group carried the text wrap
options. The group now ends with an unpainted rectangle at the object's
bounds that carries the options, as type written as outlines does, and
the group keeps the object's name, transparency, lock and visibility
without options of its own. Art holding shown area type written as
type keeps the options on its group; area type in an envelope does not
count. An object without finite bounds keeps the options on its group.
Without room for the rectangle within the object limit, the options are
left out with the limit's warning.
2026-11-15 00:46:34 -08:00
BFlat 7e7d229ac9 Merge pull request #7782 from dotCooCoo/fix/a-colorized-warped-image-decodes-its-coverage
Legacy .ai: a colorized warped image works out its coverage once
2026-11-15 15:44:35 +07:00
dotCooCoo b8b002a662 Merge main into feat/editing-one-anchor-copies-the-whole-anchor-list 2026-11-15 00:21:39 -08:00
dotCooCoo 456910f03f Merge main into fix/image-codes-created-inside-a-rolled-back-node 2026-11-15 00:01:54 -08:00
BFlat 6fe176f997 Merge pull request #7428 from dotCooCoo/feat/ai-save-nested-envelope
.ai save: type in an envelope stays editable
2026-11-15 14:42:55 +07:00
dotCooCoo 42658d2efc Merge main into fix/image-codes-created-inside-a-rolled-back-node 2026-11-14 22:55:46 -08:00
BFlat 0cef4fa727 Merge pull request #7743 from dotCooCoo/fix/legacy-ai-artboard
.ai import: legacy PostScript .ai files open on their own artboard
2026-11-15 13:50:00 +07:00
dotCooCoo b64ee486f9 Merge main into fix/opacity-mask-art-inside-symbols-pattern-tiles 2026-11-14 22:26:08 -08:00
dotCooCoo 50f2b2d07c Merge main into fix/a-colorized-warped-image-decodes-its-coverage 2026-11-14 22:25:49 -08:00
dotCooCoo 8ad2ecdc40 EPS: an image left out at the page limit is encoded again only once it fits
Each later placement of an image or a colorized image that was turned away at the page limit
was decoding and compressing it again. The scene now remembers what the first placement of a
turned-away encoding adds to the page and leaves later placements out with the same warning
while that still doesn't fit. Once the page has room again, after art is taken back, the image
is encoded and placed as usual.
2026-11-14 22:16:34 -08:00
dotCooCoo 7104cd05f3 Merge main into feat/editing-one-anchor-copies-the-whole-anchor-list 2026-11-14 22:05:53 -08:00
dotCooCoo 260da1cb7b Merge main into fix/image-codes-created-inside-a-rolled-back-node 2026-11-14 21:56:22 -08:00
dotCooCoo 496cdb54f5 Merge main into feat/ai-save-nested-envelope 2026-11-14 21:44:34 -08:00
BFlat 6dd478a420 Merge pull request #7456 from dotCooCoo/feat/ai-save-envelope-case
.ai save: a top object with uneven sides stays a live envelope
2026-11-15 12:37:47 +07:00
BFlat acf04dd00f Merge pull request #7724 from dotCooCoo/fix/ai-off-artboard-art
.ai import: symbol instances in older files are read, so art outside the artboard opens
2026-11-15 12:37:39 +07:00
dotCooCoo a5493a1cd0 Paths: editing one anchor of a long path keeps one chunk of anchors for undo
A subpath's anchors are now an `Anchors` list held in chunks of up to
256 anchors behind `Arc`s. Copying a path copies the chunk table and
shares the chunks, and editing one anchor copies only the chunk that
holds it, so the undo step of a one-anchor edit no longer keeps a copy
of every anchor of the path. Inserting or removing an anchor copies the
chunk it is in and rebuilds the table. Reads and edits follow the Vec
and slice methods the code used; files write and read each subpath's
anchors as one list, as before, within the same anchor read budget.

The undo memory estimate counts only the chunks the other version of
the path does not hold, and the renderer's kept paths compare only the
chunks an edit copied when they look for moved anchors.

Moving one anchor of an open path of 10,000 or 200,000 anchors
(path.moveAnchor, path.setHandle, path.moveAnchors, a nudge) keeps at
most 48 KiB in its undo and redo steps, where it kept 56 bytes per
anchor.
2026-11-14 21:25:15 -08:00
dotCooCoo f88b0f9e17 Merge main into fix/image-codes-created-inside-a-rolled-back-node 2026-11-14 20:55:00 -08:00
dotCooCoo 71a2597220 Merge main into fix/a-colorized-warped-image-decodes-its-coverage 2026-11-14 20:51:10 -08:00
dotCooCoo 633c54820d Merge main into fix/opacity-mask-art-inside-symbols-pattern-tiles 2026-11-14 20:37:41 -08:00
BFlat 3ce7b256b6 Merge pull request #7735 from dotCooCoo/fix/ai-cs-type-from-editing-data
.ai import: files saved for version 11 take their type from the text document
2026-11-15 11:36:41 +07:00
dotCooCoo 57d6b3066e Merge main into fix/image-codes-created-inside-a-rolled-back-node 2026-11-14 20:27:46 -08:00
dotCooCoo 8767cf847f .ai save: check a split top object's sides at every point they have
The writer compared the top object's patch with the one the reader makes
of the written grid on an even 9 x 9 grid of places. A split side can
change how the reader samples a short curve that falls between those
places, so a top object could be written live although the reader would
map the contents differently there.

Coons::places gives the places in u and v where the patch's sides have
points. Each side runs straight between them, so the writer now compares
the four sides of both patches at every one of those places, within a
third of the tolerance; a point inside a patch blends its sides and
corners, so the patches then lie within the tolerance everywhere.
2026-11-14 19:55:47 -08:00
BFlat 26878d3d0e Merge pull request #7715 from dotCooCoo/fix/svg-open-path-type-before-start
Type on a path: type on an open path can start before the path
2026-11-15 10:46:42 +07:00
dotCooCoo 85acda4523 Merge main into fix/opacity-mask-art-inside-symbols-pattern-tiles 2026-11-14 19:17:05 -08:00
dotCooCoo 2a3745e63b Merge main into fix/a-colorized-warped-image-decodes-its-coverage 2026-11-14 19:16:46 -08:00
dotCooCoo 5c1aed4c48 Merge main into feat/ai-save-nested-envelope 2026-11-14 19:16:43 -08:00
dotCooCoo c7352528bf Merge main into feat/ai-save-envelope-case 2026-11-14 19:05:05 -08:00
dotCooCoo b61674f2ab .ai import: legacy PostScript .ai files open on their own artboard
A .ai in the legacy PostScript format opened with the box around all of
its art as the artboard, so art placed off the artboard came in on it.
Files opened as .eps keep their page.

- A .ai file read through its layers used the EPS rule from #1102, which
  makes the art's bounding box the artboard. It now keeps the artboard
  its header gives (%AI5_ArtSize around the center of %AI3_TemplateBox),
  with its art outside it. The engine opens a PostScript .ai or .ait
  through the new vectorcraft_eps::import_ai; an EPS's private data is
  still read as an EPS.
- A .ai of versions 3 and 4 (no %AI5_FileFormat) does not record its
  artboard's size. When it has a template box, its artboard is now
  VectorCraft's own default, a US Letter page, centered on the template
  box's center, which the version 7 specification (section 2.2) places
  at the artboard's center. Before, it was the art's box. This also
  applies to .ai files other apps write with a template box and no art
  size (#1027).
- The center of a template box with a size (a file with a template
  image) is now the middle of the box, not its lower-left corner.

A .ai with neither an art size nor a template box keeps its art's box
as the artboard.
2026-11-14 19:02:25 -08:00
dotCooCoo e328b4178e Merge main into fix/ai-cs-type-from-editing-data 2026-11-14 19:00:51 -08:00
dotCooCoo 6efa53f562 Merge main into fix/ai-off-artboard-art 2026-11-14 18:55:35 -08:00
dotCooCoo 3e053fdc0b Merge main into feat/ai-export-writes-kinsoku-kinsoku-shori-type 2026-11-14 18:52:31 -08:00