Note: You must be registered in order to post a reply. To register, click here. Registration is FREE!
T O P I C R E V I E W
PeterPanino
Posted - Aug 19 2024 : 14:36:30 Is this the most efficient and fastest way to determine if a file is an image file (that can be loaded in ImageEn)?
function CanLoadImage(const AFile: string): Boolean;
var
ImageEnIO: TImageEnIO;
begin
Result := True;
ImageEnIO := TImageEnIO.Create(nil);
try
try
ImageEnIO.LoadFromFileAuto(AFile);
except
on E: Exception do
Result := False;
end;
finally
ImageEnIO.Free;
end;
end;
2 L A T E S T R E P L I E S (Newest First)
xequte
Posted - Aug 19 2024 : 17:48:52 Yes, though note that IsKnownFormat only checks that the file extension is known: