Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Image/MauiImage does not render a particular SVG #19448

Closed
janusw opened this issue Dec 15, 2023 · 11 comments
Closed

Image/MauiImage does not render a particular SVG #19448

janusw opened this issue Dec 15, 2023 · 11 comments
Labels
area-controls-image Image control platform/android 🤖 platform/iOS 🍎 s/needs-attention Issue has more information and needs another look t/bug Something isn't working
Milestone

Comments

@janusw
Copy link
Contributor

janusw commented Dec 15, 2023

Description

I noticed that the following SVG file is not being rendered properly, when included as a MauiImage and referenced in an Image as png:

https://fonts.gstatic.com/s/i/short-term/release/materialsymbolsoutlined/directions_boat/default/48px.svg

<Image Source="directions_boat.png" />

All other SVG files that I tried work without a problem.

Steps to Reproduce

  1. Clone the repo below (a fork of dotnet/maui-samples).
  2. Check out the branch "MauiImage_svg_bug_repro"
  3. Open 8.0/UserInterface/ControlGallery/ControlGallery.sln
  4. Run it on an Android or iOS device.
  5. Select "Image (Display a bitmap)"
  6. Observe that the car is rendered, but the boat is not.

Link to public reproduction project repository

https://github.com/janusw/maui-samples/tree/MauiImage_svg_bug_repro

Version with bug

8.0.3

Is this a regression from previous behavior?

Not sure, did not test other versions

Last version that worked well

Unknown/Other

Affected platforms

iOS, Android

Affected platform versions

No response

Did you find any workaround?

No response

Relevant log output

No response

@janusw janusw added the t/bug Something isn't working label Dec 15, 2023
@Eilon Eilon added the area-image Image loading, sources, caching label Dec 15, 2023
@jsuarezruiz jsuarezruiz added the area-single-project Splash Screen, Multi-Targeting, MauiFont, MauiImage, MauiAsset, Resizetizer label Dec 18, 2023
@PureWeen
Copy link
Member

@janusw you'll need to change the extension to ".png" for it to render the image

<Image Source="directions_boat.png" />

@PureWeen PureWeen added the s/needs-info Issue needs more info from the author label Dec 18, 2023
@ghost
Copy link

ghost commented Dec 18, 2023

Hi @janusw. We have added the "s/needs-info" label to this issue, which indicates that we have an open question for you before we can take further action. This issue will be closed automatically in 7 days if we do not hear back from you by then - please feel free to re-open it if you come back to this issue after that time.

@janusw
Copy link
Contributor Author

janusw commented Dec 18, 2023

@janusw you'll need to change the extension to ".png" for it to render the image

<Image Source="directions_boat.png" />

Ah, yes, you're right. On iOS this will only work with png (I was primarily testing on Android, where in fact also svg works).

BUT: The boat icon still does not show up when using png (only the car does). There must be something specific about this svg that makes it fail.

@ghost ghost added s/needs-attention Issue has more information and needs another look and removed s/needs-info Issue needs more info from the author labels Dec 18, 2023
@janusw
Copy link
Contributor Author

janusw commented Dec 18, 2023

I'm attaching the generated pngs from my build directory (obj/Debug/net8.0-ios/ios-arm64/resizetizer/r/). They're empty:

directions_boat.png
directions_boat@2x.png
directions_boat@3x.png

@janusw
Copy link
Contributor Author

janusw commented Dec 19, 2023

possibly related to Redth/ResizetizerNT#43 ?

@PureWeen PureWeen removed the area-single-project Splash Screen, Multi-Targeting, MauiFont, MauiImage, MauiAsset, Resizetizer label Dec 19, 2023
@PureWeen PureWeen added this to the Backlog milestone Dec 19, 2023
@ghost
Copy link

ghost commented Dec 19, 2023

We've added this issue to our backlog, and we will work to address it as time and resources allow. If you have any additional information or questions about this issue, please leave a comment. For additional info about issue management, please read our Triage Process.

@PureWeen
Copy link
Member

@mattleibow thoughts?

@jkommeren
Copy link

Im having a possibly related issue where my svg is not rendered when used as the app icon, when shown as share destination in Android.

I'll create a ticket for it with demo project. The image worked in .net 7.

@janusw
Copy link
Contributor Author

janusw commented Dec 31, 2023

Im having a possibly related issue where my svg is not rendered when used as the app icon, when shown as share destination in Android.

I'll create a ticket for it with demo project. The image worked in .net 7.

This case must be slightly different than mine (mine fails already with .NET 7).

@jkommeren
Copy link

Im having a possibly related issue where my svg is not rendered when used as the app icon, when shown as share destination in Android.

I'll create a ticket for it with demo project. The image worked in .net 7.

This case must be slightly different than mine (mine fails already with .NET 7).

Ok, I'll mention this. Thanks!

@janusw
Copy link
Contributor Author

janusw commented Apr 11, 2024

The problem was still occurring up to version 8.0.14, but luckily it seems like it has been fixed in version 8.0.20, most probably via #16100. 🥳

@janusw janusw closed this as completed Apr 11, 2024
@Eilon Eilon added area-controls-image Image control and removed area-image Image loading, sources, caching labels May 10, 2024
@github-actions github-actions bot locked and limited conversation to collaborators Jun 11, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area-controls-image Image control platform/android 🤖 platform/iOS 🍎 s/needs-attention Issue has more information and needs another look t/bug Something isn't working
Projects
None yet
Development

No branches or pull requests

6 participants