JPEG support

This commit is contained in:
Quaternions 2023-10-02 18:38:37 -07:00
parent a57c228580
commit fa69c53cfc

View File

@ -342,6 +342,7 @@ fn load_image<R:Read+Seek+std::io::BufRead>(input:&mut R)->AResult<image::Dynami
input.rewind()?; input.rewind()?;
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)?),
_=>Err(anyhow::Error::msg("Unknown texture format")), _=>Err(anyhow::Error::msg("Unknown texture format")),
} }
} }