EXR stuff & error handling

This commit is contained in:
N00MKRAD
2024-06-24 11:36:43 +02:00
parent 73dcbe619a
commit ff23080453
5 changed files with 17 additions and 7 deletions

View File

@@ -23,8 +23,15 @@ namespace Flowframes.IO
{
public static Image GetImage(string path, bool allowMagickFallback = true, bool log = true)
{
var incompatibleExtensions = new List<string>() { "EXR" };
try
{
string ext = new FileInfo(path).Extension.TrimStart('.').ToUpper();
if (incompatibleExtensions.Contains(ext))
return null;
using (FileStream stream = new FileStream(path, FileMode.Open, FileAccess.Read))
return Image.FromStream(stream);
}