Skip to content

Conversation

michneaionuc
Copy link

  • Add base64 and urlencoding dependencies
  • Extend resolving pass to detect and process data URIs
  • Create temporary files for integration with existing embed_images pass
  • Support PNG, JPEG, GIF, WebP, and SVG formats
  • Closes Support for data uri (base64) in @image-url #4905

- Add base64 and urlencoding dependencies
- Extend resolving pass to detect and process data URIs
- Create temporary files for integration with existing embed_images pass
- Support PNG, JPEG, GIF, WebP, and SVG formats
- Closes slint-ui#4905
@CLAassistant
Copy link

CLAassistant commented Sep 14, 2025

CLA assistant check
All committers have signed the CLA.

@ogoffart
Copy link
Member

Thanks a lot for looking into this and contributing.

You could also add tests.
There is one test there that can be re-used: https://github.com/slint-ui/slint/pull/7201/files#diff-534717e5e2d4787e61ae9e281e0ee44de584b9bc27caf6818d75ed317a1c4fd0
Also add a screenshot test: https://github.com/slint-ui/slint/blob/master/docs/testing.md#screenshot-tests

The idea to store in a temporary file is great. Although i think we could improve it so we don't need it. You could add another variant the enum ImageReference for this kind of data, and either process it in the passes/embed_images.rs in a new kind of resources, or just keep it raw so it can be handled in the generated code just like we load other ressources.

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.

Support for data uri (base64) in @image-url
3 participants