Repository navigation
.ai import: the editing data reader warns about each image it can't read - #2937
Merged
Merged
Conversation
Contributor
An image in a .ai's editing data whose operands had no matrix, fewer than 11 numbers, or a matrix of other than six numbers was left out with no warning. So was one whose matrix maps it onto a line or a point. The reader's warnings did not mention such an image, while the reader warned "an image VectorCraft can't read was left out" for an image whose size or bit depth it can't use. Each of those exits now adds the same warning, as does the one where the decoded pixels don't make an image.
bflatastic
force-pushed
the
fix/ai-image-left-out-warns
branch
from
October 18, 2026 17:09
bbf8794 to
ba32ef5
Compare
Member
|
Thanks @dotCooCoo, merged. It went through the full gate (fmt, clippy, tests, layers, wasm) in a batch with the other PRs landed today. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What and why
The reader of a
.ai's editing data leaves out an image it can't read. When the image's size or bit depth is out ofrange, it adds the warning "an image VectorCraft can't read was left out". On
mainat 299a4b3 it left the image outwith no warning in four other cases: the
XIoperands hold no matrix, they hold fewer than 11 numbers, the matrix hasother than six numbers, or the matrix maps the image onto a line or a point. A document read from such editing data
lacked the image, and its warnings did not mention it.
Each of those exits in
crates/eps/src/import/ai/read.rs(image_fromandadd_raster) now adds the same warning,as does the exit where the decoded pixels don't make an image. The reader already notes every placed file it can't
read.
How it was tested
Four tests in
crates/eps/src/import/ai/tests.rs, one for each case, check that the image is left out and that thewarning is listed once. All four fail on
mainwith no warning.Targeted checks:
cargo fmt --all -- --check,cargo clippy -p vectorcraft-eps --all-targets -- -D warnings,cargo test -p vectorcraft-eps(262 passed), andcargo xtask brands,layersandassets.On Windows 11 (x86-64) with rustc 1.99.0, on the branch merged with
mainat cdba0aa:CRAFT_FONTS_DIR=<craft-fonts checkout> cargo xtask cipasses all 10 steps (fmt, clippy, test, no-bundled-fonts,pdf-deps, assets, brands, cursors, layers, wasm), with 8,254 tests passed, 0 failed and 12 ignored.
git merge-treereports no conflicts withmainat cdba0aa, or with #1772 and #2753, which also changecrates/eps/src/import/ai/. #2038, #2403, #2532 and #2592 also changeread.rs; each merges with this branch in it andconflicts only in the files where it already conflicts with
main.Checklist
cargo xtask cipasses (fmt, clippy, tests, assets, brands, layers, wasm).unwrap(),expect(),panic!,unreachable!,todo!orunimplemented!outside tests, and no unchecked indexing on data from files, parameters ormessages. Errors are returned as
Resultand shown to the user(why and how).
ASSETS.md.Summary by CodeRabbit