Hi, I've been working on a program that can create .YTD
files from folders using images for Grand Theft Auto V.
Due to the game's nature, I need to convert the numerous image files to .DDS
so I'm using BCnEncoder.NET for that, but I'm having serious issues with some images, one of my testers has some textures that was extracted from Assetto Corsa and some of those textures can't be encoded, I'm getting the following error:
I already tried resaving the image (maintaining the same format) using Photoshop and Paint.NET and I even save it as .TGA
From a folder that has 34 textures just 30 of them were successfully converted to .DDS
.
So I will attach those four textures as well: crash.zip
And this is the code I'm using to export the .DDS
var amigo = bcEncoder.EncodeToDds(image); //Here's where the crash happens
MemoryStream ms = new();
amigo.Write(ms);
byte[] ddsbytes = ms.ToArray();
File.WriteAllBytes(Path.GetDirectoryName(filename) + "/" + GetImageName + ".dds", ddsbytes);
LbProgressLog.Dispatcher.Invoke(() => { LbProgressLog.AppendText($"\nDDS conversion of {Path.GetFileName(GetImageName)} was sucessful..."); });
Program details:
- .NET 6
- WPF
- Targeted for Windows7+