mirror of
https://github.com/n00mkrad/flowframes.git
synced 2025-12-25 12:49:26 +01:00
EXR stuff & error handling
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user