Skip to content

Commit

Permalink
Remove warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
woelper committed Jan 27, 2024
1 parent b9a5903 commit ba834e4
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions src/image_loader.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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::*;
Expand Down Expand Up @@ -277,7 +277,7 @@ pub fn open_image(img_location: &Path) -> Result<Receiver<Frame>> {
//TODO this needs to be a thread

fn foo(img_location: &Path, frame_sender: Sender<Frame>) -> Result<()> {
let mut image = JxlImage::builder()
let image = JxlImage::builder()
.open(img_location)
.map_err(|e| anyhow!("{e}"))?;
debug!("{:#?}", image.image_header().metadata);
Expand Down
2 changes: 1 addition & 1 deletion src/ktx2_loader/image.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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"),
}
}
Expand Down
4 changes: 2 additions & 2 deletions src/ktx2_loader/ktx2.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand Down Expand Up @@ -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() {
Expand Down

0 comments on commit ba834e4

Please sign in to comment.