diff --git a/src/main.rs b/src/main.rs index fc9d48b..18dfbb9 100644 --- a/src/main.rs +++ b/src/main.rs @@ -315,10 +315,15 @@ fn convert(file_thing:std::fs::DirEntry) -> BoxResult<()>{ Err(error::Error::new("Unknown texture format"))? }; + let format=if image.width()%4!=0||image.height()%4!=0{ + image_dds::ImageFormat::R8G8B8A8Srgb + }else{ + image_dds::ImageFormat::BC7Srgb + }; //this fails if the image dimensions are not a multiple of 4 let dds = image_dds::dds_from_image( &image, - image_dds::ImageFormat::BC7Srgb, + format, image_dds::Quality::Slow, image_dds::Mipmaps::GeneratedAutomatic, )?;