Skip to content

Update how svg image file is being read#8893

Merged
jwoo-msft merged 3 commits into
mainfrom
sosharm_svg_file
Apr 26, 2024
Merged

Update how svg image file is being read#8893
jwoo-msft merged 3 commits into
mainfrom
sosharm_svg_file

Conversation

@sosharm
Copy link
Copy Markdown
Collaborator

@sosharm sosharm commented Apr 24, 2024

Related Issue

#8892

Description

LoadFromUriAsync() gives a file not found error even if the file exists in WinUI3. Updated to read as string and parse into xml.
There is room for refactoring the SVG xml handling code.

Sample Card

  1. Existing test: https://github.com/microsoft/AdaptiveCards/blob/main/samples/v1.5/Tests/Image.Svg.json

  2. { "type": "AdaptiveCard", "version": "1.6", "backgroundImage": { "url": "https://adaptivecards.io/content/Mostly%20Cloudy-Background.jpg" }, "body": [ { "type": "Image", "url": "https://dev.w3.org/SVG/tools/svgweb/samples/svg-files/car.svg", "size": "large" } ], "$schema": "http://adaptivecards.io/schemas/adaptive-card.json" }

How Verified

Verified using the WinUI3 visualizer

  1. https://github.com/microsoft/AdaptiveCards/blob/main/samples/v1.5/Tests/Image.Svg.json
    image

image

@sosharm sosharm marked this pull request as ready for review April 24, 2024 23:45
Comment thread source/uwp/SharedRenderer/lib/AdaptiveImageRenderer.cpp
@sosharm sosharm requested review from beervoley and paulcam206 April 25, 2024 00:03
Comment thread source/uwp/SharedRenderer/lib/AdaptiveImageRenderer.cpp
Copy link
Copy Markdown
Contributor

@beervoley beervoley left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approved. @jwoo-msft will follow up to refactor this.

@beervoley beervoley enabled auto-merge (squash) April 26, 2024 20:13
@jwoo-msft jwoo-msft disabled auto-merge April 26, 2024 20:15
@jwoo-msft jwoo-msft merged commit 61d2472 into main Apr 26, 2024
@jwoo-msft jwoo-msft deleted the sosharm_svg_file branch April 26, 2024 20:16
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.

4 participants