I have files that are usually - but not always - in TGA format. They are named with a .1 extension.
Code like the below fails on the new MagickImage(f) call with a "no delegate" exception when f is, for example, "00001.1"
If I change the file name and value of f to "00001.tga" it works. Is there a way to get Magick.NET to identify the image format regardless of file name extension?
Code like the below fails on the new MagickImage(f) call with a "no delegate" exception when f is, for example, "00001.1"
If I change the file name and value of f to "00001.tga" it works. Is there a way to get Magick.NET to identify the image format regardless of file name extension?
using (MagickImage image = new MagickImage(f))
{
// Convert to .bmp
image.Format = MagickFormat.Bmp;
// Create byte array that contains image
byte[] data = image.ToByteArray();
File.WriteAllBytes(Path.Combine(ImageFolder, jFolder, s.Replace(".1", ".bmp")), data);
}
Thanks!