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

Add option to change default implicit uri scheme #24

Merged
merged 1 commit into from
Dec 13, 2023
Merged

Conversation

lampsitter
Copy link
Owner

Fixes #23

Would this work for you @JohnDowson?

@JohnDowson
Copy link

Weird issue. When doing something like this,

let cmv = CommonMarkViewer::new("TUTORIAL.md");
        #[cfg(target_arch = "wasm32")]
                let cmv = cmv.default_implicit_uri_scheme("http://127.0.0.1:8080/rack-designer/");
                        cmv.show(ui, &mut cache, TUTORIAL);

on native I get an image, while on WASM I now get a red warning icon with hover-text of "Failed to load such and such. The image format Png is not supported."
I do have the fetch feature enabled.

@JohnDowson
Copy link

Other than that, it's exactly what I've wanted.

@JohnDowson
Copy link

Weird issue. ....

Actually, this liiks like it might have more to do with @emilk 's egui_extras, given you don't seem to have any cfg gates to disable some image loaders.

@JohnDowson
Copy link

JohnDowson commented Dec 13, 2023

So, the work-around is to add image = { version = "0.24", features = ["png"] } to my dependencies on wasm32 targets.

Why it works without that on native is a mystery.

@emilk
Copy link
Contributor

emilk commented Dec 13, 2023

eframe uses the png feature to load the native application icon (if any).

By design, egui_extras does not enable all the image formats in the image crate, because there is a lot of them and it adds dependencies, compilation time, and binary bloat. That's why users needs to opt-in to the image formats they want.

@lampsitter lampsitter merged commit 402ea22 into master Dec 13, 2023
1 check passed
@lampsitter lampsitter deleted the uri-scheme branch December 13, 2023 15:12
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.

Is there some sort of a solution to disparity in image paths between WASM and native targets?
3 participants