Commit Graph
12 Commits
Author SHA1 Message Date
dotCooCoo 1c5f97acfc File formats: .cmx gray and CMY colors, unnamed layers, stricter chunk search
- Colors in the older color fields read gray (model 9) and CMY (model 4)
  as the .cdr reader numbers them, instead of opening as black.
- A dash pattern whose lengths are all 0 draws a solid line, as for a
  .cdr outline.
- A curve whose point field is too short for its count and is not whole
  points with their type bytes is left out as damaged, instead of reading
  coordinates as point types.
- A layer without a name comes in unnamed, and the importer names it by
  its place, as for a .cdr drawing.
- After stray bytes, a chunk id starts with a letter and may hold digits
  and spaces, and the id found must name a chunk the reader uses or have
  a length that fits its list. Padding is no longer taken for a chunk.
- A canvas or a container in an object's attributes gives the
  unsupported-objects warning.
- A page with no size and no bounds is 612 x 792 pt, VectorCraft's own
  size, as for a .cdr page; PROVENANCE R61 says so. PROVENANCE also names
  the other program's .cmx reader, read for field order.
2026-11-18 17:54:13 -08:00
dotCooCoo c7d78a2dac File formats: open and place .cmx files
.cmx exchange files with 32-bit coordinates open and place as editable
art. vectorcraft-cdr reads the RIFF form CMX1, its header, the color,
pen, line type, dash, outline and arrowhead tables, and each page's
instructions in drawing order, into the drawing model the .cdr reader
uses, so the importer maps pages, layers, groups and curves with uniform
fills and outlines the same way. A layer that holds nothing is left out.
A page that gives no size of its own takes the size of the drawing's
bounds, which the page header stores, and is centered on them.

Text, images, rectangles, ellipses, clipping paths, fills other than
uniform ones and arrowheads are left out, and lenses are not applied;
the warnings name each kind, with rows in every complete catalog.
Big-endian files and files with 16-bit coordinates are refused with a
message. Layouts and their sources are rows R53 to R63 of
crates/cdr/PROVENANCE.md; tests use synthetic files only.
2026-11-18 15:52:44 -08:00
dotCooCoo 5c28beca75 CDR import: a fill or outline whose record is missing is damage
A shape that names a fill or outline id no record has comes in without that paint and with the damage warning, so the open counts as lossy. Id 0 without a record stays no paint.
2026-11-14 17:40:04 -08:00
dotCooCoo ca804d921e CDR import: hidden and locked art, fill rule, outline spot colors and uniform transparency
- Layers, groups and objects open hidden and locked from their flags (bit
  0x01 of byte 1, bit 0x10 of byte 0). Layers of one name merged across
  pages are hidden or locked only when all of them are; otherwise their
  art is, object by object. A clipped group's flags reach its objects.
  Hidden guidelines go on a hidden "Hidden guides" layer, and the other
  guides on the top shown layer.
- Byte 0 of argument 14001 other than 0 fills the shape with the nonzero
  rule; other shapes stay even-odd.
- From version 13 an outline's property list record that names a library
  color gives the outline that spot color.
- From version 13 a uniform transparency (a 117-byte record of version
  1300 in argument 8000) becomes the object's opacity, read as the
  transparency in percent, and its merge mode the blend mode where one
  matches. Lenses, other records and other merge modes keep the warning.
- A cdr8 file is the 8.01 variant whatever its vrsn chunk names. The
  argument 200 style id and the spnd id are u16 before version 6. A trfd
  entry ends at the next offset. A version 15 corner radius is held to
  half the shorter side.
- PROVENANCE.md adds source KF, the MIT-licensed fork of the
  specification by Zach Wolfe, and rows R51 and R52; LICENSE-kaitai.txt
  and NOTICE credit it.
2026-11-14 16:31:24 -08:00
dotCooCoo 0adb013041 CDR import: outlines set to scale with the object scale with its matrix
Bit 5 of an outline's line type marks it to scale with the object. Such an
outline's width and dashes are now multiplied by the square root of the
area factor of the shape's matrix, instead of keeping their stored width
(PROVENANCE.md R50). Other outlines keep their stored width.
2026-11-13 20:35:11 -08:00
dotCooCoo 7e89bf330d CDR import: keep the children read before a list is cut short
A list whose length runs past the end of its parent, as in a file cut
off inside its last page, now keeps the bytes it has, with the damage
warning. Its complete children before the cut are read; other chunks
that run past the end are still left out.
2026-11-12 19:23:25 -08:00
dotCooCoo daeb83d2ee CDR import: bound the walks of clipped groups and stop copying refused dashes
Every chunk walked inside a clipped group now counts toward a new
clipped_chunks limit (2,000,000), each time a container names the group,
empty groups included. Containers that all name one group of empty
groups took time in the product of the two counts; past the limit a
container's group is left out, with its guidelines, and the container
stays as a plain shape with the limit warning.

An outline record refused at the dash limit drops its dashes from the
cache, so later shapes that use it take it solid without copying the
dash list.
2026-11-12 19:04:31 -08:00
dotCooCoo c2789fff2a CDR import: report id arguments cut short and resolve styles in linear time
A container, fill, outline or style argument too short for the record id
it names now adds the damage warning. Before, a container argument of
fewer than four bytes imported the container alone and dropped the
objects it clips without a warning.

Resolving the style table's parent chains now removes each walk's styles
from the visited set one by one instead of clearing the set, whose cost
grew with its capacity after one long chain.
2026-11-12 18:30:51 -08:00
dotCooCoo 206f36f1df .cdr import: describe clipping containers and their sources by what they hold
The docs, comments and PROVENANCE.md rows R45 to R48 name clipping
containers by what they do, and cite the sample files without a vendor
prefix in their names.
2026-11-12 14:42:54 -08:00
dotCooCoo fdbdbe8696 .cdr import: read the chunks of a style list before version 7
Before version 7 a LIST stlt holds chunks, not the style table, but the
index left every such list unsplit, so fills and outlines kept there
were not found. The index now splits it by the drawing's version, the
one its first vrsn chunk names, once all of the file's own chunks are
read.
2026-11-12 14:27:57 -08:00
dotCooCoo f940e5e0f2 .cdr import: fuzz mutated drawings with styles and clipping containers, and place them
The importer's fuzz test of mutated RIFF drawings now also starts from a
drawing with a style table, a clipping container, an outline behind the fill and
a lens, and places each mutated drawing as well as opening it.
2026-11-12 14:03:22 -08:00
dotCooCoo 5da5317c6c .cdr import: integration tests build as one test binary
The crate's integration tests move to tests/it, one module per area,
built as a single test binary as the other crates' are. The file format
table now lists clipping containers, fills and outlines taken from the object's
style, and the lenses warning.
2026-11-12 13:56:50 -08:00