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
 Detect file format?

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 12 2015 : 14:37:48
Hi! If I load an image with:

ImageEn1.IO.LoadFromFileAuto(UnknownImage);


how can I detect the TIOFileType from ImageEn1 and from that the correct file extension, so I can save it with:

SaveToFile(MyFileName + DetectedFileExtension, DetectedImageFormat);
3   L A T E S T    R E P L I E S    (Newest First)
xequte Posted - Apr 13 2015 : 02:20:37
Hi

There is a helper function now too.

Also, assuming you have already loaded an image into ImageEnView then IO.Params.FileType will return the type.

sNewExt := IEFileFormatGetInfo( ImageEnView1.IO.Params.FileType ).SuitableExtension;


Nigel
Xequte Software
www.xequte.com
nigel@xequte.com
PeterPanino Posted - Apr 12 2015 : 15:47:01
Thanks, much appreciated.
w2m Posted - Apr 12 2015 : 15:03:40
You can get the file type from imageenio.Params or from imageenio.FindFileFormat.
var
iIOFileType: TIOFileType;
iExtension: string;
begin
  iIOFileType := FindFileFormat('C:\myfile.dat', false);
  or
  iIOFileType := ImageEnView1.IO.Params.FileType;

  case iIOFileType of
    ioJPEG: iExtension := '.jpg';
    ioPNG: iExtension := '.png';
  ...
  end;
end;


Bill Miller
Adirondack Software & Graphics
Email: w2m@hughes.net
EBook: http://www.imageen.com/ebook/
Custom Commercial ImageEn Development