ImageEn for Delphi and C++ Builder ImageEn for Delphi and C++ Builder

 

ImageEn Forum
Profile    Join    Active Topics    Forum FAQ    Search this forumSearch
Forum membership is Free!  Click Join to sign-up
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 ImageEn Library for Delphi, C++ and .Net
 ImageEn and IEvolution Support Forum
 IO.LoadFromFile vs IO.LoadFromFileAuto
 New Topic  Reply to Topic
Author Previous Topic Topic Next Topic  

xequte

39076 Posts

Posted - Oct 30 2015 :  04:33:16  Show Profile  Reply
A user has asked the difference between the following:

ImageEnView1.IO.LoadFromFile( sFilename, True );
ImageEnView1.IO.LoadFromFileAuto( sFilename );


LoadFromFileAuto ignores the file extension and analyzes the file content to guess what format it is.

LoadFromFile (with bCheckUnknown = true) uses the file extension to load the file. If loading fails because the extension is incorrect, then it loads it by analyzing the content (i.e. same as LoadFromFileAuto).

So LoadFromFile is faster anytime an image has a valid extension (i.e. in almost every case). It is only slower when a file has an invalid extension (e.g. .BMP for a .JPEG file) as loading is attempted twice.

Nigel
Xequte Software
www.xequte.com
nigel@xequte.com
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
Jump To: