print fourcc on unrecognized image format

This commit is contained in:
Quaternions 2023-10-02 19:55:10 -07:00
parent ff85efa54f
commit afa9e7447d

View File

@ -344,7 +344,7 @@ fn load_image<R:Read+Seek+std::io::BufRead>(input:&mut R)->AResult<image::Dynami
match &fourcc{ match &fourcc{
b"\x89PNG"=>Ok(image::load(input,image::ImageFormat::Png)?), b"\x89PNG"=>Ok(image::load(input,image::ImageFormat::Png)?),
b"JPEG"=>Ok(image::load(input,image::ImageFormat::Jpeg)?), b"JPEG"=>Ok(image::load(input,image::ImageFormat::Jpeg)?),
_=>Err(anyhow::Error::msg("Unknown texture format")), other=>Err(anyhow::Error::msg(format!("Unknown texture format {:?}",other))),
} }
} }