Skip to content

Commit

Permalink
upgrade image crate to 0.25
Browse files Browse the repository at this point in the history
  • Loading branch information
Davidster committed Jul 9, 2024
1 parent 2af96fb commit 4d57267
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 33 deletions.
30 changes: 5 additions & 25 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ env_logger = { version = "0.11", default-features = false, features = [
"humantime",
] }
profiling = "=1.0.14"
image = { version = "0.24", default-features = false, features = [
image = { version = "0.25", default-features = false, features = [
"hdr",
"jpeg",
"png",
Expand Down
15 changes: 8 additions & 7 deletions ikari/src/asset_loader.rs
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,6 @@ use crate::wasm_not_sync::{WasmNotSend, WasmNotSync};

use anyhow::bail;
use anyhow::Result;
use image::Pixel;
use std::collections::HashMap;

use std::collections::hash_map::Entry;
Expand Down Expand Up @@ -611,12 +610,14 @@ pub async fn make_bindable_skybox(paths: &SkyboxPaths) -> Result<BindableSkybox>
(metadata.width, metadata.height)
};
let skybox_rad_texture_decoded: Vec<F16> = {
let rgb_values = skybox_rad_texture_decoder.read_image_hdr()?;
rgb_values
.iter()
.copied()
.flat_map(|rbg| rbg.to_rgba().0.into_iter().map(F16::from))
.collect()
let dynamic_img = image::DynamicImage::from_decoder(skybox_rad_texture_decoder)?;
let image::DynamicImage::ImageRgb32F(img) = dynamic_img else {
anyhow::bail!(
"Expected HDR image to decode into rgb32f but it was {:?}",
dynamic_img.color(),
);
};
img.iter().copied().map(F16::from).collect()
};

bindable_environment_hdr =
Expand Down

0 comments on commit 4d57267

Please sign in to comment.