Skip to content

feat(symbology): Image… lists SVG files, and an SVG marker image requires svg-markers (#2266 part E1b) - #2854

Merged
jgregoriorincon merged 3 commits into
opengeos:mainfrom
jgregoriorincon:feat/2266-svg-picker-capability
Nov 24, 2026
Merged

jgregoriorincon merged 3 commits into
opengeos:mainfrom
jgregoriorincon:feat/2266-svg-picker-capability

Conversation

@jgregoriorincon

@jgregoriorincon jgregoriorincon commented Nov 24, 2026 •

Copy link
Copy Markdown
Contributor

Summary

The Image… entry of the marker menus now lists SVG files beside PNG and JPEG ones, and a project with an SVG marker image is named for an older reader to refuse. This is the part that #2704 (#2266 part E1a) said would follow: "The Image… picker still lists PNG and JPEG files only, and its messages still name those two; it, its messages and the project capability come next."

The picker.

  • Image… under Shape (symbol and stroke editors) and Marker (fill editor) lists .png, .jpg, .jpeg and .svg on the desktop and in the browser (MARKER_EXTENSIONS, crates/ui-egui/src/lib.rs). The phone's picker already lists every file.
  • The layout's Picture picker in the browser, which shared that filter, keeps PNG and JPEG: a layout picture isn't an SVG.
  • An SVG picked goes through the same command as by script, so one RustGIS doesn't draw is said with its own cause (the phrases from SVG picture markers: tighter reading bounds and precise refusal phrases (follow-up to #2704) #2713), and nothing changes.
  • The hover text and the notice for a file that isn't an image now say "PNG, JPEG or SVG".

The capability svg-markers. An SVG marker image (render::picture_marker_is_svg: the base64 starts as an SVG, as the renderer tells it) requires svg-markers as well as picture-markers, everywhere picture-markers is decided:

  • in projects, map files and layer files: a symbol's marker, a stacked stroke's markers, a dot fill, what No Fill hid, and saved styles (Layer::any_picture / Renderer::any_picture with that predicate);
  • in replayable commands (layer.marker, layer.lineStrokes, layer.fillLayers, in task steps, script.run, notebook cells and history), through COMMAND_CAPABILITIES. The existing command_uses_picture_marker and the new command_uses_svg_marker share one function, command_sets_marker_image, which differs only by the image it looks for.

A PNG or JPEG, or text that doesn't start as XML, requires picture-markers alone, as before. Text that starts as XML (its first character <) counts as an SVG, as the renderer tells one from its first bytes: saving doesn't read the SVG to decide, and an older reader draws neither.

Why a capability. A reader that knows picture-markers but takes PNG and JPEG only, such as v0.8.0, would open such a project with circles, and would refuse the saved command that sets the SVG when it replays. docs/maintaining.md asks that an older reader "refuse them rather than fail on the marker". SVG marker images (#2704) aren't in any release yet (v0.8.0 was cut before it merged), so no released reader that draws them is refused by this.

Behaviour changes.

  • A project with an SVG marker no longer opens in v0.8.0. Instead it is refused, naming svg-markers; before, it opened with circles and a notice that the image isn't a PNG or JPEG.
  • The picture_markers_svg.rgis fixture now requires both capabilities, as a save writes it.
  • ROADMAP.md now names what remains of SVG markers: bringing in QGIS SVG markers through the style importer.

Reach. The capability is computed when a project, map file or layer file is serialized, so it covers every surface that saves: desktop, browser, CLI, Python, Assistant/MCP and phone. The picker is the desktop's and the browser's; the phone already takes any file.

Testing

  • checks.sh (fmt, clippy -D warnings, nextest on rustgis-engine, rustgis-render and rustgis-ui-egui and what depends on them, doctests, layers, schema --check): 9,371 of 9,371 pass. The two later commits change only tests and ROADMAP.md; the engine tests they touch pass.
  • RUSTFLAGS='-D warnings' cargo check -p rustgis-web --target wasm32-unknown-unknown passes.
  • cargo xtask schema regenerated schema/project.schema.json (svg-markers added to the capability lists).
  • New tests, written first and seen failing:
    • engine:
      • an_svg_image_marker_requires_svg_markers_wherever_it_is_saved: a symbol's SVG (project, map file, layer file, saved style), a stroke's markers (project, layer file), a dot fill and what No Fill hid require both capabilities, as do the map files of a map package for a computer and for a phone; a PNG, or base64 text that isn't an image, requires picture-markers alone, and <html> counts as an SVG;
      • a_saved_command_setting_an_svg_marker_requires_svg_markers: the three commands with an SVG in a task step, a script.run step, a notebook cell and history require both; with a PNG, picture-markers alone;
      • an_svg_picture_marker_fixture_opens_drawn_or_said now also checks that saving names both.
    • ui-egui: a_picked_svg_becomes_the_marker_and_one_it_cant_draw_is_said: the picker lists svg; a picked SVG becomes the marker as one undo step; one with a filter is said with its cause, and a .svg that is plain text is said as not a PNG, JPEG or SVG, and neither changes anything.
  • an_arcgis_services_picture_markers_draw_their_images now expects svg-markers too, since its service gives an SVG.

UI evidence

Hovering Image… under Shape in the Symbology pane, before and after (the system's file dialog itself can't be captured headless; its filter now lists *.svg too):

Image… tooltip before and after

Related issue

Part of #2266 (part E1b).

Summary by CodeRabbit

  • New Features
    • You can now select SVG files alongside PNG and JPEG files for map markers.
    • Projects identify when SVG marker support is required.
  • Documentation
    • Updated the cartography guide and saved-file guidance to describe SVG marker support and compatibility requirements.

@coderabbitai

coderabbitai Bot commented Nov 24, 2026 •

Copy link
Copy Markdown
Contributor

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

SVG marker files are now included in marker file selection and validation. Saved projects, maps, layers, and commands detect SVG markers and declare svg-markers alongside picture-markers.

Changes: SVG Marker Support

Layer / File(s) Summary
Select and validate SVG markers
crates/ui-egui/src/lib.rs, crates/ui-egui/src/markerpick.rs, apps/rustgis-web/src/web.rs, docs/user-guide/cartography.md, ROADMAP.md
The marker picker includes SVG in its shared extension list and the computer file picker. Marker application accepts drawable SVG files and refuses unsupported content. The user guide and roadmap describe SVG marker selection and related work.
Detect and declare SVG marker requirements
schema/project.schema.json, crates/render/src/picture.rs, crates/render/src/lib.rs, crates/engine/src/project.rs, crates/engine/src/project_capabilities.rs, crates/engine/src/tests.rs, schema/fixtures/picture_markers_svg.rgis, docs/maintaining.md
The schema and capability detection identify saved content that uses SVG markers and add svg-markers alongside picture-markers. Tests cover marker commands, styles, layers, maps, and packages. Saved-file guidance describes the capability requirement.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Change: Feature

Possibly related issues

  • opengeos/RustGIS#2266 — The changes add SVG marker selection and capability detection, which implement part of the issue’s SVG picture-marker work.
  • opengeos/RustGIS#882 — The changes add SVG marker support, which is part of the tracked drawing work; the QGIS style importer remains outside this change.
  • opengeos/RustGIS#1405 — The changes use declared capabilities so saved content with SVG markers records a reader requirement.
  • opengeos/RustGIS#1853 — The changes extend the saved-file requires capability list with svg-markers.

Possibly related PRs

  • opengeos/RustGIS#2704 — Adds SVG picture-marker reading and drawing, which this change connects to marker selection and capability detection.
  • opengeos/RustGIS#2812 — Changes the unreadable-image notice for SVG markers, which this change also updates.
  • opengeos/RustGIS#2278 — Establishes the picture-marker path and picture-markers capability that this change extends with svg-markers.

Suggested reviewers: giswqs, flight1973, mavrick-f

Merge Risk: Minimal · up to 81b35

This change lets users pick SVG marker images and makes saved files that use them declare a new required capability, so older readers refuse them instead of drawing circles. No concrete merge-blocking issue was found.

Pre-merge checks: Passed 4

Check name Status Explanation
Title check Passed The title names the two main changes: the Image… picker now lists SVG files, and an SVG marker image requires the svg-markers capability. The raw summary confirms both changes in the picker code (mark…
Description check Passed The description follows the template. It has a Summary, a Testing section with commands and new tests, a UI evidence section with a before/after screenshot of the tooltip, and a Related issue section …
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full details: Title check

Explanation

The title names the two main changes: the Image… picker now lists SVG files, and an SVG marker image requires the svg-markers capability. The raw summary confirms both changes in the picker code (markerpick.rs, ui-egui lib.rs, web.rs) and in the capability detection (project_capabilities.rs, render picture_marker_is_svg). The title is specific and matches the changeset. The issue reference (#2266 part E1b) is a scope marker and does not affect the verdict.

Full details: Description check

Explanation

The description follows the template. It has a Summary, a Testing section with commands and new tests, a UI evidence section with a before/after screenshot of the tooltip, and a Related issue section that says the PR is part of #2266 (part E1b). The Summary explains what changed and why, including the svg-markers capability and older-reader behaviour. The Testing section lists checks run and the new tests. The UI evidence section is filled in, since the picker tooltip is visible UI, and the file dialog limitation is noted.

Finishing Touches

Generate unit tests (beta)

  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

A rabbit picks an SVG with care,
The marker list now lets it there.
Drawable shapes can join the map,
Unsupported ones meet a gentle tap.
Saved requirements mark the way,
And bunny hops through styles all day.

Recent review info

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: ASSERTIVE
  • Plan: Advanced
  • Run ID: bb560da5-01cc-491c-a95a-b021525a7495
Commits

Reviewing files that changed from the base of the PR and between 3ef251b and 81b355b.

Files selected for processing: 13

  • ROADMAP.md
  • apps/rustgis-web/src/web.rs
  • crates/engine/src/project.rs
  • crates/engine/src/project_capabilities.rs
  • crates/engine/src/tests.rs
  • crates/render/src/lib.rs
  • crates/render/src/picture.rs
  • crates/ui-egui/src/lib.rs
  • crates/ui-egui/src/markerpick.rs
  • docs/maintaining.md
  • docs/user-guide/cartography.md
  • schema/fixtures/picture_markers_svg.rgis
  • schema/project.schema.json

Included review availability: This review used your included allowance. Your plan provides up to 8 included reviews per hour; 7 remain after this review.

@github-actions

Copy link
Copy Markdown
Contributor

Code review

Bugs: None found. I checked the capability predicates against the existing has_picture_markers call sites, and the new svg-markers checks cover the same places (symbols, stacked strokes, dot fills, No Fill, saved styles, map and layer files, map packages, and the replayable commands). format only decodes the first 256 base64 characters, and it treats a whole-whitespace head as undecided, so it matches the renderer's own sniffing. The web picker reorder keeps the same branch order, and the picker goes through the same layer.marker / layer.lineStrokes / layer.fillLayers path, so it gets the same notices and one undo step. Confidence: moderate-high.

Security: None found. SVG input is capped by MARKER_FILE_MAX_BYTES before decode, and the SVG reader has node-count and billion-laughs tests and refuses links to other files. Confidence: moderate, based on reading the existing render tests rather than a fresh audit of the SVG parser.

Performance: None found. The extra any_picture(svg_picture) traversal runs once per save and only decodes 256 characters per picture marker.

Quality: Nothing worth posting inline. The one design point is already stated in the PR body: text that starts with < but isn't an SVG (for example <html>) now requires svg-markers, so v0.8.0 refuses such a project instead of drawing circles. That matches the refuse-rather-than-lose rule, so I'm not raising it.

AGENTS.md: No violations found in the changed files. schema/project.schema.json and the fixture are updated together. The new strings use tl!. The new test is gated #[cfg(not(target_arch = "wasm32"))], and the wasm build still compiles the shared MARKER_EXTENSIONS constant. The command help already said "PNG, JPEG or SVG", so the Assistant and MCP descriptions don't need changes.

Not verified: I had no shell, so I did not build, run cargo xtask ci, or run the new tests. The findings above come from reading the diff and the surrounding source.

Earlier concerns: There are no prior review threads on this PR, so none were left alone.

Change size

Compared with the base branch (merge base 4eb1add to PR head 81b355b): the whole PR against main, not the latest push.

Measure Value
Files changed 13 (0 added, 13 modified, 0 removed, 0 renamed)
Size before 5.40 MB
Size after 5.42 MB
Total size change +11.6 KB
File Before After Change
crates/engine/src/tests.rs 3.49 MB 3.49 MB +5.0 KB
crates/engine/src/project_capabilities.rs 115.8 KB 119.4 KB +3.6 KB
crates/ui-egui/src/markerpick.rs 19.1 KB 21.2 KB +2.1 KB
crates/render/src/lib.rs 840.6 KB 840.8 KB +243 B
crates/ui-egui/src/lib.rs 556.8 KB 557.0 KB +197 B
docs/maintaining.md 19.1 KB 19.2 KB +165 B
crates/render/src/picture.rs 50.7 KB 50.8 KB +155 B
apps/rustgis-web/src/web.rs 78.1 KB 78.3 KB +146 B
schema/project.schema.json 36.8 KB 36.9 KB +44 B
ROADMAP.md 19.8 KB 19.9 KB +43 B
crates/engine/src/project.rs 151.1 KB 151.1 KB +19 B
schema/fixtures/picture_markers_svg.rgis 2,290 B 2,304 B +14 B
docs/user-guide/cartography.md 72.8 KB 72.8 KB −9 B

@github-actions

Copy link
Copy Markdown
Contributor

📖 Docs preview

Item Value
Preview https://preview.rustgis.app/pr-2854/
Web app https://preview.rustgis.app/pr-2854/app/
Commit 81b355b

GitHub Pages takes a minute or two to publish a new commit. Newer commits from the fork aren't published until a maintainer adds the preview label (once per commit).

@jgregoriorincon
jgregoriorincon marked this pull request as ready for review November 24, 2026 13:36
@github-actions

Copy link
Copy Markdown
Contributor

Code review

I found no bugs, security problems, or AGENTS.md breaks in this PR. I reviewed by reading the diff and the surrounding source; I did not build or run the test suite. No prior review threads exist on this PR, so no earlier concerns were left alone.

Bugs: none found. The svg-markers capability logic is consistent across project, map file, layer file, saved style, map package, and replayable commands (layer.marker, layer.lineStrokes, layer.fillLayers, task steps, script.run, notebook cells, history). The one path I checked closely is base64 with interior line breaks: Picture::new only trims, and format() and picture_marker_check both decode strictly, so such an image is refused by the renderer too and the capability stays consistent. Confidence: high.

Security: none found.

Performance: none material. Each capability pass adds one walk over a layer's pictures, and format() decodes only the first 256 base64 characters of each. Confidence: high.

Quality:

  • crates/engine/src/project_capabilities.rs:98: svg_picture is a third one-line wrapper (svg_picture → rustgis_render::picture_marker_is_svg → picture::is_svg). A direct closure would do. Nit, to be left for the release quality pass. Confidence: high.

AGENTS.md: no breaks found. I checked:

  • schema/project.schema.json matches the new CAPABILITIES entry, and the fixture is updated.
  • The new test is gated cfg(not(wasm32)), and the web.rs branch order keeps marker in scope.
  • The four remaining pick_open(&["png","jpg","jpeg"]) calls are layout, presentation and annotation pickers, which correctly stay PNG/JPEG.
  • The new strings use tl!, and no command surface changed.
  • No unwrap/expect was added to non-test code.

Change size

Compared with the base branch: the whole PR, merge base 4eb1add to PR head 81b355b.

Measure Value
Files changed 13 (added 0, modified 13, removed 0, renamed 0)
Size before 5.40 MB
Size after 5.41 MB
Total size change +11.6 KB
Path Before After Change
crates/engine/src/tests.rs 3.49 MB 3.49 MB +5.0 KB
crates/engine/src/project_capabilities.rs 115.8 KB 119.4 KB +3.6 KB
crates/ui-egui/src/markerpick.rs 19.1 KB 21.2 KB +2.1 KB
crates/render/src/lib.rs 840.6 KB 840.8 KB +243 B
crates/ui-egui/src/lib.rs 556.8 KB 557.0 KB +197 B
docs/maintaining.md 19.1 KB 19.2 KB +165 B
crates/render/src/picture.rs 50.7 KB 50.8 KB +155 B
apps/rustgis-web/src/web.rs 78.1 KB 78.3 KB +146 B
schema/project.schema.json 36.8 KB 36.9 KB +44 B
ROADMAP.md 19.8 KB 19.9 KB +43 B
crates/engine/src/project.rs 151.1 KB 151.1 KB +19 B
schema/fixtures/picture_markers_svg.rgis 2.2 KB 2.3 KB +14 B
docs/user-guide/cartography.md 72.8 KB 72.8 KB -9 B

@jgregoriorincon
jgregoriorincon added this pull request to the merge queue Nov 24, 2026
Merged via the queue into opengeos:main with commit b7f08b4 Nov 24, 2026
32 checks passed
@jgregoriorincon
jgregoriorincon deleted the feat/2266-svg-picker-capability branch November 24, 2026 14:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant