Honor ResolveExternalImages for image loading#501
Merged
Conversation
This was referenced May 12, 2026
This was referenced May 20, 2026
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.
PR Summary: Honor External Image Resolution Policy
Issue
Fixes #448.
SvgDocument.ResolveExternalImages = ExternalType.Nonewas not honored by the Svg.Skia image-loading path. The upstream SVG model guards external image resolution before opening local or remote resources, but the Svg.SkiaSvgService.GetImagepath used by retained rendering and filter image rendering loaded the resolved URI directly.Changes
SvgService.GetImagebefore loading non-data image URIs.ExternalType.Nonereturnsnulland does not invoke the asset loader for a local file URI.ExternalType.Localstill permits loading a local file URI and invokes the asset loader once.Commit Breakdown
Honor external image resolution policysrc/Svg.Model/Services/SvgService.cs.SvgDocument.ResolveExternalImages.AllowsResolving(uri)before callingGetImageFromWeb.Add external image policy teststests/Svg.Model.UnitTests/SvgServiceExternalImageTests.cs.Validation
Completed locally:
dotnet format Svg.Skia.slnx --no-restoredotnet build Svg.Skia.slnx -c Releasedotnet test Svg.Skia.slnx -c Release --no-restoredotnet test tests/Svg.Model.UnitTests/Svg.Model.UnitTests.csproj -c Release --no-restore --filter "FullyQualifiedName~SvgServiceExternalImageTests"git diff --checkThe full Release build completed with existing warnings in unrelated projects, including package vulnerability advisories, obsolete generated Skia API usage, and nullable warnings. The full Release test run completed successfully.
Notes
The change intentionally centralizes the policy check in
SvgService.GetImage, so direct<image>rendering andfeImagefilter paths receive the same external-resource behavior.