Skip to content

Commit

Permalink
Guess at image format instead of extension (#219)
Browse files Browse the repository at this point in the history
  • Loading branch information
PhilipK committed Sep 1, 2022
1 parent 5c70762 commit 6671887
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/ui/defines.rs
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ pub mod ui_images {
}

pub fn load_image_from_path(path: &std::path::Path) -> Result<egui::ColorImage, image::ImageError> {
let image = image::io::Reader::open(path)?.decode()?;
let image = image::io::Reader::open(path)?.with_guessed_format()?.decode()?;
let size = [image.width() as _, image.height() as _];
let image_buffer = image.to_rgba8();
let pixels = image_buffer.as_flat_samples();
Expand Down

0 comments on commit 6671887

Please sign in to comment.