Commit Graph
511 Commits
Author SHA1 Message Date
el-j a0edcf73c4 Merge remote-tracking branch 'upstream/main' into fix/pdfx-transparency-reduction-6861 2026-11-17 00:42:30 +01:00
dotCooCoo 139f881f81 .ai import: a refused PDF part's error says why the editing data couldn't be read
When the import refuses a file's PDF part and its editing data can't be
read either, the error named only the PDF part. It now adds "its editing
data couldn't be read either (<why>)", as layers already do
(crates/eps/src/import.rs). The reasons come from the editing data
reader (a size limit, damaged compression) and from the private data
streams (larger than 256 MB, another filter or decode parameters,
damaged zlib data). A file without editing data, and an open with pages
picked, layers off or the editing data off, keep the PDF part's error.

Part of #4366.
2026-11-16 07:56:57 -08:00
el-j 9b80bb7807 Automated transparency reduction for PDF/X and PDF 1.3 (#6861) 2026-11-16 10:58:05 +01:00
FredApps bfe5c253f4 Merge remote-tracking branch 'origin/main' into feat/cutover-remaining-codecs
# Conflicts:
#	crates/engine/src/cmd/menucmds.rs
2026-11-16 06:35:17 +01:00
BFlat 9db3bc5ba4 Merge pull request #7952 from dotCooCoo/fix/emf-svg-symbol-art-live-effects
Export: live effects in symbol art apply in EMF, WMF and SVG
2026-11-16 08:11:28 +07:00
BFlat f15f711280 Merge pull request #7870 from dotCooCoo/fix/pdf-preserve-numbers-tagged-images
PDF export: Preserve Numbers converts tagged images from their profile
2026-11-16 08:11:02 +07:00
FredApps d2b8ebfd95 Merge origin/main into feat/cutover-remaining-codecs 2026-11-16 01:57:11 +01:00
BFlat bf7fefd89e Merge pull request #7954 from dotCooCoo/feat/file-info-templates
File Info: the menu saves, imports and lists metadata templates
2026-11-16 06:55:33 +07:00
dotCooCoo 846d000486 Merge main into fix/pdf-preserve-numbers-tagged-images 2026-11-15 13:58:49 -08:00
dotCooCoo 4a816d626f Merge main into fix/emf-svg-symbol-art-live-effects 2026-11-15 13:42:39 -08:00
BFlat d87cc85a90 Merge pull request #7917 from dotCooCoo/fix/pdf-trim-artboards-keep-bleed
Import PDF: artboards on trim boxes keep the bleed between them
2026-11-16 04:29:59 +07:00
BFlat 58cb42509e Merge pull request #7805 from dotCooCoo/fix/an-image-whose-recode-fails-is-written-without
PDF export: an image whose colors can't be converted is left out with a warning
2026-11-16 04:28:53 +07:00
dotCooCoo 02f8e55c5c Merge main into feat/file-info-templates 2026-11-15 12:21:52 -08:00
dotCooCoo 0b1b948f55 Merge main into fix/pdf-preserve-numbers-tagged-images 2026-11-15 12:15:12 -08:00
dotCooCoo 1c5d5ea4ba Merge main into fix/pdf-preserve-numbers-tagged-images 2026-11-15 12:15:12 -08:00
FredApps caa62aa79f Merge remote-tracking branch 'origin/main' into work7669 2026-11-15 21:06:46 +01:00
FredApps 33b5706c7a Merge pull request #7664 from storytold/fix/restore-codec-cutover-ci
Restore shared codec cutover with CI compatibility fixes
2026-11-15 21:05:52 +01:00
dotCooCoo 329aebc68c Merge main into feat/file-info-templates 2026-11-15 11:06:12 -08:00
dotCooCoo a670cd1102 File Info: metadata templates save, import and list from the File Info menu
File Info's menu saves the fields as an XMP metadata template (into the
Metadata Templates folder next to the preferences, or any file), imports
one with a choice of three merges, lists the saved templates and opens
the folder. The import is one undo step and records nothing when no
field changes.

- file.info.saveTemplate writes the title (when it is not the
  document's name), author, author title, description, keywords,
  rating, copyright status, notice and URL that have a value.
- file.info.applyTemplate reads a file, a saved template or XMP text
  (at most 8 MB) and merges it: replace clears the fields first, keep
  takes each field the template has, append adds keywords and fills
  only empty fields. apply: false returns the merged fields without
  changing the document.
- file.info.templates lists the folder's .xmp files.
- A PDF or .ai also opens with the rating and author title its XMP
  packet gives.

Docs: docs/mcp.md, docs/target-app-parity.md.
2026-11-15 11:05:55 -08:00
dotCooCoo 3a00d5d154 Merge main into fix/emf-svg-symbol-art-live-effects 2026-11-15 10:57:59 -08:00
dotCooCoo d4bbacc3eb Export: live effects in symbol art apply in EMF, WMF and SVG
EMF, WMF and SVG wrote a symbol instance from its symbol's art as stored,
so live effects inside that art were missing: a square moved 100 pt by a
Transform effect stayed in place in the file while the canvas drew it
moved. Art whose own place is off the artboard was left out even when
the effect moved it onto it.

These exports now call bake_document_placing_symbols, as PDF, print, EPS
and DXF do: each instance of a symbol whose art needs baking is written
as that art placed by the instance and then baked, so an instance that
scales or turns its art does not scale what its effects do. EMF and SVG
clip 9-slice cells and WMF does not, as each places other instances. In
SVG those instances are written as groups; instances of symbols without
such effects still share one <symbol>. Preserve Editing still embeds the
document with its live effects.

WrittenLayers gains hidden_objects. SVG sets it with Hidden Layers on,
since it then writes hidden objects too, so a hidden instance is written
hidden with its effects applied. The other exporters leave it off.

An SVG instance nested in another instance's art was shared through
<use> when the def allowed its own transform, while the <use> writes
that transform after the outer instances'. A stroked symbol nested in a
scaled instance then drew its stroke at double weight. The check now
uses the transform the <use> writes.
2026-11-15 10:57:09 -08:00
dotCooCoo f1507ccec3 Merge main into fix/an-image-whose-recode-fails-is-written-without 2026-11-15 10:54:25 -08:00
dotCooCoo a6d9dd2881 Import PDF: artboards on trim boxes keep the bleed between them
Opening a PDF with Crop To Trim Box put each artboard 36 pt after the
one before, while the bleed boxes round the trim boxes became the
document's bleed. With a bleed over 18 pt, one page's bleed reached
into the next artboard, and a page exported with its bleed showed part
of its neighbor. The document's bleed is now read from every picked
page first, and the artboards are 36 pt apart plus that bleed on both
sides, as linked pages on their trim boxes are laid out since #7723.
2026-11-15 10:34:12 -08:00
BFlat b759c9e369 Merge pull request #7874 from dotCooCoo/fix/pdf-dont-include-profiles-removes-image-profiles
PDF export: a set Don't Include Profiles removes image color profiles
2026-11-16 01:33:00 +07: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 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
dotCooCoo be2f993c4b PDF export: Preserve Numbers keeps a gray image's profile when RGB is tagged as sRGB
With Preserve Numbers, a non-sRGB RGB destination and RGB colors
ICC-tagged as sRGB (the `all` profiles setting, PDF/A-2b, PDF/X-3 and
PDF/X-4), a gray image that carries an ICC profile was converted to sRGB
grays and lost its profile. It now keeps its profile there, as in the
other destinations other than sRGB.
2026-11-15 08:56:03 -08: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 411310a757 PDF export: Preserve Numbers converts tagged images from their profile
With Output › Convert to Destination (Preserve Numbers), and in PDF/X-1a,
which converts the same way, a gray or RGB image that carries an ICC
profile had its numbers read as sRGB: converted as sRGB to a CMYK
destination, and kept as they were in an RGB one. Preserve Numbers keeps
the numbers of untagged content only, so such an image is now converted
from its profile to sRGB with the color settings' intent, and then to a
CMYK or other RGB destination, the document's own RGB profile included.

- An untagged RGB image keeps its numbers in an RGB destination and
  converts from sRGB to a CMYK one, as before.
- A gray image is converted to sRGB grays in an sRGB destination and
  keeps its profile in the others.
- With RGB colors ICC-tagged as sRGB, the image is written as sRGB.
- A profile the color engine can't read leaves the image as it is in an
  RGB destination, and its numbers read as sRGB in a CMYK one, with a
  warning each.
- The table for an RGB destination is built only when the first tagged
  image needs it.
2026-11-15 07:28:29 -08:00
dotCooCoo ec4a1ac25d PDF export: a set Don't Include Profiles removes image color profiles
When Profile inclusion is set to Don't Include Profiles (`profiles:
"none"`), gray, RGB and CMYK images are written in device color spaces
without their ICC profiles, and a JPEG that is kept as is loses its
APP2 ICC_PROFILE segments. PDF/A-2b, PDF/X-3 and PDF/X-4 keep tagging
their images.

Leaving the setting out keeps the earlier output. `profiles` now
serializes as null when not set, `"default"` clears a preset's value,
and Save PDF > Output lists Default first. Presets and stored settings
saved earlier hold `"profiles": "none"`, so exports from them now drop
image profiles.
2026-11-15 07:27:08 -08:00
dotCooCoo 0f7c46b04f PDF export: an image whose pixel data can't be read still warns that it couldn't be decoded
When the Output settings convert colors, a color image whose pixel data
can't be read was left out with the "couldn't be converted" warning, as
if it could have been written in its own colors. Such an image can't be
written at all, so it is again left out with the "couldn't be decoded"
warning, as every other PDF export does. Only an image beyond the decode
allowance, or one whose header can't be read, is left out as
unconverted.
2026-11-15 07:20:32 -08:00
dotCooCoo 9d9b69a544 PDF import: an isolated group with overprinting art inside stays isolated
The importer kept a group's isolation only when something inside it
blended, so an isolated group or knockout group whose objects only
overprint read back without isolation. Written out again, it lost its
/I true and its overprinting objects then kept the inks of the art below
the group that they had covered. Isolation is now also kept when a
visible fill or stroke inside, or characters' fill or stroke, overprints,
directly or through children that do not isolate.
2026-11-15 06:46:56 -08:00
FredApps c9cad8d017 Merge main into fix/restore-codec-cutover-ci
Port main's new variable-library parsing (variable kinds, image, visibility
and graph values) from roxmltree to craft-xml with the branch's strict
options and attribute validation. Keep both sides' variable tests.
Drop the stale docx::nesting doc link.
2026-11-15 15:43:44 +01:00
dotCooCoo 5ce407dfbf Merge main into fix/an-image-whose-recode-fails-is-written-without 2026-11-15 06:17:33 -08:00
dotCooCoo 00b26dd5f8 PDF export: an overprinting element of a knockout group that does not isolate overprints the art below
A test exports a knockout group that does not isolate, whose top element
overprints, and checks that its /K group carries no /I true, that the
overprinting graphics state (/OP, /op, /OPM 1) is written, and that the
overprint and the knockout group read back. An isolated group keeps
/I true.
2026-11-15 01:54:35 -08:00
dotCooCoo 9c537a3df0 Merge main into fix/a-knockout-group-with-no-blending-inside-still 2026-11-15 01:42:07 -08:00
BFlat 9f4609ec5a Merge pull request #7811 from dotCooCoo/fix/cmyk-images-from-pdf-or-eps-lose-their-source
PDF import: CMYK images keep the profile of their ICCBased color space
2026-11-15 16:39:14 +07:00
BFlat 6ec6114d24 Merge pull request #7751 from Hassan1305/fix-7741-pdf-text-stroke-cap
PDF import: stroked type keeps its cap, join and miter limit (#7741)
2026-11-15 16:39:02 +07:00
BFlat 792cc96217 Merge pull request #7784 from dotCooCoo/fix/a-nan-spot-tint-from-a-file-reaches-plate
Print: a spot or Registration tint that is not a finite number prints no ink
2026-11-15 15:44:07 +07:00
dotCooCoo 79919e279b PDF import: CMYK images keep the profile of their ICCBased color space
An image in a four-component ICCBased color space opened with its ink
amounts but without the profile its color space holds, so PDF export
could not write it in that profile again.

- The profile is read from the color space stream (at most 16 MiB) and
  kept when it is a well-formed CMYK profile. A CMYK TIFF carries it as
  tag 34675; a CMYK JPEG kept as it is carries it in ICC_PROFILE APP2
  segments in place of its own, with its compressed data unchanged, and
  one whose segments cannot hold it is stored as a CMYK TIFF.
- jpeg_with_icc passes over fill bytes (0xFF before a marker, ITU T.81
  B.1.1.2) and leaves them out of the output.
- A malformed, non-CMYK or larger profile leaves a decoded image's TIFF
  untagged and a kept JPEG as it is. DeviceCMYK and DeviceN images stay
  untagged.
- A CMYK TIFF's tag 34675 is read up to 16 MiB; before, a 4 MiB profile
  was read back and a 16 MiB one was not. The comments of
  tiff_icc_profile and source_icc give that limit.
2026-11-15 00:34:55 -08:00
dotCooCoo 1284dc6927 PDF export: a spot stop that prints nothing keeps a gradient image in CMYK
A linear or radial gradient of CMYK stops drawn as an image (a dithered
fill, or a Perceptual gradient that is not written as a spot shading)
was written as an RGB image whenever any stop was linked to a spot
swatch, even a stop that colors nothing: one inside fully transparent
stretches, one out of order between stretches with no width, or one at
a tint of 0 without process plates. The spot color warning already
skipped those stops.

The image now falls back to RGB only when a stop prints a spot ink, the
same test the warning and the spot shadings use. A drawn spot stop at a
tint above 0, or with process plates, still gives an RGB image with the
warning.
2026-11-14 22:38:00 -08:00
HassanKhan 9dafc08f8f PDF import: a glyph stroked otherwise gets a run of its own (#7741)
A filled glyph joins a run of the same fill whatever its stroke, so with
fill and stroke rendering shown a glyph at a time, the stroke replayed
over the last glyph restyled the whole run: glyphs before it took its
cap, join and miter limit. When that stroke differs from the run's, the
glyph's text now splits off into a run of its own; the line's text is
unchanged, so slots, gaps and authored flags still line up.

Also record the change in the parity and roadmap docs.
2026-11-15 11:05:54 +05:00
dotCooCoo 149280032e Merge main into fix/an-image-whose-recode-fails-is-written-without 2026-11-14 21:59:05 -08:00
HassanKhan 1301192aeb PDF import: stroked type keeps its cap, join and miter limit (#7741)
Glyph strokes reached the type's character style as paint and width only,
so stroked PDF text (rendering modes 1, 2, 5, 6, and under ActualText)
came in with butt caps, miter joins and a miter limit of 10. The text
path now carries the graphics state's line cap, line join and miter
limit, taken as paths take them, and glyphs stroked with other ones start
a run of their own.
2026-11-15 10:10:41 +05:00
dotCooCoo a84d7345f1 Merge main into fix/a-nan-spot-tint-from-a-file-reaches-plate 2026-11-14 20:50:57 -08:00
BFlat dc8149cdf1 Merge pull request #7723 from dotCooCoo/fix/pdf-page-links-review
Import PDF: linked pages refuse placeholder .ai files, read the file once and keep blank pages
2026-11-15 11:37:26 +07:00
BFlat 94432bf2d0 Merge pull request #7729 from dotCooCoo/fix/pdf-image-profile-to-destination
PDF export: CMYK and other RGB destinations convert tagged images from their profile
2026-11-15 11:36:32 +07:00
dotCooCoo 119ce7942b PDF export: an image whose colors can't be converted is left out with a warning
When the Output settings convert colors, an image whose pixels can't be
decoded or written in the destination's colors was written as it was, in
its own colors: a CMYK image with more pixels than CMYK inks are read for,
or a color image the writer could embed but the decoder could not read.
In PDF/X-1a that could also write a color space the standard forbids.

Such an image is now left out with the warning "an image couldn't be
converted to the Output destination and is missing from the picture".
Gray images, whose pixels are not converted, and files that convert no
colors keep the image as before. An image that can't be written at all
still gets the warning that it couldn't be decoded.
2026-11-14 18:42:17 -08:00
dotCooCoo 1a4dd4f800 PDF export: limit the own-profile rule to destinations other than sRGB
An sRGB destination converts tagged gray and RGB images to sRGB even when the
document's own RGB profile is sRGB, so the statement that the document's own
profile as destination keeps tagged images applies only to other RGB profiles.
2026-11-14 18:39:38 -08:00
dotCooCoo f55e42343e PDF export: state that the document's own RGB profile as destination keeps tagged images
With Convert to Destination and an RGB destination that is the document's
own RGB profile, RGB colors and RGB images keep their numbers, so an image
that carries an ICC profile keeps it. The export contract and progress line
now say so, and the test checks it.
2026-11-14 18:19:33 -08:00