Repository navigation
feat(symbology): Image… lists SVG files, and an SVG marker image requires svg-markers (#2266 part E1b) - #2854
Conversation
… its test cleans up however it ends (opengeos#2266)
|
No actionable comments were generated in the recent review. Walkthrough
Merge Risk:
|
Code reviewBugs: None found. I checked the capability predicates against the existing Security: None found. SVG input is capped by Performance: None found. The extra Quality: Nothing worth posting inline. The one design point is already stated in the PR body: text that starts with AGENTS.md: No violations found in the changed files. Not verified: I had no shell, so I did not build, run Earlier concerns: There are no prior review threads on this PR, so none were left alone. Change sizeCompared with the base branch (merge base 4eb1add to PR head 81b355b): the whole PR against
|
📖 Docs preview
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 |
Code reviewI 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 Security: none found. Performance: none material. Each capability pass adds one walk over a layer's pictures, and Quality:
AGENTS.md: no breaks found. I checked:
Change sizeCompared with the base branch: the whole PR, merge base 4eb1add to PR head 81b355b.
|
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.
.png,.jpg,.jpegand.svgon the desktop and in the browser (MARKER_EXTENSIONS,crates/ui-egui/src/lib.rs). The phone's picker already lists every file.The capability
svg-markers. An SVG marker image (render::picture_marker_is_svg: the base64 starts as an SVG, as the renderer tells it) requiressvg-markersas well aspicture-markers, everywherepicture-markersis decided:Layer::any_picture/Renderer::any_picturewith that predicate);layer.marker,layer.lineStrokes,layer.fillLayers, in task steps,script.run, notebook cells and history), throughCOMMAND_CAPABILITIES. The existingcommand_uses_picture_markerand the newcommand_uses_svg_markershare 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-markersalone, 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-markersbut 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.mdasks 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.
svg-markers; before, it opened with circles and a notice that the image isn't a PNG or JPEG.picture_markers_svg.rgisfixture now requires both capabilities, as a save writes it.ROADMAP.mdnow 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 onrustgis-engine,rustgis-renderandrustgis-ui-eguiand what depends on them, doctests, layers,schema --check): 9,371 of 9,371 pass. The two later commits change only tests andROADMAP.md; the engine tests they touch pass.RUSTFLAGS='-D warnings' cargo check -p rustgis-web --target wasm32-unknown-unknownpasses.cargo xtask schemaregeneratedschema/project.schema.json(svg-markersadded to the capability lists).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, requirespicture-markersalone, 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, ascript.runstep, a notebook cell and history require both; with a PNG,picture-markersalone;an_svg_picture_marker_fixture_opens_drawn_or_saidnow also checks that saving names both.ui-egui:a_picked_svg_becomes_the_marker_and_one_it_cant_draw_is_said: the picker listssvg; a picked SVG becomes the marker as one undo step; one with a filter is said with its cause, and a.svgthat is plain text is said as not a PNG, JPEG or SVG, and neither changes anything.an_arcgis_services_picture_markers_draw_their_imagesnow expectssvg-markerstoo, 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
*.svgtoo):Related issue
Part of #2266 (part E1b).
Summary by CodeRabbit