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

Pass image URI:s unmolested to egui #12

Merged
merged 3 commits into from
Sep 13, 2023

Conversation

emilk
Copy link
Contributor

@emilk emilk commented Sep 13, 2023

We shouldn't be adding file:// prefixes to users URI:s for them.

If a user does this:

egui_ctx.include_bytes("bytes://image.png", include_bytes!("image.png"));

they should be able to put ![](bytes://image.png) in their markdown and have it work imho.

Of course, this change means users need to explicitly say file:// to indicate that the image should be loaded from a file at runtime. In this case, I think explicit is better than implicit though.

@lampsitter
Copy link
Owner

lampsitter commented Sep 13, 2023

That's unfortunate. Would it be possible instead to check if the uri does not have a foo:// prefix and only insert file:// upon such scenarios? Or is that too crude? Specifying file:// everytime seems tedious.

@lampsitter
Copy link
Owner

I'd rather have an option to disable the auto insert of file://, so that it can be left up to the user what the prefer

@emilk
Copy link
Contributor Author

emilk commented Sep 13, 2023

What about this?

678803d

@lampsitter lampsitter merged commit 7ae8297 into lampsitter:master Sep 13, 2023
1 check passed
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.

2 participants