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

Handle static RGB WebP images #5586

Merged
merged 1 commit into from
Jan 7, 2025
Merged

Handle static RGB WebP images #5586

merged 1 commit into from
Jan 7, 2025

Conversation

Aely0
Copy link
Contributor

@Aely0 Aely0 commented Jan 6, 2025

Current WebP loader assumes all WebP images to be RGBA, which is the case if the image is animated (that's what image crate assumes at least). Static images can instead choose to exclude its alpha channel, though it seems to be more of a default choice to include it, even if it's not being utilized. Currently, loading a static RGB WebP image will cause a panic when ColorImage::from_rgba_unmultiplied gets called in the loader

thread 'main' panicked at /home/aely/.cargo/git/checkouts/egui-226fc7cdd51201c1/f87219d/crates/epaint/src/image.rs:97:9:
assertion `left == right` failed
  left: 29184
 right: 21888

Copy link

github-actions bot commented Jan 6, 2025

Preview available at https://egui-pr-preview.github.io/pr/5586-webp-static-rgb
Note that it might take a couple seconds for the update to show up after the preview_build workflow has completed.

Copy link
Owner

@emilk emilk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice

@emilk emilk merged commit 7cb8187 into emilk:master Jan 7, 2025
25 of 26 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants