-
Notifications
You must be signed in to change notification settings - Fork 563
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
slint-viewer: image loading support via save-data/load-data #6169
Comments
Thanks for filing an issue. Not all images is made out of a path, but we can find out the path for the image that have one. I think we could say that if the json contains a string, this is a URL. |
Right, I was thinking even just handling the path is much better off than before. Raw image encoding as base64/data url would be nice but image paths are probably fine 95% of the time and a big improvement to the development experience.
I think that's a good simple solution. I was originally worried about distinguishing between strings and images in the json, or a future raw image encoding scheme, however I'm probably over thinking it. The raw encoding scheme should probably just be a data URI, which is easy to test for. |
Thanks for the pointer, I'll take a look at implementing this when I have some time. |
It would be helpful to be able to load images via
slint-viewer --load-data
. Without this, it's hard to test components without hardcoding properties in.slint
files. The same syntax as@image-url()
would be enough IMO.test.slint
test.json
Expected:
The text was updated successfully, but these errors were encountered: