diff --git a/src/image_loader.rs b/src/image_loader.rs index decd115..de0f744 100644 --- a/src/image_loader.rs +++ b/src/image_loader.rs @@ -10,7 +10,7 @@ use dds::DDS; use exr::prelude as exrs; use exr::prelude::*; use image::{DynamicImage, EncodableLayout, GrayAlphaImage, GrayImage, RgbImage, RgbaImage}; -use jxl_oxide::{JxlImage, PixelFormat, RenderResult}; +use jxl_oxide::{JxlImage, PixelFormat}; use quickraw::{data, DemosaicingMethod, Export, Input, Output, OutputType}; use rayon::prelude::{IntoParallelIterator, IntoParallelRefIterator, ParallelIterator}; use rgb::*; @@ -277,7 +277,7 @@ pub fn open_image(img_location: &Path) -> Result> { //TODO this needs to be a thread fn foo(img_location: &Path, frame_sender: Sender) -> Result<()> { - let mut image = JxlImage::builder() + let image = JxlImage::builder() .open(img_location) .map_err(|e| anyhow!("{e}"))?; debug!("{:#?}", image.image_header().metadata); diff --git a/src/ktx2_loader/image.rs b/src/ktx2_loader/image.rs index 2b282e0..adf1050 100644 --- a/src/ktx2_loader/image.rs +++ b/src/ktx2_loader/image.rs @@ -379,7 +379,7 @@ impl TextureFormatPixelInfo for TextureFormat { fn pixel_size(&self) -> usize { let info = self; match info.block_dimensions() { - (1, 1) => info.block_size(None).unwrap() as usize, + (1, 1) => info.block_copy_size(None).unwrap() as usize, _ => panic!("Using pixel_size for compressed textures is invalid"), } } diff --git a/src/ktx2_loader/ktx2.rs b/src/ktx2_loader/ktx2.rs index 7361c1a..804c721 100644 --- a/src/ktx2_loader/ktx2.rs +++ b/src/ktx2_loader/ktx2.rs @@ -154,7 +154,7 @@ pub fn ktx2_buffer_to_image( texture_format_info.block_dimensions().1, ); // Texture is not a depth or stencil format, it is possible to pass `None` and unwrap - let block_bytes = texture_format_info.block_size(None).unwrap(); + let block_bytes = texture_format_info.block_copy_size(None).unwrap(); let transcoder = LowLevelUastcTranscoder::new(); for (level, level_data) in levels.iter().enumerate() { @@ -232,7 +232,7 @@ pub fn ktx2_buffer_to_image( texture_format_info.block_dimensions().1 as usize, ); // Texture is not a depth or stencil format, it is possible to pass `None` and unwrap - let block_bytes = texture_format_info.block_size(None).unwrap() as usize; + let block_bytes = texture_format_info.block_copy_size(None).unwrap() as usize; let mut wgpu_data = vec![Vec::default(); (layer_count * face_count) as usize]; for (level, level_data) in levels.iter().enumerate() {