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

SVG images not rendering if src URL has no .svg extension #1302

Open
mplgn opened this issue Aug 2, 2024 · 1 comment
Open

SVG images not rendering if src URL has no .svg extension #1302

mplgn opened this issue Aug 2, 2024 · 1 comment
Labels
bug Something isn't working

Comments

@mplgn
Copy link

mplgn commented Aug 2, 2024

Thanks for this awesome package!

Images stored in my CMS (ButterCMS) have urls without the image type file extension (e.g., no ".png", ".svg") in the src URL.

  • This works fine for all image types except svg.
  • When an svg image is given as the src, the alt text is rendered instead of the svg image
  • An image url with the .svg extension does render correctly (unfortunately not an option for me because of the CMS)

Steps to Reproduce

HTML
<img src="https://cdn.buttercms.com/gGgFu5YTmWA3vwTcJGSM" alt="SVG Image">
`HtmlWidget` configuration
HtmlWidget(
      '<img src="https://cdn.buttercms.com/gGgFu5YTmWA3vwTcJGSM" alt="SVG Image">',
)
Tesing environment
Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel stable, 3.22.3, on macOS 14.5 23F79 darwin-arm64, locale en-US)
[✓] Android toolchain - develop for Android devices (Android SDK version 34.0.0)
[✓] Xcode - develop for iOS and macOS (Xcode 15.4)
[✓] Chrome - develop for the web
[✓] Android Studio (version 2024.1)
[✓] IntelliJ IDEA Ultimate Edition (version 2024.1.4)
[✓] VS Code (version 1.91.1)
[✓] Connected device (6 available)
[✓] Network resources

• No issues found!

Expected results

image

Actual results

image
@mplgn mplgn added the bug Something isn't working label Aug 2, 2024
@daohoangson
Copy link
Owner

Yes, this is a limitation of the IMG handling logic. It depends on the extension to switch between built-in Flutter rendering and SVG rendering.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants