I have found no method to detect if a specific FILE EXTENSION can be loaded in TImageEnView, for example:
ImageEnView1.IsFileExtensionSupported('.UnknownExtension');
So, as a workaround, I use this function:
function CanLoadImage(const FileName: string): Boolean;
var
ImageEnIO: TImageEnIO;
begin
Result := True;
ImageEnIO := TImageEnIO.Create(nil);
try
try
ImageEnIO.LoadFromFileAuto(FileName);
except
on E: Exception do
Result := False;
end;
finally
ImageEnIO.Free;
end;
end;
Is there a built-in method for this?