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
 IsFileExtensionSupported?

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
PeterPanino Posted - Apr 15 2024 : 01:39:58
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?
1   L A T E S T    R E P L I E S    (Newest First)
xequte Posted - Apr 15 2024 : 04:31:25
Yes, you can use:

http://www.imageen.com/help/IEFilenameToFileFormat.html

The result will not be ioUnknown if the format is supported.

Nigel
Xequte Software
www.imageen.com