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

 

ImageEn Forum
Profile    Join    Active Topics    Forum FAQ    Search this forumSearch
 All Forums
 ImageEn Library for Delphi, C++ and .Net
 ImageEn and IEvolution Support Forum
 IO.LoadFromFile vs IO.LoadFromFileAuto

Note: You must be registered in order to post a reply.
To register, click here. Registration is FREE!

View 
UserName:
Password:
Format  Bold Italicized Underline  Align Left Centered Align Right  Horizontal Rule  Insert Hyperlink   Browse for an image to attach to your post Browse for a zip to attach to your post Insert Code  Insert Quote Insert List
   
Message 

 

Emoji
Smile [:)] Big Smile [:D] Cool [8D] Blush [:I]
Tongue [:P] Evil [):] Wink [;)] Black Eye [B)]
Frown [:(] Shocked [:0] Angry [:(!] Sleepy [|)]
Kisses [:X] Approve [^] Disapprove [V] Question [?]

 
Check here to subscribe to this topic.
   

T O P I C    R E V I E W
xequte Posted - Oct 30 2015 : 04:33:16
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